refactor(e2e): moved animation and transition cancelation to post-login
This commit is contained in:
parent
600de05d29
commit
7460986a8d
|
@ -94,6 +94,19 @@ let actions = {
|
|||
login: async function(userName) {
|
||||
await this.doLogin(userName);
|
||||
await this.waitForState('home');
|
||||
await this.addStyleTag({
|
||||
content: `
|
||||
*,
|
||||
*::after,
|
||||
*::before {
|
||||
transition-delay: 0s !important;
|
||||
transition-duration: 0s !important;
|
||||
animation-delay: -0.0001s !important;
|
||||
animation-duration: 0s !important;
|
||||
animation-play-state: paused !important;
|
||||
caret-color: transparent !important;
|
||||
}`
|
||||
});
|
||||
},
|
||||
|
||||
selectModule: async function(moduleName) {
|
||||
|
@ -208,7 +221,8 @@ let actions = {
|
|||
waitPropertyLength: async function(selector, property, minLength) {
|
||||
await this.waitForFunction((selector, property, minLength) => {
|
||||
const element = document.querySelector(selector);
|
||||
return element && element[property] != null && element[property] !== '' && element[property].length >= minLength;
|
||||
const isValidElement = element && element[property] != null && element[property] !== '';
|
||||
return isValidElement && element[property].length >= minLength;
|
||||
}, {}, selector, property, minLength);
|
||||
return this.getProperty(selector, property);
|
||||
},
|
||||
|
|
|
@ -47,12 +47,6 @@ export async function getBrowser() {
|
|||
});
|
||||
page = extendPage(page);
|
||||
page.setDefaultTimeout(5000);
|
||||
await page.addStyleTag({
|
||||
content: `* {
|
||||
transition: none!important;
|
||||
animation: none!important;
|
||||
}`
|
||||
});
|
||||
|
||||
await page.goto(defaultURL, {waitUntil: 'load'});
|
||||
return {page, close: browser.close.bind(browser)};
|
||||
|
|
Loading…
Reference in New Issue