當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。