本文整理汇总了TypeScript中nativescript-dev-appium/lib/parser.runType.includes方法的典型用法代码示例。如果您正苦于以下问题:TypeScript runType.includes方法的具体用法?TypeScript runType.includes怎么用?TypeScript runType.includes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nativescript-dev-appium/lib/parser.runType
的用法示例。
在下文中一共展示了runType.includes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("Verify data-form date is visible and responsive", async () => {
let date;
let month;
let day;
if (isAndroid) {
date = await driver.findElementByText("Wed, 06.04", SearchOptions.exact);
await date.click();
if (runType.includes("android27") || runType.includes("android23")) {
month = await driver.findElementByText("Apr", SearchOptions.exact);
day = await driver.findElementByText("06", SearchOptions.exact);
}
if (runType.includes("android24")) {
month = await driver.findElementByText("Wed, Apr 6", SearchOptions.contains);
day = await driver.findElementByText("6", SearchOptions.exact);
}
}
else {
date = await driver.findElementByAccessibilityId("Apr 6, 2016", SearchOptions.exact);
await date.click();
month = await driver.findElementByText("April", SearchOptions.exact);
day = await driver.findElementByText("6", SearchOptions.exact);
}
expect(date).to.exist;
expect(day).to.exist;
expect(month).to.exist;
if (isAndroid) {
if (runType.includes("android23")) {
return;
} else {
const seven = await driver.findElementByText("7", SearchOptions.exact);
await seven.click();
}
const ok = await driver.findElementByText("OK", SearchOptions.exact);
await ok.click();
date = await driver.findElementByText("Thu, 07.04", SearchOptions.exact);
expect(date).to.exist;
} else {
await clickBelowElementCenter(day, driver);
date = await driver.findElementByAccessibilityId("Apr 7, 2016", SearchOptions.exact);
await date.click();
}
});
示例2: navigateBackToHome
import { AppiumDriver, SearchOptions, Direction, UIElement } from "nativescript-dev-appium";
import { runType } from "nativescript-dev-appium/lib/parser";
const isAndroid: boolean = runType.includes("android");
export const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout.
export async function navigateBackToHome(driver: AppiumDriver, view?: string) {
let location = view !== undefined ? view : "ListView Angular";
let homeTitle = await driver.findElementByTextIfExists(location, SearchOptions.exact);
while (homeTitle === undefined) {
await driver.navBack();
await driver.wait(1000);
homeTitle = await driver.findElementByTextIfExists(location, SearchOptions.exact);
}
}
export async function navigateBackToView(driver: AppiumDriver, view: string) {
await navigateBackToHome(driver, view);
}
export async function scrollToElement(driver: AppiumDriver, element: string, direction: Direction = Direction.down) {
let listView;
if (isAndroid) {
listView = await driver.findElementByClassName("android.widget.FrameLayout");
}
else {
listView = await driver.findElementByClassName("XCUIElementTypeCollectionView");
}
const listItem = await listView.scrollTo(
direction,
() => driver.findElementByText(element, SearchOptions.contains),
示例3: function
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
import { isSauceLab, runType, capabilitiesName } from "nativescript-dev-appium/lib/parser";
import { expect } from "chai";
import { ImageOptions } from "nativescript-dev-appium/lib/image-options";
const isSauceRun = isSauceLab;
const isAndroid: string = runType.includes("android");
describe("Groceries", async function () {
let driver: AppiumDriver;
const loginButtonText = "Login";
const email = "groceries@mailinator.com";
const password = "123";
const fruit = "apple";
const recentButtonText = "Recent";
const doneButtonText = "Done";
const logOffButtonText = "Log Off";
const invalidEmail = "groceries@mailinator";
const invalidEmailWarningText = "valid email";
const okButtonText = "OK";
const cancelButtonText = "Cancel";
const signUpHereButtonText = "Sign up here";
const signUpButtonText = "Sign up";
const backToLoginButtonText = "Back to login";
const forgotPasswordButtonText = "Forgot";
const forgotPasswordFormText = "reset";
const clickOnCrossOrCheckboxBtn = async () => {
if (isAndroid) {
// First image is the menu, second is the cross button. The rest are pairs checkbox/bin per list item.
const allImages = await driver.findElementsByClassName(driver.locators.image);