當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript runType.includes方法代碼示例

本文整理匯總了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();
            }
        });
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:43,代碼來源:test.e2e.ts

示例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),
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:31,代碼來源:helper.ts

示例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);
開發者ID:tjvantoll,項目名稱:sample-Groceries,代碼行數:31,代碼來源:groceries.e2e.ts


注:本文中的nativescript-dev-appium/lib/parser.runType.includes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。