當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ExpectedConditions.presenceOf方法代碼示例

本文整理匯總了TypeScript中protractor.ExpectedConditions.presenceOf方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExpectedConditions.presenceOf方法的具體用法?TypeScript ExpectedConditions.presenceOf怎麽用?TypeScript ExpectedConditions.presenceOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在protractor.ExpectedConditions的用法示例。


在下文中一共展示了ExpectedConditions.presenceOf方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

        it('should display different size when set presize', async () => {
            let size;
            const testButton = element(by.id('test-button'));
            const presizeList = element(by.id('presize-list')).all(by.tagName('jigsaw-button'));

            presizeList.get(0).click();
            await browser.wait(ExpectedConditions.not(
                ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));

            size = await testButton.getSize();
            expect(size.width).toBe(80);
            expect(size.height).toBe(20);

            presizeList.get(1).click();
            await browser.wait(ExpectedConditions.not(
                ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));
            size = await testButton.getSize();
            expect(size.width).toBe(80);
            expect(size.height).toBe(28);

            presizeList.get(2).click();
            await browser.wait(ExpectedConditions.not(
                ExpectedConditions.presenceOf(element(by.css('.jigsaw-button-clicked')))));
            size = await testButton.getSize();
            expect(size.width).toBe(80);
            expect(size.height).toBe(36);
        });
開發者ID:jiw0220,項目名稱:jigsaw,代碼行數:27,代碼來源:button.e2e-spec.ts

示例2: it

    it('should change steps correctly when stepper button is clicked', async () => {
      const previousButton = element.all(by.buttonText('Back'));
      const nextButton = element.all(by.buttonText('Next'));

      expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
          .toBe('1\nFill out your name');

      screenshot('start');
      nextButton.get(0).click();

      expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
          .toBe('2\nFill out your address');

      await browser.wait(ExpectedConditions.not(
          ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
      screenshot('click next');

      previousButton.get(0).click();

      expect(await element(by.css('mat-step-header[aria-selected="true"]')).getText())
          .toBe('1\nFill out your name');

      await browser.wait(ExpectedConditions.not(
          ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
      screenshot('click back');
    });
開發者ID:clydin,項目名稱:material2,代碼行數:26,代碼來源:stepper-e2e.spec.ts

示例3: reportGame

 reportGame(result: Array<Array<string>>) {
   element(by.css('.app-action button')).click();
   browser.wait(ExpectedConditions.presenceOf(element(by.partialButtonText('Report'))), 5 * oneSecond);
   for (let i = 0; i < result.length; i++) {
     for (let j = 0; j < result[i].length; j++) {
       element(by.css(`input[name="name${i}.${j}"]`)).sendKeys(result[i][j]);
       browser.sleep(shortSleep);
     }
   }
   element(by.partialButtonText('Report')).click();
   browser.wait(ExpectedConditions.not(ExpectedConditions.presenceOf(
     element(by.tagName('app-game')))), 5 * oneSecond);
 }
開發者ID:lrem,項目名稱:ladders,代碼行數:13,代碼來源:app.po.ts

示例4: it

    it('should prevent click handlers from executing when disabled', async () => {
      await element(by.id('test-button')).click();
      expect(await element(by.id('click-counter')).getText()).toEqual('1');

      await browser.wait(ExpectedConditions.not(
        ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));

      await element(by.id('disable-toggle')).click();
      await element(by.id('test-button')).click();
      expect(await element(by.id('click-counter')).getText()).toEqual('1');

      await browser.wait(ExpectedConditions.not(
        ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
    });
開發者ID:Nodarii,項目名稱:material2,代碼行數:14,代碼來源:button.e2e.spec.ts

示例5: it

    it('should change tabs when the label is clicked', () => {
      tabLabels.get(1).click();
      expect(getLabelActiveStates(tabLabels)).toEqual([false, true, false]);
      expect(getBodyActiveStates(tabBodies)).toEqual([false, true, false]);
      browser.wait(ExpectedConditions.not(
        ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
        .then(() => screenshot('click1'));

      tabLabels.get(0).click();
      expect(getLabelActiveStates(tabLabels)).toEqual([true, false, false]);
      expect(getBodyActiveStates(tabBodies)).toEqual([true, false, false]);
      browser.wait(ExpectedConditions.not(
        ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))))
        .then(() => screenshot('click0'));
    });
開發者ID:Daniel-McK,項目名稱:material2,代碼行數:15,代碼來源:tabs.e2e.ts

示例6: retrieveTextFromElement

 // Retrieve text from an element
 static retrieveTextFromElement(elm: ElementFinder) {
     browser.wait(ExpectedConditions.presenceOf(elm), Constants.longWait);
     browser.wait(ExpectedConditions.visibilityOf(elm), Constants.longWait);
     return browser.wait(() => {
       return elm.getText();
     });
 }
開發者ID:bloonbullet,項目名稱:composer,代碼行數:8,代碼來源:operations-helper.ts

示例7: beforeAll

 beforeAll(() => {
   browser.get('');
   // Don't run any specs until we see a <div> on the page.
   browser.wait(
       ExpectedConditions.presenceOf(element(by.css('div.ts1'))),
       timeoutMs);
 }, timeoutMs);
開發者ID:ramyothman,項目名稱:testdashboard,代碼行數:7,代碼來源:app_e2e_test.ts

示例8: navigatePastWelcome

 // Navigate to Editor base page and move past welcome splash
 static navigatePastWelcome() {
   browser.get(browser.baseUrl);
   let elm = element(by.id('welcome_start'));
   browser.wait(ExpectedConditions.presenceOf(elm), Constants.longWait);
   browser.wait(ExpectedConditions.visibilityOf(elm), Constants.longWait);
   this.click(elm);
   browser.wait(ExpectedConditions.invisibilityOf(element(by.css('.welcome'))), Constants.longWait);
 };
開發者ID:bloonbullet,項目名稱:composer,代碼行數:9,代碼來源:operations-helper.ts

示例9: it

    it('should be disabled when disable the radio group', async () => {
      element(by.id('toggle-disable')).click();
      element(by.id('water')).click();

      expect(element(by.id('water')).getAttribute('class')).toContain('mat-radio-disabled');

      await browser.wait(ExpectedConditions.presenceOf(element(by.css('.mat-radio-disabled'))));

      expect(element(by.css('input[id=water-input]')).getAttribute('disabled')).toBeTruthy();

      element(by.id('leaf')).click();
      expect(element(by.id('leaf')).getAttribute('class')).toContain('mat-radio-disabled');

      await browser.wait(ExpectedConditions.not(
        ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));

      expect(element(by.css('input[id=leaf-input]')).getAttribute('disabled')).toBeTruthy();
    });
開發者ID:OkBayat,項目名稱:material2,代碼行數:18,代碼來源:radio-e2e.spec.ts

示例10: elementsPresent

 // Custom ExpectedCondition to be used to ensure that ArrayFinder count is non-zero
 static elementsPresent(elementArrayFinder, minCount) {
   let hasCount = (() => {
     return elementArrayFinder.count()
     .then((count) => {
       return count >= minCount;
     });
   });
   return ExpectedConditions.and(ExpectedConditions.presenceOf(elementArrayFinder), hasCount);
 };
開發者ID:bloonbullet,項目名稱:composer,代碼行數:10,代碼來源:operations-helper.ts


注:本文中的protractor.ExpectedConditions.presenceOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。