From e342149a37223eff944e84ad4b08166352b58580 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 13 May 2014 18:56:36 +0700 Subject: [PATCH] MDL-45294 behat: Updating block references to aria label value Also improving moodle selectors xpath expressions readability. --- .../tests/behat/block_course_summary_course.feature | 12 ++++++------ .../behat/block_course_summary_frontpage.feature | 12 ++++++------ lib/behat/classes/behat_selectors.php | 9 +++++++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/blocks/course_summary/tests/behat/block_course_summary_course.feature b/blocks/course_summary/tests/behat/block_course_summary_course.feature index b8758f34f9b..bfe1e1b0688 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_course.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_course.feature @@ -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" diff --git a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature index 05e54e897a7..7c6373deaa0 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature @@ -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" diff --git a/lib/behat/classes/behat_selectors.php b/lib/behat/classes/behat_selectors.php index fb7f75877db..0f98a78588c 100644 --- a/lib/behat/classes/behat_selectors.php +++ b/lib/behat/classes/behat_selectors.php @@ -96,7 +96,11 @@ XPATH normalize-space(descendant::div[@class='hd']) = %locator%] XPATH , 'block' => << << <<