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


TypeScript selenium-webdriver.until类代码示例

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


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

示例1: return

 return () => {
     // self._driver.get(page.URL);
     self._driver.findElement(By.css(page.LOGIN)).sendKeys('wronglogin@test.test');
     self._driver.findElement(By.css(page.PASS)).sendKeys('159236');
     self._driver.findElement(By.css(page.SUBMIT)).click();
     self._driver.wait(until.elementLocated(By.css(page.ERROR)));
     self._driver.quit();
 };
开发者ID:natalialin,项目名称:Pult-autotests,代码行数:8,代码来源:login-negative.ts

示例2: _extractRates

    private _extractRates(isIndicative) {
        var path = `//*[@id="fixslabs"]/table/tbody/tr/td`

        if (isIndicative) {
            path = `//*[@id="slabsMe"]/table/tbody/tr/td`;
        }

        return driver.wait(until.elementsLocated(By.xpath(path)), 5 * 1000)
            .then(els => els.map(el1 => el1.getText()));
    }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:10,代码来源:m2indiaProvider.ts

示例3: _getRatesForIndicative

    private _getRatesForIndicative(skipOptionClick) {
        var promises = [];
        if (!skipOptionClick) {
            promises.push(this._waitAndClick(By.xpath(`//*[@id='nonINRradio']/*[@id='moneyType']`)));
        }
        promises.push(driver.wait(until.elementLocated(By.xpath(`//*[@id="txnAmountDiv1"]/input`)), 5 * 1000)
            .then(el => el.sendKeys('1000')));
        promises.push(this._waitAndClick(By.xpath(`//a[@onclick='calculate();']`)));

        return promise.all(promises)
            .then(_ => this._extractRates(true))
            .then(resultPromise => promise.all(resultPromise));
    }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:13,代码来源:m2indiaProvider.ts

示例4: hideSpinners

    /** Hide spinners */
    async hideSpinners() {
        const spinners = await this.ctx.driver.executeScript<WebElement[]>(() => {
            let spinners = document.getElementsByClassName('loading-spinner')
                for (let elem of spinners) {
                    elem.remove()
                }
            return spinners
        })

        if (spinners.length > 0) {
            await this.ctx.driver.wait(until.stalenessOf(spinners[0]))
        }
    }
开发者ID:ahormazabal,项目名称:rundeck,代码行数:14,代码来源:page.ts

示例5: _getIndicativeRate

    private _getIndicativeRate(pageMap) {
        driver.get(URL);
     

        driver.wait(until.elementLocated(By.css("#paymentAmount")), 5 * 1000)
            .then(el => el.sendKeys("1"));
            
             //  driver.wait(until.elementLocated(By.xpath(`//*[@id="paymentCurrencies"]/option[text()="${pageMap.currencyValue}"]`)), 15 * 1000)
            //.then(el => el.click());

        driver.findElement(By.xpath(`//*[@id='deliveryCountries']/option[text()='India']`))
             .then(el => el.click())

        // driver.findElement(By.css("#deliveryAmount"))
        //     .then(el => el.getText().then(text => console.log(text)));
    }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:16,代码来源:xendpayProvider.ts

示例6: _waitAndClick

 private _waitAndClick(locator: webdriver.Locator) {
     return driver.wait(until.elementLocated(locator), 5 * 1000)
         .then(el => el.click());
 }
开发者ID:vmanikandan001,项目名称:xcngr,代码行数:4,代码来源:m2indiaProvider.ts

示例7: TestUntilModule

function TestUntilModule() {
    let driver: webdriver.WebDriver = new webdriver.Builder().
        withCapabilities(webdriver.Capabilities.chrome()).
        build();

    let conditionB: webdriver.Condition<boolean> = new webdriver.Condition<boolean>('message', (driver: webdriver.WebDriver) => true);
    let conditionBBase: webdriver.Condition<boolean> = conditionB;
    let conditionWebElement: webdriver.WebElementCondition;
    let conditionWebElements: webdriver.Condition<webdriver.WebElement[]>;

    conditionB = webdriver.until.ableToSwitchToFrame(5);
    let conditionAlert: webdriver.Condition<webdriver.Alert> = webdriver.until.alertIsPresent();
    let el: webdriver.WebElement = driver.findElement(webdriver.By.id('id'));
    conditionB = webdriver.until.stalenessOf(el);
    conditionB = webdriver.until.titleContains('text');
    conditionB = webdriver.until.titleIs('text');
    conditionB = webdriver.until.titleMatches(/text/);
    conditionB = webdriver.until.urlContains('text');
    conditionB = webdriver.until.urlIs('text');
    conditionB = webdriver.until.urlMatches(/text/);

    conditionWebElement = webdriver.until.elementIsDisabled(el);
    conditionWebElement = webdriver.until.elementIsEnabled(el);
    conditionWebElement = webdriver.until.elementIsNotSelected(el);
    conditionWebElement = webdriver.until.elementIsNotVisible(el);
    conditionWebElement = webdriver.until.elementIsSelected(el);
    conditionWebElement = webdriver.until.elementIsVisible(el);
    conditionWebElement = webdriver.until.elementLocated(webdriver.By.id('id'));
    conditionWebElement = webdriver.until.elementTextContains(el, 'text');
    conditionWebElement = webdriver.until.elementTextIs(el, 'text');
    conditionWebElement = webdriver.until.elementTextMatches(el, /text/);
    conditionWebElements = webdriver.until.elementsLocated(webdriver.By.className('class'));
}
开发者ID:Rick-Kirkham,项目名称:DefinitelyTyped,代码行数:33,代码来源:index.ts

示例8: waitToLocateIWE

 public waitToLocateIWE(locator: string): any {
   return this._driver.wait(until.elementLocated(By.css(locator)), 2000);
 }
开发者ID:natalialin,项目名称:Pult-autotests,代码行数:3,代码来源:page.ts

示例9: reverseTodos

 public static async reverseTodos() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.reverseTodosButton)), 1000);
   log(`click Reverse todos`);
   await this.reverseTodosButton.click();
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:5,代码来源:app.page.ts

示例10: addTodo

 public static async addTodo() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.addTodoButton)), 1000);
   log(`click Add todo`);
   await this.addTodoButton.click();
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:5,代码来源:app.page.ts

示例11: getCountInputValue

 public static async getCountInputValue() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionInput)), 1000);
   return parseInt((await this.countInput.getAttribute('value')), 10);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:4,代码来源:app.page.ts

示例12: setCountInputValue

 public static async setCountInputValue(value: number) {
   await browser.wait(until.elementLocated(By.css(cssSelectors.countInput)), 1000);
   log(`set count value to ${value}`);
   await this.countInput.clear();
   await this.countInput.sendKeys(value);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:6,代码来源:app.page.ts

示例13: setDescriptionInputValue

 public static async setDescriptionInputValue(value: string) {
   await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionInput)), 1000);
   log(`set description input value to ${value}`);
   await this.descriptionInput.clear();
   await this.descriptionInput.sendKeys(value);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:6,代码来源:app.page.ts

示例14: getDescriptionInterpolationText

 public static async getDescriptionInterpolationText() {
   await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionText)), 1000);
   return this.descriptionInterpolation.getText();
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:4,代码来源:app.page.ts

示例15:

 flow.execute(() => {
     driver.get('http://www.google.com/ncr');
     driver.findElement(By.name('q')).sendKeys('webdriver');
     driver.findElement(By.name('btnG')).click();
     driver.wait(until.titleIs('webdriver - Google Search'), 1000);
 });
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:6,代码来源:testing.ts


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