Some E2E timeouts removed
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-03-24 11:12:59 +01:00
parent acf8c117b0
commit 68a4ed0f10
2 changed files with 21 additions and 13 deletions

View File

@ -58,9 +58,9 @@ let actions = {
return document.location.hash.includes(expectedHash);
}, {}, expectedHash);
} catch (error) {
throw new Error(`failed to reach URL containing: ${expectedHash}`);
throw new Error(`Failed to reach URL containing: ${expectedHash}`);
}
await this.waitForContentLoaded();
await this.waitForSpinnerLoad();
return true;
},
@ -123,8 +123,9 @@ let actions = {
waitForState: async function(state) {
await this.waitFor(state => {
let $state = angular.element(document.body).injector().get('$state');
return $state.is(state);
return !$state.transition && $state.is(state);
}, {}, state);
await this.waitForSpinnerLoad(state);
},
waitForTransition: async function() {
@ -152,7 +153,6 @@ let actions = {
}, state);
await this.waitForState(state);
await this.waitForContentLoaded();
},
reloadSection: async function(state) {
@ -172,7 +172,7 @@ let actions = {
await this.write('vn-searchbar', searchValue);
await this.waitToClick('vn-searchbar vn-icon[icon="search"]');
await this.waitForTransition();
await this.waitForContentLoaded();
await this.waitFor('.vn-descriptor');
},
getProperty: async function(selector, property) {
@ -334,7 +334,10 @@ let actions = {
},
hideSnackbar: async function() {
await this.waitFor(300); // holds up for the snackbar to be visible for a small period of time.
// Holds up for the snackbar to be visible for a small period of time.
if (process.env.DEBUG)
await this.waitFor(300);
await this.evaluate(() => {
let hideButton = document.querySelector('#shapes .shown button');
if (hideButton)
@ -549,7 +552,7 @@ let actions = {
},
waitForContentLoaded: async function() {
await this.waitFor(250);
// await this.waitFor(250);
}
};

View File

@ -4,17 +4,22 @@ import {extendPage} from './extensions';
import {url as defaultURL} from './config';
export async function getBrowser() {
let headless = !process.env.E2E_SHOW;
const args = [
`--no-sandbox`,
`--window-size=${ 1920 },${ 1080 }`
];
if (process.env.DEBUG)
args.push('--auto-open-devtools-for-tabs');
const headless = !process.env.E2E_SHOW;
const browser = await Puppeteer.launch({
args: [
'--no-sandbox',
`--window-size=${ 1920 },${ 1080 }`,
// '--auto-open-devtools-for-tabs'
],
args,
defaultViewport: null,
headless: headless,
slowMo: 0, // slow down by ms
});
let page = (await browser.pages())[0];
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, 'language', {