本文整理匯總了TypeScript中protractor/built.browser類的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser類的具體用法?TypeScript browser怎麽用?TypeScript browser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了browser類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should discard the invitation after joining once', () => {
createParty(browser3.instance);
joinParty(browser3.instance, browser, TEST_CHAR_NAME3, TEST_CHAR_NAME);
leaveParty(browser);
browser.executeScript(`socket.emit("join_party", {leader_name: "${TEST_CHAR_NAME3}"});`);
expectText("Cannot join - not invited anymore");
leaveParty(browser3.instance);
});
示例2: it
it('should not let inviting if not party leader', () => {
createParty(newBrowser.instance);
joinParty(newBrowser.instance, browser, TEST_CHAR_NAME2, TEST_CHAR_NAME);
browser.executeScript(`socket.emit("invite_to_party", {char_name: "${TEST_CHAR_NAME3}"});`);
expectText("Cannot invite - must be party leader");
leaveParty(newBrowser.instance);
leaveParty(browser);
});
示例3: it
it('should tell me how much gold i picked', () => {
browser.executeScript(`socket.emit("dropped_gold", {amount: 5});`)
getItemId().then(itemId => {
clearLogs();
browser.executeScript(`socket.emit("picked_item", {item_id: "${itemId}"});`)
expectText(`"amount": 5`);
});
});
示例4: it
it('should reflect back the changed value', () => {
page.navigateTo();
return browser.executeScript('window.scrollTo(0, 500);').then(function() {
const btns = page.getSegmentButtons();
btns.chicken.click();
expect(page.getRadioOutputText()).toEqual('chicken');
});
});
示例5: it
it('should reflect toggling the value', () => {
page.navigateTo();
return browser.executeScript('window.scrollTo(0, 500);').then(function() {
const el = page.getIonicToggle();
el.click();
expect(page.getToggleOutput()).toEqual('true');
});
});
示例6: it
it('should not kick member if not party leader', () => {
createParty(browser);
joinParty(browser, browser3.instance, TEST_CHAR_NAME, TEST_CHAR_NAME3);
changeLeader(browser, browser3.instance, TEST_CHAR_NAME3);
browser.executeScript(`socket.emit("kick_from_party", {char_name: "${TEST_CHAR_NAME3}"});`);
expectText("Cannot kick - must be party leader");
leaveParty(browser);
leaveParty(browser3.instance);
});
示例7: getItemId
getItemId().then(itemId => {
clearLogs();
browser.executeScript(`socket.emit("picked_item", {item_id: "${itemId}"});`)
expectText(`"amount": 5`);
leaveParty();
leaveParty(newBrowser.instance);
leaveParty(browser3.instance);
// bring back the gold to the other char
newBrowser.instance.executeScript(`socket.emit("dropped_gold", {amount: 5});`)
expectText(`"amount": -5`, newBrowser.instance);
pickItem();
});