当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript browser.executeScript方法代码示例

本文整理汇总了TypeScript中protractor/built.browser.executeScript方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.executeScript方法的具体用法?TypeScript browser.executeScript怎么用?TypeScript browser.executeScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor/built.browser的用法示例。


在下文中一共展示了browser.executeScript方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

 it('should not let inviting if other character is already in party', () => {
     createParty();
     createParty(browser3.instance);
     browser.executeScript(`socket.emit("invite_to_party", {char_name: "${TEST_CHAR_NAME3}"});`);
     expectText("Cannot invite - invitee is already in a party");
     leaveParty();
     leaveParty(browser3.instance);
 });
开发者ID:Tzook,项目名称:lul,代码行数:8,代码来源:invite.spec.ts

示例2: 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);
 });
开发者ID:Tzook,项目名称:lul,代码行数:8,代码来源:join.spec.ts

示例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`);
     });
 });
开发者ID:Tzook,项目名称:lul,代码行数:8,代码来源:gold.spec.ts

示例4: 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');
   });
 });
开发者ID:keithdmoore,项目名称:ionic,代码行数:8,代码来源:basic-inputs.e2e-spec.ts

示例5: 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');
   });
 });
开发者ID:keithdmoore,项目名称:ionic,代码行数:8,代码来源:group-inputs.e2e-spec.ts

示例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);
 });
开发者ID:Tzook,项目名称:lul,代码行数:9,代码来源:kick.spec.ts

示例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();
 });
开发者ID:Tzook,项目名称:lul,代码行数:12,代码来源:gold.spec.ts


注:本文中的protractor/built.browser.executeScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。