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


TypeScript browser.getCurrentUrl方法代碼示例

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


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

示例1: it

 it('should create 3 users and sign-out from session', () => {
   const USERS: UserAuth[] = new AuthUsersService().users;
   const textService: TextService = new TextService();
   browser.get('/#/auth/sign-in');
   expect(browser.getCurrentUrl()).toMatch(/\/#\/auth\/sign-in$/);
   element(by.css('input[type=text]')).sendKeys(USERS[1].email);
   element.all(by.css('input[type=password]')).get(0).sendKeys(USERS[1].password);
   // element.all(by.css('input[type=password]')).get(1).sendKeys('teacher1');
   element(by.css('.btn')).click();
   expect(browser.getCurrentUrl()).toMatch(/\/#\/profile$/);
   element(by.cssContainingText('.btn.btn-default', 'Заполнить профиль')).click();
   element.all(by.css('input[type=radio]')).get(1).click();
   element.all(by.css('input[type=text]')).get(0).sendKeys(textService.generateText(5, {
     onlyText: true, lowerCase: true
   }));
   element.all(by.css('input[type=text]')).get(1).sendKeys(textService.generateText(5, {
     onlyText: true, lowerCase: true
   }));
   element.all(by.css('input[type=text]')).get(2).sendKeys(textService.generateText(5, {
     onlyText: true, lowerCase: true
   }));
   element.all(by.css('input[type=text]')).get(3).sendKeys(textService.generateText(10, {
     lowerCase: true
   }));
   element.all(by.css('input[type=text]')).get(4).sendKeys('3');
   element(by.cssContainingText('.btn.btn-success.btn-sm', 'Сохранить')).click();
   // element(by.cssContainingText('.navbar-profile button', 'Выход')).click();
   expect(browser.getCurrentUrl()).toMatch(/\/#\/group-list$/);
   browser.pause();
 });
開發者ID:asiman161,項目名稱:easy-tests,代碼行數:30,代碼來源:auth.e2e-spec.ts

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

示例3: it

  it('should route on click', () => {
    browser.get(baseUrl);

    waitForElement(contentSelector);
    let content = element(by.css(contentSelector));
    expect(content.getText()).toEqual('Start');

    const aboutBtn = element(by.css(navSelector + ' .about'));
    aboutBtn.click();
    waitForUrl(/\/about/);
    waitForElement(contentSelector);
    waitForElementText(contentSelector, 'About');
    content = element(by.css(contentSelector));
    expect(content.getText()).toEqual('About');
    expect(browser.getCurrentUrl()).toMatch(/\/about/);

    const contactBtn = element(by.css(navSelector + ' .contact'));
    contactBtn.click();
    waitForUrl(/\/contact/);
    waitForElement(contentSelector);
    waitForElementText(contentSelector, 'Contact');
    content = element(by.css(contentSelector));
    expect(content.getText()).toEqual('Contact');
    expect(browser.getCurrentUrl()).toMatch(/\/contact/);
  });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:25,代碼來源:router_spec.ts

示例4: expect

        browser.controlFlow().execute(async () => {

            navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);

            browser.getCurrentUrl().then((actualUrl) => {
                expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
            });

            contentServicesPage.waitForTableBody();

            navigationBarPage.clickLogoutButton();

            logoutPage.checkLogoutSectionIsDisplayed();

            navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
            loginPage.waitForElements();
            browser.refresh();
            loginPage.waitForElements();

            loginPage.enterUsername(user.id);
            loginPage.enterPassword(user.password);
            loginPage.clickSignInButton();

            navigationBarPage.checkMenuButtonIsDisplayed();

            browser.getCurrentUrl().then((actualUrl) => {
                expect(actualUrl).toEqual(TestConfig.adf.url + '/files/' + uploadedFolder.entry.id);
            });
        });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:29,代碼來源:redirection.e2e.ts

示例5: checkBuildResult

 async checkBuildResult() {
     const firstLinkInPopup = element.all(By.css('.modal-dialog a')).first();
     await firstLinkInPopup.click();
     const currentUrl = await browser.getCurrentUrl();
     expect(currentUrl).toContain("builders/");
     expect(currentUrl).toContain("builds/");
 }
開發者ID:cmouse,項目名稱:buildbot,代碼行數:7,代碼來源:waterfall.ts

示例6: expect

 browser.wait(() => {
   return browser.getCurrentUrl().then((url) => {
     const parts = url.split('#');
     expect(parts[1] === '/apps').toBeTruthy();
     return url;
   });
 });
開發者ID:BoykoAlex,項目名稱:spring-cloud-dataflow-ui,代碼行數:7,代碼來源:apps.e2e-spec.ts

示例7: goOnAssociatedEmbed

  async goOnAssociatedEmbed () {
    let url = await browser.getCurrentUrl()
    url = url.replace('/watch/', '/embed/')
    url = url.replace(':3333', ':9001')

    return browser.get(url)
  }
開發者ID:jiang263,項目名稱:PeerTube,代碼行數:7,代碼來源:video-watch.po.ts

示例8: expect

                browser.getCurrentUrl().then((url1: string) => {
                    var query = { "filter": { "term": { "nothing": "no" } } };
                    esfHome.setQuerySectionContent(query);
                    esfHome.executeSaveCommand();

                    expect(browser.getCurrentUrl()).not.toEqual(url1);
                });
開發者ID:domasmas,項目名稱:esf,代碼行數:7,代碼來源:esf.WebsiteHome.spec.ts

示例9: it

        it('can save edits to a tribe correctly', async function () {
            await browser.get(hostName + '/test-login?username=' + userEmail + '&password="pw"');

            await browser.wait(async () => `${hostName}/tribes/` === await browser.getCurrentUrl(), 1000);
            const tribeElements = element.all(By.className('tribe-card'));
            tribeElements.first().element(By.className("tribe-card-header")).click();

            expect(browser.getCurrentUrl()).toEqual(hostName + '/' + tribe.id + '/edit/');
            expect(element(By.id('tribe-name')).getAttribute('value')).toEqual(tribe.name);
            const expectedNewName = 'Different name';
            element(By.id('tribe-name')).clear();
            element(By.id('tribe-name')).sendKeys(expectedNewName);

            element(By.id('call-sign-checkbox')).click();
            element(By.id('badge-checkbox')).click();
            const expectedDefaultBadgeName = 'New Default Badge Name';
            updateTextBox(By.id('default-badge-name'), expectedDefaultBadgeName);
            const expectedAltBadgeName = 'New Alt Badge Name';
            updateTextBox(By.id('alt-badge-name'), expectedAltBadgeName);
            const differentBadgesOption = element(By.css('#pairing-rule option[label="Prefer Different Badges (Beta)"]'));
            differentBadgesOption.click();

            element(By.id('save-tribe-button')).click();
            await browser.wait(async () => `${hostName}/tribes/` === await browser.getCurrentUrl(), 1000);

            await browser.setLocation('/' + tribe.id + '/edit/');
            await browser.wait(() => element(By.id('tribe-name')).isPresent(), 2000);

            expect(element(By.id('tribe-name')).getAttribute('value')).toEqual(expectedNewName);
            expect(element(By.id('call-sign-checkbox')).getAttribute('checked')).toEqual('true');
            expect(element(By.id('badge-checkbox')).getAttribute('checked')).toEqual('true');
            expect(element(By.id('default-badge-name')).getAttribute('value')).toEqual(expectedDefaultBadgeName);
            expect(element(By.id('alt-badge-name')).getAttribute('value')).toEqual(expectedAltBadgeName);
            expect(checkedOption.getAttribute('label')).toBe('Prefer Different Badges (Beta)');
        });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:35,代碼來源:edit-tribe.e2e.ts

示例10: it

 it('should redirect `index.html` to `index.html#!/phones', function() {
   browser.get('index.html');
   browser.waitForAngular();
   browser.getCurrentUrl().then(function(url: string) {
     expect(url.endsWith('/phones')).toBe(true);
   });
 });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:7,代碼來源:e2e-spec.ts


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