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


TypeScript AppiumDriver.compareElement方法代码示例

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


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

示例1: it

 it("Tap disable btn and verify swipe is disabled", async () => {
     const disableBtn = await driver.findElementByText("DISABLE", SearchOptions.exact);
     await disableBtn.click();
     let item = await driver.findElementByText("Joel Robertson", SearchOptions.exact);
     expect(item).to.exist;
     if (isAndroid) {
         const rectangle = await item.getRectangle();
         const centerX = rectangle.x + rectangle.width / 2;
         const centerY = rectangle.y + rectangle.height / 2;
         const wd = driver.wd();
         const action = new wd.TouchAction(driver.driver);
         action.press({ x: centerX, y: centerY })
             .wait(100)
             .moveTo({ x: 10, y: centerY })
             .release();
         await action.perform();
         const selection = await driver.compareElement(item, "item");
         expect(selection).to.equal(true);
     }
     else {
         await driver.driver.execute('mobile: dragFromToForDuration', {
             duration: 2.0,
             fromX: 150,
             fromY: 150,
             toX: 50,
             toY: 150
         });
         const del = await driver.findElementByTextIfExists("delete", SearchOptions.exact);
         expect(del).to.be.undefined;
     }
 });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:31,代码来源:tests3.e2e.ts

示例2: it

 it("Select item and verify it is marked as selected", async () => {
     const item0 = await driver.findElementByText("Item 0", SearchOptions.exact);
     await item0.click();
     const locator = isAndroid ? "android.view.ViewGroup" : "XCUIElementTypeCell";
     const items = await driver.findElementsByClassName(locator);
     const selected = isAndroid ? items[4] : items[0];
     expect(selected).to.exist;
     const selection = await driver.compareElement(selected, "selectedState");
     expect(selection).to.equal(true);
 });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:10,代码来源:tests2.e2e.ts

示例3: it

        it("should open Customization view", async () => {
            await navigateBackToHome(driver);
            const customizationButton = await driver.findElementByText(customizationText);
            await customizationButton.click();
            const customizationTitle = await driver.findElementByText(customizationText);
            expect(customizationTitle).to.exist;
            await driver.wait(1000);
            const textField = await driver.findElementByClassName(driver.locators.getElementByName("textfield"));
            await textField.sendKeys("Bul");
            const suggestionImage = isAndroid ?
                await driver.findElementByClassName("com.telerik.widget.autocomplete.SuggestionItemViewHolder") :
                await driver.findElementByAccessibilityId("bulgaria");
            const compareSuggestion = await driver.compareElement(suggestionImage, "customization-suggestion");
            expect(compareSuggestion).to.be.true;

            const suggestionText = await driver.findElementByText("Bulgaria");
            await suggestionText.click();
            const autoCompleteClassName = isAndroid ? "com.telerik.widget.autocomplete.RadAutoCompleteTextView" : driver.locators.getElementByName("scrollview");
            const autoComplete = await driver.findElementByClassName(autoCompleteClassName);
            const compareToken = await driver.compareElement(autoComplete, "customization-tokens");
            expect(compareToken).to.be.true;
        });
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:22,代码来源:tests.e2e.ts

示例4: it

 it(`should find an element with ${styleType} style applied`, async function () {
     const element = await driver.findElementByText(styleTypes[styleType]);
     const result = await driver.compareElement(element, "style");
     assert.isTrue(result);
 });
开发者ID:NativeScript,项目名称:nativescript-dev-webpack,代码行数:5,代码来源:tests.e2e-spec.ts

示例5: it

 it("should mark element as Done", async () => {
     await clickOnCrossOrCheckboxBtn();
     const appleItem = await driver.findElementByText(fruit);
     const isItemDone = await driver.compareElement(appleItem, "itemDone", 0.07);
     expect(isItemDone).to.be.true;
 });
开发者ID:tjvantoll,项目名称:sample-Groceries,代码行数:6,代码来源:groceries.e2e.ts


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