@mands/nx-playwright
Advanced tools
Comparing version 0.1.28 to 0.1.29
{ | ||
"name": "@mands/nx-playwright", | ||
"version": "0.1.28", | ||
"version": "0.1.29", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -37,2 +37,3 @@ # @mands/nx-playwright | ||
- `--browser=BROWSER_TYPE`: allowed browser types being `chromium`, `firefox` or `webkit` (or an `all` type to execute against all 3 types) | ||
- `--config`: configuration file. Defaults to `playwright.config.ts` | ||
- `--format=FORMAT_TYPE`: this allows values such as `json` or `html` | ||
@@ -39,0 +40,0 @@ - `--headed`: launches the browser in non-headless mode |
@@ -34,7 +34,8 @@ "use strict"; | ||
.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
const flags = getFlags(options); | ||
const runnerCommand = (_a = options.packageRunner) !== null && _a !== void 0 ? _a : schema_json_1.default.properties.packageRunner.default; | ||
const path = (_b = options.path) !== null && _b !== void 0 ? _b : schema_json_1.default.properties.path.default; | ||
const command = `${runnerCommand} playwright test ${path} --config ${options.e2eFolder}/playwright.config.ts ${flags} && echo ${PASS_MARKER}`.trim(); | ||
const config = (_c = options.config) !== null && _c !== void 0 ? _c : schema_json_1.default.properties.config.default; | ||
const command = `${runnerCommand} playwright test ${path} --config ${options.e2eFolder}/${config} ${flags} && echo ${PASS_MARKER}`.trim(); | ||
console.debug(`Running ${command}`); | ||
@@ -41,0 +42,0 @@ const { stdout, stderr } = yield (0, util_1.promisify)(child_process_1.exec)(command); |
@@ -26,3 +26,3 @@ import utilModule from 'util'; | ||
describe('building runner command', () => { | ||
it('uses correct runner and path', async () => { | ||
it('uses correct runner and path and config', async () => { | ||
const options: PlaywrightExecutorSchema = { | ||
@@ -32,2 +32,3 @@ e2eFolder: 'folder', | ||
path: 'src/tests', | ||
config: 'config/playwright.config.ts', | ||
}; | ||
@@ -41,3 +42,3 @@ | ||
const expected = | ||
'npx playwright test src/tests --config folder/playwright.config.ts && echo PLAYWRIGHT_PASS'; | ||
'npx playwright test src/tests --config folder/config/playwright.config.ts && echo PLAYWRIGHT_PASS'; | ||
expect(execCmd).toHaveBeenCalledWith(expected); | ||
@@ -44,0 +45,0 @@ }); |
@@ -6,2 +6,3 @@ import type { PackageRunner } from '../../types'; | ||
path?: string; | ||
config?: string; | ||
devServerTarget?: string; | ||
@@ -8,0 +9,0 @@ baseUrl?: string; |
@@ -14,2 +14,7 @@ { | ||
}, | ||
"config": { | ||
"type": "string", | ||
"description": "configuration file", | ||
"default": "playwright.config.ts" | ||
}, | ||
"headed": { | ||
@@ -16,0 +21,0 @@ "type": "boolean", |
Sorry, the diff of this file is not supported yet
49262
908
82