-
Notifications
You must be signed in to change notification settings - Fork 6
Added test for courses page and lesson content #175
Conversation
8e5d630
to
a71f43b
Compare
345f781
to
b127e5f
Compare
@@ -33,7 +33,7 @@ jobs: | |||
composer config repositories.systemseed/anu_lms path ../anu_lms && \ | |||
composer config minimum-stability dev && \ | |||
composer require "systemseed/anu_lms:*@dev" && \ | |||
composer require --dev drupal/core-dev:^9 && \ | |||
composer require --dev drupal/core-dev:^9 drupal/pathauto && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How should we install on local for running tests? I tried composer -- require systemseed/anu_lms:dev-js-tests --prefer-source
and it did NOT download pathauto. I had to manually install it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a simple issue. Drupalci somehow downloads the dev-dependencies of a module for testing. We are trying to emulate what drupalci does which I believe is not open source.
I think this situation will be different with the change from drupalci to gitlabci. It will draw inspiration and code from drupalspoons.
https://gitlab.com/drupalspoons/webmasters/-/tree/master/#local-development
So the main idea is that we shouldn't be installing anu_lms as part of another project (such as basilio) to develop it but anu_lms should spawn its own drupal site, therefore the dev-dependencies will be downloaded since it will be a composer install
in the root of the anu_lms project.
This means that composer -- require systemseed/anu_lms:dev-js-tests --prefer-source
can't be used for the development of anu_lms as it will NEVER pull the dev dependencies. Only when anu_lms is the root project.
This line in the circleci is just a patch before deciding to move to drupal.org. Added a comment to clarify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting info, thanks for sharing the details @rodrigoaguilera !
@@ -102,25 +102,38 @@ const ContentNavigation = ({ | |||
<Button | |||
{...buttonProps} | |||
onClick={() => history.push({ pathname: `/section-${currentIndex + 2}` })} | |||
aria-label={Drupal.t('Next', {}, { context: 'ANU LMS' })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's the right way to use aria-label. It doesn't make sense from a11y point of view if the button already contains the same text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the aria-labels in favor of data-test attributes
js/src/components/List.js
Outdated
@@ -78,7 +78,7 @@ const ListElement = ({ items, type }) => ( | |||
<StyledIcon fontSize="small">brightness_1</StyledIcon> | |||
</ListItemIcon> | |||
|
|||
<ListItemText> | |||
<ListItemText data-anu-lms-list-item-text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use data-test="anu-lms-list-item-text"
instead? See https://docs.cypress.io/guides/references/best-practices#Real-World-Example for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted to data-test attributes
// Check for itself. This gives the opportunity for configuration | ||
// to be installed such as pathauto patterns. | ||
if (!in_array('anu_lms_demo_content', $modules)) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
|
||
$assert->waitForElementVisible('css', '[aria-label=Next]')->click(); | ||
// Dividers. | ||
$assert->waitForElementVisible('css', '[aria-label=Next]')->click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we will add more checks inside those lessons later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are good for the scope of this testing.
@rodrigoaguilera I managed to run the tests on M1+DDEV using ddev/ddev#3578 (comment) + ddev/ddev#3578 (comment) All of them passed 🔥🔥🔥 I will document it in #177 |
d82353d
to
69755ec
Compare
@kalabro could you post a full recipe of how you got it working with m1? Trying to follow the comment but no luck. Scratch that got it working! |
No description provided.