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


TypeScript browser.ExpectedConditions.elementToBeClickable方法代码示例

本文整理汇总了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/'))
  }
开发者ID:jiang263,项目名称:PeerTube,代码行数:7,代码来源:video-watch.po.ts

示例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
  }
开发者ID:jiang263,项目名称:PeerTube,代码行数:13,代码来源:video-watch.po.ts

示例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()
  }
开发者ID:jiang263,项目名称:PeerTube,代码行数:23,代码来源:video-watch.po.ts

示例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()))
  }
开发者ID:jiang263,项目名称:PeerTube,代码行数:18,代码来源:video-upload.po.ts


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