Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mmarkelov
Copy link
Member

Thinking about #19
Try to find out simple way to do it. Get inspired by qawolf and qawolf/qawolf#352
Just add helper script to run tests for all browsers in parallel, I could also add script for running it one by one. But I'm not sure that it is very convenient and easy way.
So you should run this script like so:

"test:all-browsers": "node node_modules/jest-playwright-preset/lib/parallel.js"

And you will get something like this:
Снимок экрана 2020-02-11 в 15 12 29

So what do you think about it?

@mmarkelov
Copy link
Member Author

As a workaround we can use bin:

"bin": {
    "jest-playwright": "./lib/bin/index.js"
  },

bin/index.js:

#!/usr/bin/env node

import { spawnSync } from 'child_process'
const [,, ...args] = process.argv

if (args[0] === '--parallel') {
    const exec = (browser = 'chromium') => {
        spawnSync('node', ['node_modules/.bin/jest'], {
            stdio: 'inherit',
            shell: true,
            env: {
                ...process.env,
                BROWSER: browser,
            },
        })
    }
    exec()
    exec('firefox')
    exec('webkit')
}

Also we could add another option to run it one by one.

And then we can use it like so:

"test:browsers": "jest-playwright --parallel"

@mmarkelov mmarkelov merged commit 6d3f23b into master Feb 12, 2020
@mxschmitt mxschmitt deleted the All-browsers-in-parallel branch February 23, 2020 09:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants