MDL-48831 behat: Fixed activity show hide for label

Labels are not links and have dimmed_text class
So updated find query for show/hide activity check
This commit is contained in:
Rajesh Taneja
2015-01-16 10:38:34 +08:00
parent da0ef2e4cf
commit fe4992854f
2 changed files with 6 additions and 2 deletions
+6 -2
View File
@@ -473,7 +473,9 @@ class behat_course extends behat_base {
// The activity should not be dimmed.
try {
$this->find('css', 'a.dimmed', false, $activitynode);
$xpath = "/descendant-or-self::a[contains(concat(' ', normalize-space(@class), ' '), ' dimmed ')] | ".
"/descendant-or-self::div[contains(concat(' ', normalize-space(@class), ' '), ' dimmed_text ')]";
$this->find('xpath', $xpath, false, $activitynode);
throw new ExpectationException('"' . $activityname . '" is hidden', $this->getSession());
} catch (ElementNotFoundException $e) {
// All ok.
@@ -501,7 +503,9 @@ class behat_course extends behat_base {
// Should be hidden.
$exception = new ExpectationException('"' . $activityname . '" is not dimmed', $this->getSession());
$this->find('css', 'a.dimmed', $exception, $activitynode);
$xpath = "/descendant-or-self::a[contains(concat(' ', normalize-space(@class), ' '), ' dimmed ')] | ".
"/descendant-or-self::div[contains(concat(' ', normalize-space(@class), ' '), ' dimmed_text ')]";
$this->find('xpath', $xpath, $exception, $activitynode);
// Also 'Show' icon.
$noshowexception = new ExpectationException('"' . $activityname . '" don\'t have a "' . get_string('show') . '" icon', $this->getSession());