本文整理汇总了TypeScript中protractor.browser.ExpectedConditions.elementToBeClickable方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.ExpectedConditions.elementToBeClickable方法的具体用法?TypeScript browser.ExpectedConditions.elementToBeClickable怎么用?TypeScript browser.ExpectedConditions.elementToBeClickable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.browser.ExpectedConditions
的用法示例。
在下文中一共展示了browser.ExpectedConditions.elementToBeClickable方法的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: 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
}
示例3: pauseVideo
async pauseVideo (isAutoplay: boolean, isMobileDevice: boolean) {
if (isAutoplay === false) {
const playButton = element(by.css('.vjs-big-play-button'))
await browser.wait(browser.ExpectedConditions.elementToBeClickable(playButton))
await playButton.click()
}
await browser.sleep(1000)
await browser.wait(browser.ExpectedConditions.invisibilityOf(element(by.css('.vjs-loading-spinner'))))
const videojsEl = element(by.css('div.video-js'))
await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl))
// On Android, we need to click twice on "play" (BrowserStack particularity)
if (isMobileDevice) {
await browser.sleep(3000)
await videojsEl.click()
}
await browser.sleep(7000)
return videojsEl.click()
}
示例4: uploadVideo
async uploadVideo () {
browser.setFileDetector(new FileDetector())
const fileToUpload = join(__dirname, '../../fixtures/video.mp4')
const fileInputSelector = '.upload-video-container input[type=file]'
const parentFileInput = '.upload-video .button-file'
// Avoid sending keys on non visible element
await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
// await browser.executeScript(`document.querySelector('${fileInputSelector}').style.opacity = 1`)
await browser.executeScript(`document.querySelector('${parentFileInput}').style.overflow = 'initial'`)
const elem = element(by.css(fileInputSelector))
await elem.sendKeys(fileToUpload)
// Wait for the upload to finish
await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton()))
}