Fix behat test

This commit is contained in:
Nathan Nguyen
2022-06-08 09:40:32 +10:00
parent 0344500671
commit 32ded95dd6
3 changed files with 12 additions and 6 deletions

View File

@@ -5,5 +5,3 @@ on: [push, pull_request]
jobs:
test:
uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-39-plus-ci.yml@main
with:
disable_behat: true

View File

@@ -22,8 +22,7 @@ Feature: Disable warning bar in embedded layout
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"

View File

@@ -80,8 +80,17 @@ var authOutageWarningBar = {
xmlhttp.open("GET", this.checkfinishedurl, true);
xmlhttp.send();
// Checking if the site is back online every 4-6 minutes.
var sleepSeconds = 4 * MINSECS + (2 * MINSECS * Math.random());
// Date now and client time is in milliseconds while server time is in seconds.
var estimatedServerTime = this.servertime + ((Date.now() - this.clienttime) / 1000);
var sleepSeconds = this.stops - estimatedServerTime; // How long to sleep until it stops.
if (sleepSeconds <= MINSECS) {
// Checking every 5 seconds.
sleepSeconds = 5;
} else {
// Checking if the site is back online every 4-6 minutes.
sleepSeconds = 4 * MINSECS + (2 * MINSECS * Math.random());
}
setTimeout(function() {
$this.tickOngoing();