This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Added test for courses page and lesson content #175
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b1267dc
Added test for courses page and lesson content
rodrigoaguilera a8a569b
Wait for elements.
rodrigoaguilera 6ba0bbb
Test more lesson types.
f59cbab
Use data-test attributes.
rodrigoaguilera 69755ec
Remove aria-labels and use data-test attr.
395d1ed
Clarify dev-dependencies.
rodrigoaguilera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,12 @@ use Drupal\Core\File\FileSystemInterface; | |
/** | ||
* Implements hook_install(). | ||
*/ | ||
function anu_lms_demo_content_install() { | ||
function anu_lms_demo_content_modules_installed($modules, $is_syncing) { | ||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 |
||
} | ||
$categories = anu_lms_demo_create_course_categories(); | ||
[$first_category, $second_category] = $categories; | ||
[$first_label, $second_label] = anu_lms_demo_create_course_labels(); | ||
|
@@ -452,7 +457,7 @@ function anu_lms_demo_create_course_for_testing_paragraphs($extra_data = []) { | |
'value' => 'This course contains all available lesson item types.', | ||
'format' => 'minimal_html', | ||
], | ||
'field_course_finish_button' => ['uri' => 'internal:/anu-demo'], | ||
'field_course_finish_button' => ['uri' => 'internal:/courses/courses-demo'], | ||
'field_course_module' => array_values($default_module), | ||
] + $extra_data; | ||
|
||
|
@@ -552,7 +557,7 @@ function anu_lms_demo_create_course_for_testing_navigation($extra_data = []) { | |
'value' => 'This course contains multiple modules, lessons and sections.', | ||
'format' => 'minimal_html', | ||
], | ||
'field_course_finish_button' => ['uri' => 'internal:/anu-demo'], | ||
'field_course_finish_button' => ['uri' => 'internal:/courses/courses-demo'], | ||
'field_course_module' => array_values($modules), | ||
] + $extra_data; | ||
|
||
|
@@ -592,7 +597,7 @@ function anu_lms_demo_create_courses_page($category_ids = []) { | |
$courses_page = [ | ||
'type' => 'courses_page', | ||
'title' => 'Courses [DEMO]', | ||
'path' => '/anu-demo', | ||
'path' => '/courses/courses-demo', | ||
'field_courses_content' => array_values($paragraphs), | ||
]; | ||
anu_lms_demo_content_create_entities([$courses_page], 'node'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
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 !