本文整理汇总了TypeScript中protractor.browser.ExpectedConditions.urlContains方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.ExpectedConditions.urlContains方法的具体用法?TypeScript browser.ExpectedConditions.urlContains怎么用?TypeScript browser.ExpectedConditions.urlContains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.browser.ExpectedConditions
的用法示例。
在下文中一共展示了browser.ExpectedConditions.urlContains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: clickOnVideo
async clickOnVideo (videoName: string) {
const video = element(by.css('.videos .video-miniature .video-thumbnail[title="' + videoName + '"]'))
await browser.wait(browser.ExpectedConditions.elementToBeClickable(video))
await video.click()
await browser.wait(browser.ExpectedConditions.urlContains('/watch/'))
}
示例2: validSecondUploadStep
async validSecondUploadStep (videoName: string) {
const nameInput = element(by.css('input#name'))
await nameInput.clear()
await nameInput.sendKeys(videoName)
await this.getSecondStepSubmitButton().click()
return browser.wait(browser.ExpectedConditions.urlContains('/watch/'))
}
示例3: loginAsRootUser
async loginAsRootUser () {
await browser.get('/login')
element(by.css('input#username')).sendKeys('root')
element(by.css('input#password')).sendKeys('test1')
await browser.sleep(1000)
await element(by.css('form input[type=submit]')).click()
return browser.wait(browser.ExpectedConditions.urlContains('/videos/'))
}
示例4: clickOnFirstVideo
async clickOnFirstVideo () {
const video = element.all(by.css('.videos .video-miniature .video-thumbnail')).first()
const videoName = element.all(by.css('.videos .video-miniature .video-miniature-name')).first()
// Don't know why but the expectation fails on Safari
await browser.wait(browser.ExpectedConditions.elementToBeClickable(video))
const textToReturn = videoName.getText()
await video.click()
await browser.wait(browser.ExpectedConditions.urlContains('/watch/'))
return textToReturn
}