2020-10-19 05:59:50 -05:00
|
|
|
/* global require Cypress Promise */
|
2020-03-13 07:47:15 -05:00
|
|
|
|
|
|
|
require('cypress-failed-log');
|
2020-09-14 08:53:51 -05:00
|
|
|
|
|
|
|
if (Cypress.env('INTEGRATION') === 'php-proxy') {
|
|
|
|
Cypress.Server.defaults({
|
2020-09-17 07:55:03 -05:00
|
|
|
ignore: function() {
|
2020-09-14 08:53:51 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-10-19 05:59:50 -05:00
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|