1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-30 21:42:42 +02:00
moodle/my/tests/behat/welcome.feature
2021-12-15 13:54:45 +07:00

33 lines
1.4 KiB
Gherkin

@core @core_my
Feature: Welcome message
In order to welcome new or existing user
As a user
I will see welcome message when I log into moodle
Scenario: Log in and being redirected to course page
Given the following "users" exist:
| username | password | firstname | lastname | email |
| wf | test | Fei | Wang | fei@example.com |
And the following "courses" exist:
| fullname | shortname |
| Math 101 | M1O1 |
When I am on "Math 101" course homepage
And I should see "You are not logged in" in the "page-footer" "region"
And I set the field "Username" to "wf"
And I set the field "Password" to "test"
And I press "Log in"
And I should see "Math 101" in the "page-header" "region"
And I should not see "Welcome, Fei!" in the "page-header" "region"
And I follow "Dashboard"
Then I should see "Welcome, Fei!" in the "page-header" "region"
@javascript
Scenario: Log in and being redirected to default home page
When I log in as "admin"
And I should see "You are logged in as Admin User" in the "page-footer" "region"
And I should see "Welcome, Admin!" in the "page-header" "region"
And I log out
And I should see "You are not logged in" in the "page-footer" "region"
And I log in as "admin"
Then I should see "Welcome back, Admin!" in the "page-header" "region"