本文整理匯總了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();
});
示例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);
});
示例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/);
});
示例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);
});
});
示例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/");
}
示例6: expect
browser.wait(() => {
return browser.getCurrentUrl().then((url) => {
const parts = url.split('#');
expect(parts[1] === '/apps').toBeTruthy();
return url;
});
});
示例7: goOnAssociatedEmbed
async goOnAssociatedEmbed () {
let url = await browser.getCurrentUrl()
url = url.replace('/watch/', '/embed/')
url = url.replace(':3333', ':9001')
return browser.get(url)
}
示例8: expect
browser.getCurrentUrl().then((url1: string) => {
var query = { "filter": { "term": { "nothing": "no" } } };
esfHome.setQuerySectionContent(query);
esfHome.executeSaveCommand();
expect(browser.getCurrentUrl()).not.toEqual(url1);
});
示例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)');
});
示例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);
});
});