@checksum-ai/runtime 1.0.73 → 1.0.75

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksum-ai/runtime",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "Checksum.ai test runtime",
5
5
  "main": "index.js",
6
6
  "dependencies": {
package/scripts/patch.js CHANGED
@@ -1,8 +1,10 @@
1
1
  const fs = require("fs");
2
+ const { join } = require("path");
2
3
 
3
4
  // Args
4
5
  const on = process.argv[2] !== "off";
5
6
  const fromRoot = process.argv[3] === "root";
7
+ const projectRoot = process.env.PROJECT_ROOT ?? "";
6
8
 
7
9
  // Amends the file with the given entry point text and append text
8
10
  // When "on" is true, the append text is added to the entry point,
@@ -85,7 +87,10 @@ function replaceContent(filePath, originalContent, newContent) {
85
87
 
86
88
  // Remove conditions for injecting Playwright scripts
87
89
  function alwaysInjectScripts() {
88
- const file = "node_modules/playwright-core/lib/server/browserContext.js";
90
+ const file = join(
91
+ projectRoot,
92
+ "node_modules/playwright-core/lib/server/browserContext.js"
93
+ );
89
94
  const originalContent =
90
95
  "if ((0, _utils.debugMode)() === 'console') await this.extendInjectedScript(consoleApiSource.source);";
91
96
 
@@ -97,7 +102,10 @@ function alwaysInjectScripts() {
97
102
 
98
103
  // Add implementation for generateSelectorAndLocator and inject to Playwright console API
99
104
  function addGenerateSelectorAndLocator() {
100
- const file = "node_modules/playwright-core/lib/generated/consoleApiSource.js";
105
+ const file = join(
106
+ projectRoot,
107
+ "node_modules/playwright-core/lib/generated/consoleApiSource.js"
108
+ );
101
109
 
102
110
  const entryPointText1 = "this._generateLocator(element, language),\\n ";
103
111
  const appendText1 =