当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript by.linkText方法代码示例

本文整理汇总了TypeScript中protractor.by.linkText方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.linkText方法的具体用法?TypeScript by.linkText怎么用?TypeScript by.linkText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.by的用法示例。


在下文中一共展示了by.linkText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: beforeEach

 beforeEach(async () => {
   /**
    * Change hash depending on router LocationStrategy.
    */
   await browser.get('/');
   await element(by.linkText('Home')).click();
 });
开发者ID:dukang,项目名称:angular-starter,代码行数:7,代码来源:home.e2e.ts

示例2: it

    it('should run a 9-player individual', () => {
        // expect to be logged-in from previous test -> to improve
        browser.get('/');

        element(by.css('button')).click();
        element(by.css('input[name="name"]')).sendKeys('Test Individual');
        element(by.cssContainingText('select[name="movement"]>option', 'Individual for 9 players')).click();
        element(by.cssContainingText('select[name="scoring"]>option', 'IMP')).click();
        element(by.css('input[name="dealsPerRound"]')).clear();
        element(by.css('input[name="dealsPerRound"]')).sendKeys('1');
        // fill in players
        element(by.linkText('Players')).click();
        for (let i = 1; i <= 9; i++)
            element(by.css(`form div:nth-of-type(${i}) input`)).sendKeys(`Player ${i}`);
        element(by.linkText('Infos')).click();

        element(by.buttonText('Create')).click();
        // apparently the new angular 2 HttpModule's Observable aren't waited by protractor, so :
        browser.wait(ExpectedConditions.elementToBeClickable(element(by.buttonText('Start'))), 12000);
        element(by.buttonText('Start')).click();
        // polling for scores is done outside angular, so we can keep synchronization
        // but after that, without synchronization, we should wait for the buttons...
        element(by.linkText('Play')).click();

        for (let round = 0; round < 27; round++) {
            const north1 = Math.floor(round / 9) * 3 + (Math.floor(round / 3) + 1) % 3 + 1;
            element(by.css(`select[name="currentPlayer"]>option:nth-of-type(${north1})`)).click();
            randomScore();
            const north2 = (north1 + 2) % 9 + 1;
            element(by.css(`select[name="currentPlayer"]>option:nth-of-type(${north2})`)).click();
            randomScore();

            if (round < 26) {
                // wait for Next Round button
                browser.wait(ExpectedConditions.elementToBeClickable(element(by.buttonText('Next Round'))), 12000);
                element(by.buttonText('Next Round')).click();
                // then wait for next round to actually begin
                const roundSummary = element(by.cssContainingText('h4', 'Round'));
                browser.wait(ExpectedConditions.textToBePresentInElement(roundSummary, 'Round ' + (round + 2)), 12000);
            }
        }

        browser.wait(ExpectedConditions.presenceOf(element(by.buttonText('Close'))), 12000);
        element(by.buttonText('Close')).click();

        expect(element(by.linkText('Play'))).toBeTruthy();
        expect(element(by.linkText('Players'))).toBeTruthy();
        element(by.linkText('Players')).click();
        element(by.linkText('Player 1')).click();
        element(by.linkText('4')).click();  // Player 1 skips deals 1-3
        element(by.linkText('Previous')).click();
    });
开发者ID:lanfeust69,项目名称:LanfeustBridge,代码行数:52,代码来源:app.e2e.ts

示例3: it

      it('setup: back to Text, click settings, click on tab', () => {

        // click on breadcrumb text title to go back one
        element(by.linkText(constants.testText1Title)).click();

        // click on text settings
        SfTextPage.clickTextSettingsButton();

        textSettingsPage.tabs.paratextExport.click();
      });
开发者ID:,项目名称:,代码行数:10,代码来源:

示例4: clickDropdownLink

 clickDropdownLink(linkText: string) {
   element(by.linkText(linkText)).click();
 }
开发者ID:usa-npn,项目名称:geoserver-request-builder,代码行数:3,代码来源:app.po.ts

示例5: sortTable

 sortTable(colName: string) {
   element.all(by.css('table thead th')).all(by.linkText(colName)).get(0).click();
 }
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:3,代码来源:alerts-list.po.ts

示例6: logout

 logout() {
   return element(by.linkText('Logout'));
 }
开发者ID:benwfreed,项目名称:eatlanta-client,代码行数:3,代码来源:auth.po.ts

示例7: getSavedSearchOptions

 getSavedSearchOptions() {
   browser.sleep(1000);
   return element(by.linkText('Saved Searches')).element(by.xpath('..')).all(by.css('li')).getText();
 }
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:4,代码来源:alerts-list.po.ts

示例8: getDefaultSavedSearchValue

 getDefaultSavedSearchValue() {
   browser.sleep(1000);
   return element(by.linkText('Saved Searches')).element(by.xpath('..')).all(by.css('i')).getText();
 }
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:4,代码来源:alerts-list.po.ts


注:本文中的protractor.by.linkText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。