From 53cf1a4149829d6cf045afdad62de1dd21dd7237 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Mon, 18 May 2015 15:03:57 +0800 Subject: [PATCH] MDL-50259 behat: Use strict activity name checking contains might select wrong activity so using strict activity text checking --- course/tests/behat/behat_course.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index ddc1cf60e83..99965339381 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -180,7 +180,7 @@ class behat_course extends behat_base { // Clicks the selected activity if it exists. $activityxpath = "//div[@id='chooseform']/descendant::label" . "/descendant::span[contains(concat(' ', normalize-space(@class), ' '), ' typename ')]" . - "[contains(., $activityliteral)]" . + "[normalize-space(.)=$activityliteral]" . "/parent::label/child::input"; $activitynode = $this->find('xpath', $activityxpath); $activitynode->doubleClick(); @@ -190,7 +190,7 @@ class behat_course extends behat_base { // Selecting the option from the select box which contains the option. $selectxpath = $sectionxpath . "/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' section_add_menus ')]" . - "/descendant::select[contains(., $activityliteral)]"; + "/descendant::select[option[normalize-space(.)=$activityliteral]]"; $selectnode = $this->find('xpath', $selectxpath); $selectnode->selectOption($activity);