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


TypeScript ElementFinder.isDisplayed方法代码示例

本文整理汇总了TypeScript中protractor.ElementFinder.isDisplayed方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ElementFinder.isDisplayed方法的具体用法?TypeScript ElementFinder.isDisplayed怎么用?TypeScript ElementFinder.isDisplayed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.ElementFinder的用法示例。


在下文中一共展示了ElementFinder.isDisplayed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should toggle content on show', () => {
        expect(rxToggleContent.isDisplayed()).to.eventually.be.false;
        rxToggle.click();

        expect(rxToggleContent.isDisplayed()).to.eventually.be.true;
        rxToggle.click();

        expect(rxToggleContent.isDisplayed()).to.eventually.be.false;
    });
开发者ID:Droogans,项目名称:encore-ui,代码行数:9,代码来源:rxToggle.midway.ts

示例2: it

    it('should close again', async () => {
      await element(by.buttonText('Open sidenav')).click();
      await browser.sleep(50);
      await element(by.buttonText('Open sidenav')).click();

      expect(await sidenav.isDisplayed()).toBeFalsy();
    });
开发者ID:Nodarii,项目名称:material2,代码行数:7,代码来源:sidenav.e2e.spec.ts

示例3: it

    it('should close again', () => {
      element(by.buttonText('Open sidenav')).click();
      browser.sleep(50);
      element(by.buttonText('Open sidenav')).click();

      expect(sidenav.isDisplayed()).toBeFalsy();
    });
开发者ID:GuzmanPI,项目名称:material2,代码行数:7,代码来源:sidenav-e2e.spec.ts

示例4: scrollAndClickIfDisplayed

 /**
  * The tables that rxPaginate operates on tend to be squirly, and elements change position
  * frequently, especially when the number of items in the table changes due to page size.  This protected
  * utility function will help ensure elements are clickable before clicking them.
  */
 protected scrollAndClickIfDisplayed(elem: ElementFinder): Promise<void> {
     return elem.isDisplayed().then(displayed => {
         if (displayed) {
             rxMisc.scrollToElement(elem, {positionOnScreen: 'middle'});
             return elem.click();
         }
     });
 }
开发者ID:Droogans,项目名称:encore-ui,代码行数:13,代码来源:rxPaginate.page.ts

示例5: isVisibleInViewport

/** Checks if the given element is visible in the given viewport. */
async function isVisibleInViewport(el: ElementFinder, viewport: ElementFinder): Promise<boolean> {
  if (!await el.isPresent() || !await el.isDisplayed() || !await viewport.isPresent() ||
      !await viewport.isDisplayed()) {
    return false;
  }
  const viewportRect = getRect(await viewport.getLocation(), await viewport.getSize());
  const elRect = getRect(await el.getLocation(), await el.getSize());
  return elRect.left < viewportRect.right && elRect.right > viewportRect.left &&
      elRect.top < viewportRect.bottom && elRect.bottom > viewportRect.top;
}
开发者ID:Nodarii,项目名称:material2,代码行数:11,代码来源:virtual-scroll.e2e.spec.ts


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