1 |
efrain |
1 |
@block @block_myoverview @javascript
|
|
|
2 |
Feature: The my overview block allows users to favourite their courses
|
|
|
3 |
In order to enable the my overview block in a course
|
|
|
4 |
As a student
|
|
|
5 |
I can add the my overview block to my dashboard
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| student1 | Student | X | student1@example.com | S1 |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
| Course 2 | C2 | 0 |
|
|
|
15 |
| Course 3 | C3 | 0 |
|
|
|
16 |
| Course 4 | C4 | 0 |
|
|
|
17 |
| Course 5 | C5 | 0 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| student1 | C1 | student |
|
|
|
21 |
| student1 | C2 | student |
|
|
|
22 |
| student1 | C3 | student |
|
|
|
23 |
| student1 | C4 | student |
|
|
|
24 |
| student1 | C5 | student |
|
|
|
25 |
|
|
|
26 |
Scenario: Favourite a course on a course card
|
|
|
27 |
Given I am on the "My courses" page logged in as "student1"
|
|
|
28 |
When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
|
|
|
29 |
And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
|
|
|
30 |
And I reload the page
|
|
|
31 |
Then "//div[contains(@class, 'course-card') and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
|
|
|
32 |
And "//div[contains(@class, 'course-card') and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
|
|
|
33 |
And "//div[contains(@class, 'course-card') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|
|
|
34 |
And "//div[contains(@class, 'course-card') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|
|
|
35 |
|
|
|
36 |
Scenario: Star a course and switch display to list
|
|
|
37 |
Given I am on the "My courses" page logged in as "student1"
|
|
|
38 |
When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
|
|
|
39 |
And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
|
|
|
40 |
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
|
|
|
41 |
And I click on "List" "link" in the "Course overview" "block"
|
|
|
42 |
Then "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
|
|
|
43 |
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
|
|
|
44 |
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|
|
|
45 |
And "//li[contains(concat(' ', normalize-space(@class), ' '), 'list-group-item') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|
|
|
46 |
|
|
|
47 |
Scenario: Star a course and switch display to summary
|
|
|
48 |
Given I am on the "My courses" page logged in as "student1"
|
|
|
49 |
When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
|
|
|
50 |
And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
|
|
|
51 |
And I click on "Display drop-down menu" "button" in the "Course overview" "block"
|
|
|
52 |
And I click on "Summary" "link" in the "Course overview" "block"
|
|
|
53 |
Then "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should exist
|
|
|
54 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 5')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not exist
|
|
|
55 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|
|
|
56 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should exist
|