Merge pull request #3572 from NoelDeMartin/MOBILE-4270

MOBILE-4270: Update behat tests
main
Dani Palou 2023-03-21 09:50:23 +01:00 committed by GitHub
commit ed890165a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 47 additions and 18 deletions

View File

@ -56,21 +56,13 @@ jobs:
run: |
export MOODLE_DOCKER_WWWROOT=$GITHUB_WORKSPACE/moodle
cp $GITHUB_WORKSPACE/moodle-docker/config.docker-template.php $GITHUB_WORKSPACE/moodle/config.php
sed -i "61c\$CFG->behat_faildump_path = '/var/www/html/behatfaildumps';" $GITHUB_WORKSPACE/moodle/config.php
sed -i "61i\$CFG->behat_increasetimeout = 2;" $GITHUB_WORKSPACE/moodle/config.php
sed -i "61i\$CFG->behat_ionic_wwwroot = 'http://moodleapp';" $GITHUB_WORKSPACE/moodle/config.php
sed -i "61i\$CFG->behat_snapshots_path = '/var/www/html/local/moodleappbehat/tests/behat/snapshots';" $GITHUB_WORKSPACE/moodle/config.php
sed -i "69c\$CFG->behat_faildump_path = '/var/www/html/behatfaildumps';" $GITHUB_WORKSPACE/moodle/config.php
sed -i "69i\$CFG->behat_increasetimeout = 2;" $GITHUB_WORKSPACE/moodle/config.php
sed -i "69i\$CFG->behat_ionic_wwwroot = 'http://moodleapp';" $GITHUB_WORKSPACE/moodle/config.php
echo "define('TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER', 'http://bbbmockserver/hash' . sha1(\$CFG->behat_wwwroot));" >> $GITHUB_WORKSPACE/moodle/config.php
$GITHUB_WORKSPACE/moodle-docker/bin/moodle-docker-compose pull
$GITHUB_WORKSPACE/moodle-docker/bin/moodle-docker-compose up -d
$GITHUB_WORKSPACE/moodle-docker/bin/moodle-docker-wait-for-db
- name: Install Imagick PHP extension
run: |
export MOODLE_DOCKER_WWWROOT=$GITHUB_WORKSPACE/moodle
./moodle-docker/bin/moodle-docker-compose exec webserver apt-get update
./moodle-docker/bin/moodle-docker-compose exec webserver apt-get install -y libmagickwand-dev --no-install-recommends
./moodle-docker/bin/moodle-docker-compose exec webserver pecl install imagick
./moodle-docker/bin/moodle-docker-compose exec webserver docker-php-ext-enable imagick
- name: Compile & launch app with Docker
run: |
docker build --build-arg build_command="npm run build:test" -t moodlehq/moodleapp:behat .

View File

@ -1,6 +1,6 @@
name: Performance
on: [ pull_request, workflow_dispatch ]
on: [ workflow_dispatch ]
jobs:
performance:

View File

@ -38,12 +38,20 @@ Feature: Test basic usage of messages in app
Given I entered the app as "student1"
When I press "Messages" in the app
And I press "Contacts" in the app
And I replace "/.*/" within ".addon-message-last-message-date" with "[Date]"
Then I should find "Contacts" in the app
And the UI should match the snapshot
When I press "Contacts" in the app
And I press "Requests" in the app
And I press "Teacher teacher" in the app
And I press "Accept and add to contacts" in the app
Then I should not find "Teacher teacher would like to contact you" in the app
When I replace "/.*/" within ".addon-messages-date" with "[Day]"
And I replace "/.*/" within ".message-time" with "[Date]"
Then the UI should match the snapshot
When I press the back button in the app
And I press "Contacts" near "No contact requests" in the app
Then the header should be "Contacts" in the app

View File

