当前位置: 首页>>代码示例>>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;未经允许,请勿转载。