本文整理汇总了TypeScript中nativescript-dev-appium.AppiumDriver.wait方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AppiumDriver.wait方法的具体用法?TypeScript AppiumDriver.wait怎么用?TypeScript AppiumDriver.wait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nativescript-dev-appium.AppiumDriver
的用法示例。
在下文中一共展示了AppiumDriver.wait方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should open Async Data Fetch view", async () => {
await navigateBackToHome(driver);
const asyncDataFetchButton = await driver.findElementByText(asyncDataFetchText);
await asyncDataFetchButton.click();
await driver.wait(1000);
const asyncDataFetchTitle = await driver.findElementByText(asyncDataFetchText);
expect(asyncDataFetchTitle).to.exist;
const textField = await driver.findElementByClassName(driver.locators.getElementByName("textfield"));
if (isAndroid) {
await textField.sendKeys("a");
// await clickBelowElement(textField, driver);
// let aiomeAirport = await driver.findElementByTextIfExists("Aiome", SearchOptions.exact, 500);
// expect(aiomeAirport).not.to.exist;
await driver.wait(5000);
await clickBelowElement(textField, driver);
const aiomeAirport = await driver.findElementByTextIfExists("Aiome");
expect(aiomeAirport).to.exist;
}
// Error prompt test
// const textField = await driver.findElementByClassName(driver.locators.getElementByName("textfield"));
// await textField.sendKeys("B");
// const progressIndicator = await driver.findElementByText("In progress");
// expect(progressIndicator).to.exist;
// const buttons = await driver.findElementsByClassName(driver.locators.button);
// await buttons[4].click();
// await driver.wait(1000);
// const returnButton = await driver.findElementByTextIfExists("Return");
// if(returnButton !== undefined){
// await driver.driver.hideDeviceKeyboard("Return");
// await driver.wait(1000);
// }
});
示例2: it
it("Pull to refresh", async () => {
await driver.wait(2000);
const item = await driver.findElementByText("NativeScript First-Time", SearchOptions.contains);
await item.scroll(Direction.up, 600);
const itemNew = await driver.findElementByText("Simple Dialog", SearchOptions.contains);
expect(itemNew).to.exist;
});
示例3: it
it("Verify Buttons on the page are responsive", async () => {
const addBtn = await driver.findElementByText("ADD", SearchOptions.exact);
expect(addBtn).to.exist;
const delBtn = await driver.findElementByText("DEL", SearchOptions.exact);
expect(delBtn).to.exist;
const updateBtn = await driver.findElementByText("UPDATE", SearchOptions.exact);
expect(updateBtn).to.exist;
const resetBtn = await driver.findElementByText("RESET", SearchOptions.exact);
expect(resetBtn).to.exist;
await addBtn.click();
const itemNew = isAndroid ? await driver.findElementByText("the new item", SearchOptions.contains)
: await driver.findElementByAccessibilityId("This is the new item's description.", SearchOptions.exact);
expect(itemNew).to.exist;
await delBtn.click();
await driver.wait(1000);
const itemDeleted = await driver.findElementByTextIfExists("the new item", SearchOptions.contains);
expect(itemDeleted).to.be.undefined;
await addBtn.click();
const item1 = isAndroid ? await driver.findElementByText("the new item", SearchOptions.contains)
: await driver.findElementByAccessibilityId("This is the new item's description.");
expect(item1).to.exist;
await updateBtn.click();
const itemUpdated = isAndroid ? await driver.findElementByText("an updated item", SearchOptions.contains)
: await driver.findElementByAccessibilityId("This is an updated item");
expect(itemUpdated).to.exist;
});
示例4: it
it("should open Grid line", async () => {
await navigateToView(driver, annotationsText);
const gridLineButton = await driver.findElementByText("Grid Line");
await gridLineButton.click();
await driver.wait(animationTime);
const isTrue = await driver.compareScreen("grid-line");
expect(isTrue).to.be.true;
});
示例5: it
it("should open Styling series selection", async () => {
await navigateToView(driver, stylingText);
const stylingSeriesSelectionButton = await driver.findElementByText("Styling Series Selection");
await stylingSeriesSelectionButton.click();
await driver.wait(animationTime);
const isTrue = await driver.compareScreen("styling-series-selection");
expect(isTrue).to.be.true;
});