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


TypeScript ElementFinder.getText方法代碼示例

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


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

示例1: it

  it('should query view child', () => {
    expect(result.getText()).toEqual('Selected: 1');

    button.click();

    expect(result.getText()).toEqual('Selected: 2');
  });
開發者ID:AlmogShaul,項目名稱:angular,代碼行數:7,代碼來源:view_child_spec.ts

示例2: it

  it('should query content children', () => {
    expect(resultTopLevel.getText()).toEqual('Top level panes: 1, 2');

    button.click();

    expect(resultTopLevel.getText()).toEqual('Top level panes: 1, 2, 3');
  });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:7,代碼來源:content_children_spec.ts

示例3: it

    it('should show the correct validity state', () => {
      expect(statusP.getText()).toEqual('Validation status: VALID');

      input.click();
      input.clear();
      input.sendKeys('a');
      expect(statusP.getText()).toEqual('Validation status: INVALID');
    });
開發者ID:Cammisuli,項目名稱:angular,代碼行數:8,代碼來源:simple_form_control_spec.ts

示例4:

                        dirtyGroups.forEach((dirtyGroup) => {
                            let dirtyGroupHeader: ElementFinder = siteLogPage.getGroupHeader(dirtyGroup);
                            dirtyGroupHeader.click();
                            dirtyGroupHeader.getText().then((groupName) => {
                                console.log('    Modified group: ', groupName);
                                browser.waitForAngular();

                                siteLogPage.getDirtyItems(groupName).then((dirtyItems) => {
                                    dirtyItems.forEach((dirtyItem) => {
                                        let dirtyItemHeader: ElementFinder = siteLogPage.getItemHeader(dirtyItem);
                                        dirtyItemHeader.click();
                                        dirtyItemHeader.getText().then((itemName) => {
                                            console.log('        Modified item: ', itemName);
                                        });
                                        browser.waitForAngular();

                                        siteLogPage.getDirtyFields(dirtyItem).then((dirtyFields) => {
                                            dirtyFields.forEach((dirtyField) => {
                                                siteLogPage.getDirtyFieldInput(dirtyField).isPresent().then((isModified: boolean) => {
                                                    if (isModified) {
                                                        siteLogPage.getDirtyFieldLabel(dirtyField).getText().then((fieldName) => {
                                                            console.log('            Modified field: ', fieldName);
                                                        });
                                                    }
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
開發者ID:GeoscienceAustralia,項目名稱:gnss-site-manager,代碼行數:31,代碼來源:all-sites-initial-status.e2e-spec.ts

示例5: it

 it('should display Clickers when Clickers link is selected', () => {
   element(by.css('.bar-button-menutoggle')).click();
   element.all(by.css('ion-label')).first().click();
   clickerField.sendKeys('deal with protractor');
   clickerButton.click();
   expect(clickerList.getText()).toContain('deal with protractor');
 });
開發者ID:BilelKrichen,項目名稱:clicker,代碼行數:7,代碼來源:clickerList.e2e.ts

示例6: expect

  const expectHeroes = (isShown: boolean, ng1HeroCount = 3, statusMessage = 'Ready') => {
    // Verify the show/hide button text.
    expect(showHideBtn.getText()).toBe(isShown ? 'Hide heroes' : 'Show heroes');

    // Verify the `<ng2-heroes>` component.
    expect(ng2Heroes.isPresent()).toBe(isShown);
    if (isShown) {
      expect(ng2HeroesHeader.getText()).toBe('Heroes');
      expect(ng2HeroesExtra.getText()).toBe(`Status: ${statusMessage}`);
    }

    // Verify the `<ng1-hero>` components.
    expect(ng1Heroes.count()).toBe(isShown ? ng1HeroCount : 0);
    if (isShown) {
      ng1Heroes.each(ng1Hero => expect(ng1Hero).toBeAHero());
    }
  };
開發者ID:DeepanParikh,項目名稱:angular,代碼行數:17,代碼來源:static_lite_spec.ts

示例7:

 elements.forEach((element: ElementFinder) => {
     element.getText().then(
         (text: string) => {
             if (text.length > 0) {
                 out.push(text);
             }
         }
     );
 });
開發者ID:GeoscienceAustralia,項目名稱:gnss-site-manager,代碼行數:9,代碼來源:test.utils.ts


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