当前位置: 首页>>代码示例>>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;未经允许,请勿转载。