Skip to content

Commit 5f9afeb

Browse files
committed
Merge branch 'MDL-65831-37' of git://github.com/aanabit/moodle into MOODLE_37_STABLE
2 parents 941b5cc + a193f2a commit 5f9afeb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/tests/behat/app_behat_runtime.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,12 @@
240240
var exactLabelMatches = [];
241241
var anyLabelMatches = [];
242242
findPossibleMatches('//*[@aria-label and contains(@aria-label, "' + escapedText + '")]' +
243+
'| //a[@title and contains(@title, "' + escapedText + '")]' +
243244
'| //img[@alt and contains(@alt, "' + escapedText + '")]', function(match) {
244245
// Add to array depending on if it's an exact or partial match.
245-
var attributeData = match.getAttribute('aria-label') || match.getAttribute('alt');
246+
var attributeData = match.getAttribute('aria-label') ||
247+
match.getAttribute('title') ||
248+
match.getAttribute('alt');
246249
if (attributeData.trim() === text) {
247250
exactLabelMatches.push(match);
248251
} else {

lib/tests/behat/behat_app.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,4 +524,15 @@ public function i_close_the_browser_tab_opened_by_the_app() {
524524
$this->getSession()->getDriver()->executeScript('window.close()');
525525
$this->getSession()->switchToWindow($names[0]);
526526
}
527+
528+
/**
529+
* Switch navigator online mode.
530+
*
531+
* @Given /^I switch offline mode to "(?P<offline_string>(?:[^"]|\\")*)"$/
532+
* @param string $offline New value for navigator online mode
533+
* @throws DriverException If the navigator.online mode is not available
534+
*/
535+
public function i_switch_offline_mode(string $offline) {
536+
$this->getSession()->evaluateScript('appProvider.setForceOffline(' . $offline . ');');
537+
}
527538
}

0 commit comments

Comments
 (0)