本文整理汇总了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();
};
示例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()));
}
示例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));
}
示例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]))
}
}
示例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)));
}
示例6: _waitAndClick
private _waitAndClick(locator: webdriver.Locator) {
return driver.wait(until.elementLocated(locator), 5 * 1000)
.then(el => el.click());
}
示例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'));
}
示例8: waitToLocateIWE
public waitToLocateIWE(locator: string): any {
return this._driver.wait(until.elementLocated(By.css(locator)), 2000);
}
示例9: reverseTodos
public static async reverseTodos() {
await browser.wait(until.elementLocated(By.css(cssSelectors.reverseTodosButton)), 1000);
log(`click Reverse todos`);
await this.reverseTodosButton.click();
}
示例10: addTodo
public static async addTodo() {
await browser.wait(until.elementLocated(By.css(cssSelectors.addTodoButton)), 1000);
log(`click Add todo`);
await this.addTodoButton.click();
}
示例11: getCountInputValue
public static async getCountInputValue() {
await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionInput)), 1000);
return parseInt((await this.countInput.getAttribute('value')), 10);
}
示例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);
}
示例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);
}
示例14: getDescriptionInterpolationText
public static async getDescriptionInterpolationText() {
await browser.wait(until.elementLocated(By.css(cssSelectors.descriptionText)), 1000);
return this.descriptionInterpolation.getText();
}
示例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);
});