本文整理汇总了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}/`);
});