本文整理匯總了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;
});