• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript parser.runType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中nativescript-dev-appium/lib/parser.runType的典型用法代码示例。如果您正苦于以下问题:TypeScript runType类的具体用法?TypeScript runType怎么用?TypeScript runType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了runType类的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 = "[email protected]";
    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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap