libreoffice-online/cypress_test/support/index.js
Tamás Zolnai 8367d996b7 cypress: slow down test execution in interactive test runner.
Otherwise things happens very fast, so hard to follow what
happens.
Also the new changes of tile rendering broke the screenshot
feature of cypress, so the screenshots taken during the test
became useless. So an alternative is to run test slower,
so we can see what happens on the UI.

Change-Id: I09b48ca606cf45768cba04f5639a5d4b5317545d
2020-10-19 13:53:53 +02:00

31 lines
727 B
JavaScript

/* global require Cypress Promise */
require('cypress-failed-log');
if (Cypress.env('INTEGRATION') === 'php-proxy') {
Cypress.Server.defaults({
ignore: function() {
return true;
}
});
}
var COMMAND_DELAY = 1000;
if (Cypress.browser.isHeaded) {
Cypress.Commands.overwrite('get', function(originalFn, selector, options) {
return new Promise(function(resolve) {
setTimeout(function() {
resolve(originalFn(selector, options));
}, COMMAND_DELAY);
});
});
Cypress.Commands.overwrite('contains', function(originalFn, selector, content, options) {
return new Promise(function(resolve) {
setTimeout(function() {
resolve(originalFn(selector, content, options));
}, COMMAND_DELAY);
});
});
}