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


TypeScript nativescript-dev-appium.UIElement類代碼示例

本文整理匯總了TypeScript中nativescript-dev-appium.UIElement的典型用法代碼示例。如果您正苦於以下問題:TypeScript UIElement類的具體用法?TypeScript UIElement怎麽用?TypeScript UIElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了UIElement類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: async

export const isAbove = async (first: UIElement, second: UIElement) => {

    const { y: firstY } = await first.location();
    const { y: secondY } = await second.location();

    assert.isTrue(firstY < secondY);
}
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:7,代碼來源:location.ts

示例2: isAbove

        it("should toggle on both views in reverse", async () => {
            await secondButton.click();
            await firstButton.click();

            let conditional1 = await driver.findElementByAutomationText("first");
            let conditional2 = await driver.findElementByAutomationText("second");
            await isAbove(firstLabel, conditional1);
            await isAbove(conditional1, conditional2);
            await isAbove(conditional2, secondLabel);
        });
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:10,代碼來源:ngif.e2e-spec.ts

示例3: Error

            (async () => {
                await secondButton.click();
                await firstButton.click();

                driver.findElementByAutomationText("first", 500)
                    .then(_ => { throw new Error("first label found!"); })
                    .catch(() => {
                        driver.findElementByAutomationText("second", 500)
                            .then(_ => { throw new Error("second label found!"); })
                            .catch(() => done());
                    });
            })();
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:12,代碼來源:ngif.e2e-spec.ts

示例4: async

    const removeElement = async (index?: number) => {
        if (index) {
            let { button } = await elements[index];
            await button.click();
        } else {
            index = elements.length - 1;
            if (driver.platformName.toLowerCase().includes("ios")) {
                await removeButton.tap();
            } else {
                await removeButton.click();
            }
        }

        elements.splice(index, 1);
        lastAddedElementId -= 1;
    };
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:16,代碼來源:ngforof.e2e-spec.ts

示例5: it

        it("should find elements", async () => {
            firstButton = await driver.findElementByAutomationText("Button 1");
            secondButton = await driver.findElementByAutomationText("Button 2");
            toggleButton = await driver.findElementByAutomationText("Toggle");

            conditionalLabel = await driver.findElementByAutomationText("Label");
            const labelIsDisplayed = await conditionalLabel.isDisplayed();
            assert.isTrue(labelIsDisplayed);
        });
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:9,代碼來源:ngif.e2e-spec.ts

示例6: catch

            (async () => {
                await toggleButton.click();

                try {
                    await driver.findElementByAutomationText("Label");
                } catch (e) {
                    done();
                }
            })();
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:9,代碼來源:ngif.e2e-spec.ts

示例7: async

    const addElement = async () => {
        await addButton.click();

        lastAddedElementId += 1;
        const newElement = await driver.findElementByAutomationText(
            lastAddedElementId.toString());

        elements.push(newElement);
    };
開發者ID:NathanWalker,項目名稱:nativescript-angular,代碼行數:9,代碼來源:ngfor.e2e-spec.ts


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