-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WCT reuse browser instance across test runs #796
Labels
Comments
nicojs
changed the title
Make WCT reuse browser instances across test runs
Make WCT reuse browser instance across test runs
Nov 27, 2018
12 tasks
nicojs
added a commit
to stryker-mutator/stryker-js
that referenced
this issue
Dec 11, 2018
Add the `stryker-wct-runner` package. A plugin to use [web-component-tester](https://github.com/Polymer/tools/tree/master/packages/web-component-tester) with Stryker. It allows WCT to use the default `wct.conf.json` configuration, or you can configure it with the `wct` property in your stryker.conf.js file. For example: ```js // Full example wct: { configFile: 'alternative/wct/configuration.json', verbose: true, npm: true, plugins: { local: { browsers: ["chrome"], skipSeleniumInstall: true, browserOptions: { chrome: ["window-size=1920,1080", "headless", "disable-gpu"], firefox: ["--headless"] } } } } ``` For more information, see the readme.md. Some more points: * `web-component-tester` is a peer dependency. Users are responsible to install a correct version. * WCT can be chatty. By default, all log messages are ignored. Setting `wct.verbose` to `true` will forward all wct logging to Stryker's logging system. * WCT uses Node's `promisify` implementation directly. As such, it will only work from node 8 onward. For that reason, wct integration tests don't run on our node 6 build. * The option `persistent: false` is forced as wct option, because `persistent: true` keeps the browser open and Stryker cannot read the test results. See Polymer/tools#796 for more details.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We're using the public api of WCT for the stryker-wct-runner (a plugin to use wct in Stryker): stryker-mutator/stryker-js#1252. Namely the
steps
file.We're using it to initialize the test runner and then make a lot of test runs in quick succession. Pseudocode:
This works functionally. However, each time we call
runTests
a new browser instance is started, which executes the tests and closes the browser. If we enablepersistent
, therunTests
promise never resolves and the"run-end"
event is never triggered.Is there some other way to make WCT reuse the same browser instance for across multiple test runs? Maybe refresh the browser (this is the way Karma works), instead of closing it and opening a new one? I feel comfortable that reusing the same browser instance between runs would at least double the speed of mutation testing web components.
The text was updated successfully, but these errors were encountered: