当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript AppiumDriver.findElementsByText方法代码示例

本文整理汇总了TypeScript中nativescript-dev-appium.AppiumDriver.findElementsByText方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AppiumDriver.findElementsByText方法的具体用法?TypeScript AppiumDriver.findElementsByText怎么用?TypeScript AppiumDriver.findElementsByText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nativescript-dev-appium.AppiumDriver的用法示例。


在下文中一共展示了AppiumDriver.findElementsByText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

            it("Verify list view events", async () => {
                const categoryTitle = await driver.findElementByText("Category 1", SearchOptions.exact);
                expect(categoryTitle).to.exist;
                let item = await driver.findElementByText("Special Item 111", SearchOptions.exact);
                let event;
                if (isAndroid) {
                    await item.hold();
                    event = await driver.findElementByText("onItemSelected for: Special Item 111");
                    expect(event).to.exist;
                    await item.hold();
                    event = await driver.findElementByText("onItemDeselected for: Special Item 111");
                    expect(event).to.exist;
                }

                await item.click();
                event = await driver.findElementByText("onItemTap for: Special Item 111");
                expect(event).to.exist;

                item = await driver.findElementByText("Special Item 111", SearchOptions.exact);
                await swipe(driver, item, Direction.right);
                const onSwipeEvent = isAndroid ? "onSwipeCellStarted item: Special Item 111" : "onSwipeCellFinished item: Special Item 111";
                event = await driver.findElementByText(onSwipeEvent, SearchOptions.contains);
                expect(event).to.exist;
                const markButtons = await driver.findElementsByText("mark");
                let alert, okButton;
                // Alert causes UI tree to become empty on Android
                if (!isAndroid) {

                    await markButtons[0].click();
                    alert = await driver.findElementByText("Left swipe click for: Special Item 111", SearchOptions.contains);
                    expect(alert).to.exist;
                    okButton = await driver.findElementByText("OK", SearchOptions.exact);
                    await okButton.click();
                }

                await item.click();
                await swipe(driver, item, Direction.left);
                event = await driver.findElementByText(onSwipeEvent, SearchOptions.contains);
                expect(event).to.exist;

                if (!isAndroid) {
                    const deleteButtons = await driver.findElementsByText("delete");
                    await deleteButtons[0].click();
                    alert = await driver.findElementByText("Right swipe click for: Special Item 111", SearchOptions.contains);
                    expect(alert).to.exist;
                    await okButton.click();
                }
            });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:48,代码来源:tests.e2e.ts

示例2: it

    it("should skip first navigate back", async function () {
        if (driver.isIOS) {
            this.skip();
        }

        await driver.navBack();
        const textElement = await driver.findElementsByText("will cancel next back press: false", SearchOptions.contains, elementDefaultWaitTimeInSeconds);
        assert.isTrue(textElement !== null);
        await driver.navBack();
        await screen.loadedHome();
    })
开发者ID:NathanWalker,项目名称:NativeScript,代码行数:11,代码来源:android-back-button.e2e-spec.ts

示例3: it

        it("should find elements", async () => {
            await driver.findElementByAutomationText("First Tab");

            const notSelectedTabItems = await driver.findElementsByText("not selected");

            firstTabItem = await driver.findElementByAutomationText("SELECTED");
            secondTabItem = notSelectedTabItems[0];
            thirdTabItem = notSelectedTabItems[1];

            const screenMatches = await driver.compareScreen("tab-view-binding-first-tab", 5);
            assert(screenMatches);
        });
开发者ID:NathanWalker,项目名称:nativescript-angular,代码行数:12,代码来源:tab-view.e2e-spec.ts

示例4: it

 it("Delete item", async () => {
     let item = await driver.findElementByText("NativeScript First-Time", SearchOptions.contains);
     await swipe(driver, item, Direction.left);
     if (isAndroid) {
         const deleteButtons = await driver.findElementsByText("delete", SearchOptions.exact);
         await deleteButtons[2].click();
     } else {
         const deleteButton = await driver.findElementByText("delete", SearchOptions.exact);
         await deleteButton.click();
     }
     item = await driver.findElementByTextIfExists("NativeScript First-Time", SearchOptions.contains);
     expect(item).to.be.undefined;
 });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:13,代码来源:tests2.e2e.ts

示例5: it

        it("should open 'Suggest and Append' view", async () => {
            await navigateBackToView(driver, suggestModeText);
            const suggestAndAppendButton = await driver.findElementByText("Suggest & Append");
            await suggestAndAppendButton.click();
            await driver.wait(1000);
            const textField = await driver.findElementByClassName(driver.locators.getElementByName("textfield"));
            await textField.sendKeys("B");
            const bulgariaRecords = await driver.findElementsByText("Bulgaria");
            expect(bulgariaRecords.length).to.equal(2);

            await bulgariaRecords[1].click();
            const bulgaria = await driver.findElementByText("Bulgaria");
            expect(bulgaria).to.exist;
        });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:14,代码来源:tests.e2e.ts


注:本文中的nativescript-dev-appium.AppiumDriver.findElementsByText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。