mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
chore(packages): move the packages to root
This commit is contained in:
27
core/scripts/e2e/utils.js
Normal file
27
core/scripts/e2e/utils.js
Normal file
@ -0,0 +1,27 @@
|
||||
const { By, until } = require('selenium-webdriver');
|
||||
|
||||
async function getElement(driver, selector) {
|
||||
driver.wait(until.elementLocated(By.css(selector)));
|
||||
const element = driver.findElement(By.css(selector));
|
||||
await driver.wait(until.elementIsVisible(driver.findElement(By.css(selector))));
|
||||
return element;
|
||||
}
|
||||
|
||||
async function waitAndGetElementById(driver, selector) {
|
||||
driver.wait(until.elementLocated(By.id(selector)));
|
||||
const element = driver.findElement(By.id(selector));
|
||||
await driver.wait(until.elementIsVisible(driver.findElement(By.id(selector))));
|
||||
return element;
|
||||
}
|
||||
|
||||
function waitForTransition(duration) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, duration);
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getElement: getElement,
|
||||
waitForTransition: waitForTransition,
|
||||
waitAndGetElementById: waitAndGetElementById
|
||||
}
|
Reference in New Issue
Block a user