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


TypeScript by.buttonText方法代碼示例

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


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

示例1: 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

示例2: createWallet

  createWallet() {
    element(by.buttonText('New')).click();

    const label = element(by.css('[formcontrolname="label"]'));
    const seed = element(by.css('[formcontrolname="seed"]'));
    const confirm = element(by.css('[formcontrolname="confirm_seed"]'));
    const btnCreate = element(by.buttonText('Create'));
    const seedValidationCheckBox = element(by.css('.-check'));

    label.clear();
    label.sendKeys('Test onboarding wallet');
    seed.clear();
    seed.sendKeys('test test');
    confirm.clear();
    confirm.sendKeys('test test');
    seedValidationCheckBox.click();

    return btnCreate.isEnabled().then(status => {
      if (status) {
        btnCreate.click();
      }

      return status;
    });
  }
開發者ID:skycoin,項目名稱:skycoin,代碼行數:25,代碼來源:onboarding.po.ts

示例3: 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

示例4: 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

示例5: it

  it('should support component with inputs and outputs', function () {
    let app = element(by.css('hero-io'));
    let confirmComponent = app.element(by.css('my-confirm'));

    confirmComponent.element(by.buttonText('OK')).click();
    expect(app.element(by.cssContainingText('span', 'OK clicked')).isPresent()).toBe(true);

    confirmComponent.element(by.buttonText('Cancel')).click();
    expect(app.element(by.cssContainingText('span', 'Cancel clicked')).isPresent()).toBe(true);
  });
開發者ID:MarkPieszak,項目名稱:angular.io,代碼行數:10,代碼來源:e2e-spec.ts

示例6: it

		it('Selecting "View Modal" button opens modal window', () => {
			element(by.buttonText('View Modal')).click();
			const title = element(by.css('.modal-title'));
			// Allow time for modal to open
			browser.wait(ExpectedConditions.visibilityOf(title), 10000);
			expect(title.isDisplayed()).toBeTruthy();
			element(by.buttonText('Close')).click();
			// Allow time for modal to close
			// browser.wait(protractor.ExpectedConditions.invisibilityOf(title), 10000);
			browser.sleep(1000);
		});
開發者ID:PaulGilchrist,項目名稱:Angular2NodeTemplate,代碼行數:11,代碼來源:pdf-demo.component.e2e-spec.ts

示例7: it

		it('Changing "Flooring Zones" radio buttons changes SVG floor color for the respective rooms', () => {
			// Default is to have no flooring selected.  Once carpet, tile, or wood is selected, those respective classes will be added to objects in the SVG
			const carpet = element.all(by.buttonText('Carpet'));
			carpet.get(0).click();
			carpet.get(3).click();
			const tile = element.all(by.buttonText('Tile'));
			tile.get(1).click();
			tile.get(4).click();
			const wood = element.all(by.buttonText('Wood'));
			wood.get(2).click();
			wood.get(5).click();
			const carpetedRooms = element.all(by.css('path.carpet'));
			expect(carpetedRooms.count()).toBeGreaterThan(0);
		});
開發者ID:PaulGilchrist,項目名稱:Angular2NodeTemplate,代碼行數:14,代碼來源:floor.component.e2e-spec.ts

示例8: getPageStruct

  function getPageStruct() {
    let hrefEles = element.all(by.css('my-app a'));

    return {
      hrefs: hrefEles,
      routerParent: element(by.css('my-app > ng-component')),
      routerTitle: element(by.css('my-app > ng-component > h2')),

      crisisHref: hrefEles.get(0),
      crisisList: element.all(by.css('my-app > ng-component > ng-component li')),
      crisisDetail: element(by.css('my-app > ng-component > ng-component > ng-component > div')),
      crisisDetailTitle: element(by.css('my-app > ng-component > ng-component > ng-component > div > h3')),

      heroesHref: hrefEles.get(1),
      heroesList: element.all(by.css('my-app > ng-component li')),
      heroDetail: element(by.css('my-app > ng-component > div')),
      heroDetailTitle: element(by.css('my-app > ng-component > div > h3')),

      adminHref: hrefEles.get(2),
      adminPreloadList: element.all(by.css('my-app > ng-component > ng-component > ul > li')),

      loginHref: hrefEles.get(3),
      loginButton: element.all(by.css('my-app > ng-component > p > button')),

      contactHref: hrefEles.get(4),
      contactCancelButton: element.all(by.buttonText('Cancel')),

      outletComponents: element.all(by.css('my-app > ng-component'))
    };
  }
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:30,代碼來源:e2e-spec.ts

示例9: clickYesForConfirmation

 clickYesForConfirmation() {
   let okButton = element(by.css('.metron-dialog')).element(by.buttonText('OK'));
   let maskElement = element(by.className('modal-backdrop'));
   waitForElementVisibility(maskElement)
   .then(() => okButton.click())
   .then(() => waitForElementInVisibility(maskElement));
 }
開發者ID:iraghumitra,項目名稱:incubator-metron,代碼行數:7,代碼來源:tree-view.po.ts

示例10: getPageStruct

  function getPageStruct() {
    const hrefEles = element.all(by.css('app-root > nav a'));
    const crisisDetail = element.all(by.css('app-root > div > app-crisis-center > app-crisis-list > app-crisis-detail > div')).first();
    const heroDetail = element(by.css('app-root > div > app-hero-detail'));

    return {
      hrefs: hrefEles,
      activeHref: element(by.css('app-root > nav a.active')),

      crisisHref: hrefEles.get(0),
      crisisList: element.all(by.css('app-root > div > app-crisis-center > app-crisis-list li')),
      crisisDetail: crisisDetail,
      crisisDetailTitle: crisisDetail.element(by.xpath('*[1]')),

      heroesHref: hrefEles.get(1),
      heroesList: element.all(by.css('app-root > div > app-hero-list li')),
      heroDetail: heroDetail,
      heroDetailTitle: heroDetail.element(by.xpath('*[2]')),

      adminHref: hrefEles.get(2),
      adminPage: element(by.css('app-root > div > app-admin')),
      adminPreloadList: element.all(by.css('app-root > div > app-admin > app-admin-dashboard > ul > li')),

      loginHref: hrefEles.get(3),
      loginButton: element.all(by.css('app-root > div > app-login > p > button')),

      contactHref: hrefEles.get(4),
      contactCancelButton: element.all(by.buttonText('Cancel')),

      primaryOutlet: element.all(by.css('app-root > div > app-hero-list')),
      secondaryOutlet: element.all(by.css('app-root > app-compose-message'))
    };
  }
開發者ID:Cammisuli,項目名稱:angular,代碼行數:33,代碼來源:app.e2e-spec.ts


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