mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Fix behat test
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user