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


TypeScript ExpectedConditions.elementToBeClickable方法代碼示例

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


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

示例1: it

 it('should navigate in the builds history by using the previous next links', async () => {
     await builder.go();
     const lastbuild = await builder.getLastSuccessBuildNumber();
     // Build #1
     await builder.goForce();
     await force.clickStartButton();
     await builder.go();
     await builder.waitNextBuildFinished(lastbuild);
     // Build #2
     await builder.goForce();
     await force.clickStartButton();
     await builder.go();
     await builder.waitNextBuildFinished(+lastbuild + 1);
     await builder.goBuild(+lastbuild + 2);
     const lastBuildURL = await browser.getCurrentUrl();
     let previousButton = builder.getPreviousButton();
     await browser.wait(EC.elementToBeClickable(previousButton),
                        5000,
                        "previous button not clickable");
     await previousButton.click()
     expect(await browser.getCurrentUrl()).not.toMatch(lastBuildURL);
     let nextButton = builder.getNextButton();
     await browser.wait(EC.elementToBeClickable(nextButton),
                        5000,
                        "next button not clickable");
     await nextButton.click();
     expect(await browser.getCurrentUrl()).toMatch(lastBuildURL);
 });
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:28,代碼來源:buildsnavigation.scenarios.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('should create a build with a dedicated reason and stop it during execution', async () => {

        await builder.goForce();
        let startButton = force.getStartButton();
        await browser.wait(EC.elementToBeClickable(startButton),
                           5000,
                           "start button not clickable");
        await startButton.click();
        expect(await browser.getCurrentUrl()).toMatch("/builders/\[1-9]/builds/\[1-9]");
        let stopButton = builder.getStopButton();
        await browser.wait(EC.elementToBeClickable(stopButton),
                           5000,
                           "stop button not clickable");
        await stopButton.click();
    });
開發者ID:s0undt3ch,項目名稱:buildbot,代碼行數:15,代碼來源:buildsnavigation.scenarios.ts

示例4: element

 .then(() => {
     let importElement = element(by.id('import_confirm'));
     return browser.wait(ExpectedConditions.elementToBeClickable(importElement), Constants.longWait)
     .then(() => {
         return importElement.click();
     });
 });
開發者ID:marlonprudente,項目名稱:composer,代碼行數:7,代碼來源:import.ts

示例5: clickCancelWholeQueue

 async clickCancelWholeQueue() {
     let button = this.getCancelWholeQueue();
     await browser.wait(EC.elementToBeClickable(button),
                        5000,
                        "cancel whole queue button not clickable");
     await button.click();
 }
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:7,代碼來源:force.ts

示例6: clickStartButton

 async clickStartButton() {
     let button = this.getStartButton();
     await browser.wait(EC.elementToBeClickable(button),
                        5000,
                        "start button not clickable");
     await button.click();
 }
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:7,代碼來源:force.ts

示例7: goBuild

 async goBuild() {
     const buildList = element.all(By.css('text.id')).last();
     await browser.wait(EC.elementToBeClickable(buildList),
                        5000,
                        "build list not clickable");
     await buildList.click();
 }
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:7,代碼來源:waterfall.ts

示例8: importBusinessNetworkCard

 static importBusinessNetworkCard(filePath: string) {
     let cardName = path.basename(filePath, path.extname(filePath));
     let importButton = element(by.id('importIdCard'));
     let importElement;
     return browser.wait(ExpectedConditions.elementToBeClickable(importButton), Constants.longWait)
     .then(() => {
         return OperationsHelper.click(importButton);
     })
     .then(() => {
         return browser.wait(ExpectedConditions.visibilityOf(element(by.css('.drawer'))), Constants.longWait);
     })
     .then(() => {
         let inputFileElement = element(by.id('file-importer_input'));
         return dragDropFile(inputFileElement, filePath);
     })
     .then(() => {
         return browser.wait(ExpectedConditions.visibilityOf(element(by.id('cardName'))), Constants.longWait);
     })
     .then(() => {
         return element(by.id('cardName')).sendKeys(cardName);
     })
     .then(() => {
         importElement = element(by.id('importBtn'));
         return browser.wait(ExpectedConditions.elementToBeClickable(importElement), Constants.longWait);
     })
     .then(() => {
         return importElement.click();
     })
     .then(() => {
         return browser.wait(ExpectedConditions.visibilityOf(element(by.css('.user-name[title=TestPeerAdmin]'))));
     });
 }
開發者ID:marlonprudente,項目名稱:composer,代碼行數:32,代碼來源:login.ts

示例9: goBuilderAndCheck

 async goBuilderAndCheck(builderRef) {
     let localBuilder = element(By.linkText(this.builder));
     await browser.wait(EC.elementToBeClickable(localBuilder),
                        5000,
                        "local builder not clickable");
     await localBuilder.click();
     await this.checkBuilder();
 }
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:8,代碼來源:waterfall.ts

示例10: goForce

 async goForce() {
     await this.go();
     var forceButton = element.all(By.buttonText(this.forceName)).first();
     await browser.wait(EC.elementToBeClickable(forceButton),
                        5000,
                        "force button not clickable");
     await forceButton.click();
 }
開發者ID:ewongbb,項目名稱:buildbot,代碼行數:8,代碼來源:builder.ts


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