mirror of
https://github.com/strapi/strapi.git
synced 2026-05-03 16:22:30 +00:00
25 lines
649 B
JavaScript
25 lines
649 B
JavaScript
'use strict';
|
|
|
|
const execa = require('execa');
|
|
|
|
/**
|
|
* Run Playwright test command.
|
|
* Only pass runner-owned env keys; execa merges with process.env by default (extendEnv: true).
|
|
*/
|
|
const runPlaywright = async ({ configPath, cwd, port, testAppPath, testArgs }) => {
|
|
// `STRAPI_DISABLE_EE` / `STRAPI_E2E_EDITION` come from `applyE2eEditionEnv()` in run-tests.js (after dotenv).
|
|
await execa('yarn', ['playwright', 'test', '--config', configPath, ...testArgs], {
|
|
stdio: 'inherit',
|
|
cwd,
|
|
env: {
|
|
PORT: String(port),
|
|
HOST: '127.0.0.1',
|
|
TEST_APP_PATH: testAppPath,
|
|
},
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
runPlaywright,
|
|
};
|