@apica-io/asm-playwright-runner 1.0.0-dev.6 → 1.0.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runner.js +5 -15
- package/package.json +1 -1
package/dist/runner.js
CHANGED
|
@@ -234,26 +234,16 @@ class PlaywrightRunner {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
async detectScriptType(collectionPath) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (typeof mod.default === "function") {
|
|
241
|
-
this.logger.debug("Detected plain Playwright script (default export).");
|
|
242
|
-
return runnerConfig_1.ScriptType.PLAYWRIGHT;
|
|
243
|
-
}
|
|
237
|
+
const fileContent = fs_1.default.readFileSync(collectionPath, "utf-8");
|
|
238
|
+
if (fileContent.includes("export default")) {
|
|
239
|
+
return runnerConfig_1.ScriptType.PLAYWRIGHT;
|
|
244
240
|
}
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
if (fileContent.includes("test(")) {
|
|
242
|
+
return runnerConfig_1.ScriptType.PLAYWRIGHT_TEST;
|
|
247
243
|
}
|
|
248
244
|
if (collectionPath.endsWith(".json")) {
|
|
249
|
-
this.logger.debug("Detected JSON flow.");
|
|
250
245
|
return runnerConfig_1.ScriptType.JSON;
|
|
251
246
|
}
|
|
252
|
-
const fileContent = fs_1.default.readFileSync(collectionPath, "utf-8");
|
|
253
|
-
if (fileContent.includes("test(")) {
|
|
254
|
-
this.logger.debug("Detected Playwright Test file.");
|
|
255
|
-
return runnerConfig_1.ScriptType.PLAYWRIGHT_TEST;
|
|
256
|
-
}
|
|
257
247
|
return undefined;
|
|
258
248
|
}
|
|
259
249
|
async close() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apica-io/asm-playwright-runner",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.7",
|
|
4
4
|
"description": "CLI wrapper for Playwright collections or scripts with dynamic actions, config, and test result models.",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|