本文整理匯總了TypeScript中protractor.browser.setLocation方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.setLocation方法的具體用法?TypeScript browser.setLocation怎麽用?TypeScript browser.setLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.browser
的用法示例。
在下文中一共展示了browser.setLocation方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it(`should remember badge selection`, async function () {
await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
await browser.wait(() => altBadgeRadio.isPresent(), 1000);
await altBadgeRadio.click();
await savePlayerButton.click();
await waitForSaveToComplete(player1.name);
await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
expect(altBadgeRadio.getAttribute('checked')).toBe('true');
});
示例2: 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)');
});
示例3: beforeAll
beforeAll(async function () {
const pairAssignmentSet1 = new PairAssignmentDocument(new Date().toISOString(), [[
{
name: 'Ollie',
_id: monk.id()
},
{
name: 'Speedy',
_id: monk.id()
}
]]);
const pairAssignmentSet2 = new PairAssignmentDocument(new Date().toISOString(), [[
{name: 'Arthur', _id: monk.id()},
{name: 'Garth', _id: monk.id()}
]]);
const apiGuy = await ApiGuy.new();
await apiGuy.postTribe(tribe);
await Promise.all([
e2eHelp.authorizeUserForTribes([tribe.id]),
apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet1),
apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet2)
]);
await browser.waitForAngular();
await browser.setLocation(`/${tribe.id}/history`);
await browser.wait(() => element(By.id('history-view')).isPresent(), 2000)
});
示例4: it
it('will let you edit an existing player', function () {
browser.setLocation(`/${tribe.id}/pairAssignments/current/`);
element.all(By.repeater('player in players'))
.first().element(By.className("player-card-header"))
.click();
expect(browser.getCurrentUrl()).toEqual(`${hostName}/${tribe.id}/player/${player1._id}/`);
});