@browsermation/test 0.0.24 → 0.0.25
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/README.md +24 -0
- package/dist/bin/cli.d.ts +1 -1
- package/dist/bin/cli.js +909 -2498
- package/dist/core.d.ts +0 -1
- package/dist/defineConfig.d.ts +1 -1
- package/dist/index.js +38 -21
- package/package.json +2 -1
package/dist/core.d.ts
CHANGED
package/dist/defineConfig.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PlaywrightTestConfig } from 'playwright/test';
|
|
2
|
-
export declare function defineConfig(config:
|
|
2
|
+
export declare function defineConfig<T extends PlaywrightTestConfig>(config: T): Promise<T & PlaywrightTestConfig>;
|
package/dist/index.js
CHANGED
|
@@ -37,21 +37,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
37
37
|
|
|
38
38
|
// src/defineConfig.ts
|
|
39
39
|
var import_node_https = __toESM(require("node:https"));
|
|
40
|
-
|
|
41
|
-
// ../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
42
|
-
var isProduction = process.env.NODE_ENV === "production";
|
|
43
|
-
var prefix = "Invariant failed";
|
|
44
|
-
function invariant(condition, message) {
|
|
45
|
-
if (condition) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (isProduction) {
|
|
49
|
-
throw new Error(prefix);
|
|
50
|
-
}
|
|
51
|
-
var provided = typeof message === "function" ? message() : message;
|
|
52
|
-
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
53
|
-
throw new Error(value);
|
|
54
|
-
}
|
|
40
|
+
var import_node_http = __toESM(require("node:http"));
|
|
55
41
|
|
|
56
42
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
57
43
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -551,6 +537,14 @@ var source_default = chalk;
|
|
|
551
537
|
// src/tunnel.ts
|
|
552
538
|
var import_node_child_process = require("node:child_process");
|
|
553
539
|
function startTunnel(tunnelProcess2, options) {
|
|
540
|
+
if (!process.env.TUNNEL_TOKEN) {
|
|
541
|
+
console.error(
|
|
542
|
+
source_default.red.bold(
|
|
543
|
+
"\u274C Error: TUNNEL_TOKEN environment variable is not set. Please set it to your tunnel token."
|
|
544
|
+
)
|
|
545
|
+
);
|
|
546
|
+
process.exit(1);
|
|
547
|
+
}
|
|
554
548
|
const tunnelDomain = `${options.subdomain || crypto.randomUUID()}.browsermationtunnel.com`;
|
|
555
549
|
tunnelProcess2 = (0, import_node_child_process.spawn)("ssh", [
|
|
556
550
|
"-o",
|
|
@@ -595,12 +589,18 @@ function startTunnel(tunnelProcess2, options) {
|
|
|
595
589
|
|
|
596
590
|
// src/defineConfig.ts
|
|
597
591
|
async function fetchEndpoint() {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
592
|
+
if (!process.env.SERVER_URL) {
|
|
593
|
+
console.error(
|
|
594
|
+
source_default.red.bold("\u274C Error: SERVER_URL environment variable is not set")
|
|
595
|
+
);
|
|
596
|
+
process.exit(1);
|
|
597
|
+
}
|
|
598
|
+
let protocol = import_node_https.default;
|
|
599
|
+
if (process.env.SERVER_URL.startsWith("http:")) {
|
|
600
|
+
protocol = import_node_http.default;
|
|
601
|
+
}
|
|
602
602
|
return new Promise((resolve, reject) => {
|
|
603
|
-
|
|
603
|
+
protocol.get(process.env.SERVER_URL || "", (res) => {
|
|
604
604
|
res.on("data", async (chunk) => {
|
|
605
605
|
try {
|
|
606
606
|
const parsedData = JSON.parse(chunk.toString());
|
|
@@ -638,7 +638,7 @@ async function defineConfig(config) {
|
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
//
|
|
641
|
+
// node_modules/@playwright/test/index.mjs
|
|
642
642
|
var test_exports = {};
|
|
643
643
|
__export(test_exports, {
|
|
644
644
|
default: () => import_test.default
|
|
@@ -648,6 +648,23 @@ var import_test = __toESM(require("playwright/test"), 1);
|
|
|
648
648
|
|
|
649
649
|
// src/test.ts
|
|
650
650
|
var import_node_https2 = __toESM(require("node:https"));
|
|
651
|
+
|
|
652
|
+
// node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
653
|
+
var isProduction = process.env.NODE_ENV === "production";
|
|
654
|
+
var prefix = "Invariant failed";
|
|
655
|
+
function invariant(condition, message) {
|
|
656
|
+
if (condition) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
if (isProduction) {
|
|
660
|
+
throw new Error(prefix);
|
|
661
|
+
}
|
|
662
|
+
var provided = typeof message === "function" ? message() : message;
|
|
663
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
664
|
+
throw new Error(value);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// src/test.ts
|
|
651
668
|
async function fetchEndpoint2() {
|
|
652
669
|
invariant(
|
|
653
670
|
process.env.SERVER_URL,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browsermation/test",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "The testing platform for Playwright by Browsermation.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"typescript": "^5.9.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
+
"@playwright/test": "^1.55.0",
|
|
53
54
|
"archiver": "^7.0.1",
|
|
54
55
|
"axios": "^1.10.0",
|
|
55
56
|
"chalk": "^5.4.1",
|