AutorÃa | Ultima modificación | Ver Log |
@block @block_myoverview @javascriptFeature: The my overview block allows users to favourite their coursesIn order to enable the my overview block in a courseAs a studentI can add the my overview block to my dashboardBackground:Given the following "users" exist:| username | firstname | lastname | email | idnumber || student1 | Student | X | student1@example.com | S1 |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 || Course 2 | C2 | 0 || Course 3 | C3 | 0 || Course 4 | C4 | 0 || Course 5 | C5 | 0 |And the following "course enrolments" exist:| user | course | role || student1 | C1 | student || student1 | C2 | student || student1 | C3 | student || student1 | C4 | student || student1 | C5 | student |Scenario: Favourite a course on a course cardGiven I am on the "My courses" page logged in as "student1"When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"And I reload the pageThen "//div[contains(@class, 'course-card') and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='false']" "xpath_element" should existAnd "//div[contains(@class, 'course-card') and contains(.,'Course 2')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should not existAnd "//div[contains(@class, 'course-card') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should existAnd "//div[contains(@class, 'course-card') and contains(.,'Course 3')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should existScenario: Star a course and switch display to listGiven I am on the "My courses" page logged in as "student1"When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"And I click on "Display drop-down menu" "button" in the "Course overview" "block"And I click on "List" "link" in the "Course overview" "block"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 existAnd "//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 existAnd "//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 existAnd "//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 existScenario: Star a course and switch display to summaryGiven I am on the "My courses" page logged in as "student1"When I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"And I click on "Display drop-down menu" "button" in the "Course overview" "block"And I click on "Summary" "link" in the "Course overview" "block"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 existAnd "//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 existAnd "//div[contains(concat(' ', normalize-space(@class), ' '), 'course-summaryitem') and contains(.,'Course 1')]//span[@data-region='is-favourite' and @aria-hidden='true']" "xpath_element" should existAnd "//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