當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。