@checksum-ai/runtime 1.0.37 → 1.0.39

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +30 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksum-ai/runtime",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "Checksum.ai test runtime",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -21,5 +21,34 @@ try {
21
21
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
22
22
  } catch (e) {
23
23
  console.log("Failed adding checksum scripts to package.json, ", e);
24
- process.exit(1);
25
24
  }
25
+
26
+ async function installPlaywright() {
27
+ try {
28
+ function run() {
29
+ return new Promise((resolve, reject) => {
30
+ exec("npx playwright install", (error, stdout, stderr) => {
31
+ if (error) {
32
+ reject(`Error: ${error.message}`);
33
+ return;
34
+ }
35
+ if (stderr) {
36
+ reject(`Stderr: ${stderr}`);
37
+ return;
38
+ }
39
+ resolve(stdout);
40
+ });
41
+ });
42
+ }
43
+
44
+ console.log("Installing playwright");
45
+ await run();
46
+ console.log("Playwright installed successfully");
47
+ } catch (e) {
48
+ console.error("Playwright installation failed", error);
49
+ }
50
+ }
51
+
52
+ (async () => {
53
+ await installPlaywright();
54
+ })();