@ -61,6 +61,11 @@ Feature: Test basic usage of assignment activity in app
Scenario: Edit/Add submission (online text) & Add new attempt from previous submission & Submit for grading
# Submit first attempt as a student
Given I entered the assign activity "assignment1" on course "Course 1" as "student1" in the app
Then I should find "assignment1" in the app
When I replace "/Assignment is overdue by: .*/" within "addon-mod-assign-submission core-tabs ion-item:nth-child(2)" with "Assignment is overdue by: [Overdue date]"
Then the UI should match the snapshot
When I press "Add submission" in the app
Then I set the field "Online text submissions" to "Submission test 1st attempt" in the app
And I press "Save" in the app

View File

@ -83,6 +83,7 @@ Feature: Test basic usage of book activity in app
When I press "Chapt 1" in the app
Then I should find "Chapt 1" in the app
And I should find "This is the first chapter" in the app
And the UI should match the snapshot
But I should not find "This is the second chapter" in the app
When I press the back button in the app

View File

@ -52,9 +52,17 @@ Feature: Test basic usage of forum activity in app
Scenario: Reply a post
Given I entered the forum activity "Test forum name" on course "Course 1" as "student1" in the app
When I replace "/.*/" within ".addon-mod-forum-discussion-author p" with "[Publication date]"
And I replace "/\d+ seconds ago/" within ".addon-mod-forum-discussion-more-info ion-note" with "[seconds] seconds ago"
Then the UI should match the snapshot
When I press "Initial discussion" in the app
And I press "Reply" in the app
And I set the field "Message" to "ReplyMessage" in the app
And I scroll to "Post to forum" in the app
And I replace "/.*/" within ".addon-mod-forum-post-author p:last-child" with "[Publication date]"
Then the UI should match the snapshot
When I set the field "Message" to "ReplyMessage" in the app
And I press "Post to forum" in the app
Then I should find "Initial discussion message" in the app
And I should find "ReplyMessage" in the app

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -143,7 +143,10 @@ Feature: Attempt a quiz in app
Scenario: Submit a quiz & Review a quiz attempt
Given I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app
When I press "Attempt quiz now" in the app
And I press "True" in the app
Then I should find "Text of the first question" in the app
And the UI should match the snapshot
When I press "True" in the app
And I press "Next" in the app
And I press "False" in the app
And I press "Submit" in the app
@ -151,6 +154,10 @@ Feature: Attempt a quiz in app
And I press "OK" in the app
Then I should find "Review" in the app
When I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(1) p:nth-child(2)" with "[Started on date]"
And I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(3) p:nth-child(2)" with "[Completed on date]"
Then the UI should match the snapshot
Given I entered the quiz activity "Quiz 1" on course "Course 1" as "teacher1" in the app
When I press "Information" in the app
And I press "Open in browser" in the app

View File

@ -91,7 +91,7 @@ Feature: Test basic usage of one course in app
When I set "page-core-course-index .core-course-thumb" styles to "--course-color" "lightblue"
And I set "page-core-course-index .core-course-thumb" styles to "--course-color-tint" "white"
# Then the UI should match the snapshot
Then the UI should match the snapshot
When I press "Choice course 1" in the app
Then the header should be "Choice course 1" in the app

View File

@ -31,14 +31,14 @@ Feature: Test basic usage of login in app
And I press "Connect to your site" in the app
Then I should find "Acceptance test site" in the app
And I replace "/.*/" within ".core-siteurl" with "https://campus.example.edu"
# And the UI should match the snapshot
And the UI should match the snapshot
When I set the following fields to these values in the app:
| Username | student1 |
| Password | student1 |
And I press "Log in" near "Forgotten your username or password?" in the app
Then I should find "Acceptance test site" in the app
# And the UI should match the snapshot
And the UI should match the snapshot
But I should not find "Log in" in the app
Scenario: Add a non existing account

View File

@ -51,3 +51,11 @@ Feature: Test basic usage of user features
When I press "Reconnect" in the app
Then I should find "Acceptance test site" in the app
Scenario: View profile
Given I entered the app as "student1"
When I press the user menu button in the app
And I press "Student" in the app
Then I should find "student1@example.com" in the app
And I should find "Student Student" in the app
And the UI should match the snapshot

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB