MDL-45294 behat: Updating block references to aria label value
Also improving moodle selectors xpath expressions readability.
This commit is contained in:
committed by
Sam Hemelryk
parent
9054cd2a25
commit
e342149a37
@@ -25,19 +25,19 @@ Feature: Course summary block used in a course
|
||||
Scenario: Student can view course summary
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
Then "block_course_summary" "block" should exist
|
||||
And I should see "Proved the course summary block works!" in the "block_course_summary" "block"
|
||||
Then "Course/site summary" "block" should exist
|
||||
And I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
|
||||
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
|
||||
When I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block"
|
||||
And I click on "Edit" "link" in the "block_course_summary" "block"
|
||||
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
And I click on "Edit" "link" in the "Course/site summary" "block"
|
||||
Then I should see "Edit course settings" in the "h2" "css_element"
|
||||
|
||||
Scenario: Teacher can not see edit icon when edit mode is off
|
||||
When I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
Then I should see "Proved the course summary block works!" in the "block_course_summary" "block"
|
||||
And "Edit" "link" should not exist in the "block_course_summary" "block"
|
||||
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
And "Edit" "link" should not exist in the "Course/site summary" "block"
|
||||
|
||||
@@ -15,19 +15,19 @@ Feature: Course summary block used on the frontpage
|
||||
|
||||
Scenario: Guest can view site summary
|
||||
When I am on homepage
|
||||
Then "block_course_summary" "block" should exist
|
||||
And I should see "Proved the summary block works!" in the "block_course_summary" "block"
|
||||
Then "Course/site summary" "block" should exist
|
||||
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
|
||||
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
|
||||
When I log in as "admin"
|
||||
And I am on homepage
|
||||
And I follow "Turn editing on"
|
||||
Then I should see "Proved the summary block works!" in the "block_course_summary" "block"
|
||||
And I click on "Edit" "link" in the "block_course_summary" "block"
|
||||
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
And I click on "Edit" "link" in the "Course/site summary" "block"
|
||||
Then I should see "Front page settings" in the "h2" "css_element"
|
||||
|
||||
Scenario: Admin can not see edit icon when edit mode is off
|
||||
When I log in as "teacher1"
|
||||
And I am on homepage
|
||||
Then I should see "Proved the summary block works!" in the "block_course_summary" "block"
|
||||
And "Edit" "link" should not exist in the "block_course_summary" "block"
|
||||
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
And "Edit" "link" should not exist in the "Course/site summary" "block"
|
||||
|
||||
@@ -96,7 +96,11 @@ XPATH
|
||||
normalize-space(descendant::div[@class='hd']) = %locator%]
|
||||
XPATH
|
||||
, 'block' => <<<XPATH
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' '))] | //div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]/descendant::h2[normalize-space(.) = %locator%]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')] | //div[contains(concat(' ', normalize-space(@class), ' '), ' block ')][@aria-label = %locator% ]
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' '))] |
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]
|
||||
/descendant::h2[normalize-space(.) = %locator%]
|
||||
/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')] |
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), ' block ')][@aria-label = %locator% ]
|
||||
XPATH
|
||||
, 'region' => <<<XPATH
|
||||
//*[self::div | self::section | self::aside | self::header | self::footer][./@id = %locator%]
|
||||
@@ -105,7 +109,8 @@ XPATH
|
||||
.//tr[contains(normalize-space(.), %locator%)]
|
||||
XPATH
|
||||
, 'filemanager' => <<<XPATH
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), ' ffilemanager ')]/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), ' ffilemanager ')]
|
||||
/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
|
||||
XPATH
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user