【问题标题】:CodeceptJS Multiremote not working with WebdriverIO helperCodeceptJS Multiremote 不能与 WebdriverIO 助手一起使用
【发布时间】:2017-12-13 15:58:43
【问题描述】:

我正在尝试使用 WebdriverIO 帮助程序为基于 websocket 的聊天应用程序和 Codeceptjs 的 Multiremote 功能自动化测试用例,这引起了我的注意。但是,我正在努力让它发挥作用。

我想正确设置我的 codecept.js 配置文件和测试文件,以便在一个浏览器和另一个浏览器之间来回切换和操作。 { "output": "./output", "helpers": { "WebDriverIO": { "url": "localhost", "browser":"chrome", "multiremote": { "MyChrome1": { "desiredCapabilities": { "browserName": "chrome" } }, "MyChrome2": { "desiredCapabilities": { "browserName": "chrome" } } }, "restart": false, "windowSize": "maximize", "timeouts": { "script": 60000, "page load": 10000, "implicit": 5000 } } }, "include": { "I": "./steps/ICustom_steps.js", "loginPage": "./page_objects/login_page/login_page.js", "chatPage": "./page_objects/chat_page/chat_page.js" }, "mocha": {}, "bootstrap": false, "teardown": null, "hooks": [], "tests": "./test_cases/*_test.js", "timeout": 10000, "name": "chat app test" }

我可以看到 2 个浏览器弹出,但是如何正确设置测试文件以在一个浏览器和另一个浏览器之间来回切换交互。

【问题讨论】:

    标签: codeception webdriver-io codeceptjs


    【解决方案1】:

    我刚刚发现可以在调用 WebDriverIO 帮助器的帮助器方法中引入它。例如,

    useBrowserAs() {
        let client = this.helpers['WebDriverIO'].browser;
        let browser1 = client.select('browser1');
        ...INSERT YOUR WEBDRIVER IO ACTION HERE FOR BROWSER 1
        let browser2 = client.select('browser2');
        ...INSERT YOUR WEBDRIVER IO ACTION HERE FOR BROWSER 2
    }
    

    之后,就可以在Iactor中引入了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-06
      • 2019-07-19
      • 2022-01-25
      • 2017-09-01
      • 1970-01-01
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多