@auto-wiz/playwright 1.0.1 → 1.1.0

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/dist/runner.js +8 -6
  2. package/package.json +2 -2
package/dist/runner.js CHANGED
@@ -93,18 +93,20 @@ class PlaywrightFlowRunner {
93
93
  case "extract": {
94
94
  const locator = await this.resolveLocator(page, step, timeout);
95
95
  let text = null;
96
- if (step.prop === "outerHTML") {
97
- text = await locator.evaluate((el) => el.outerHTML);
98
- }
99
- else if (step.prop === "value") {
96
+ if (step.prop === "value") {
100
97
  text = await locator.inputValue();
101
98
  }
102
99
  else if (step.prop === "innerText") {
103
100
  text = await locator.innerText({ timeout });
104
101
  }
105
102
  else {
106
- // Default match 'outerHTML' if prop is not specified
107
- text = await locator.evaluate((el) => el.outerHTML);
103
+ // Default match 'outerHTML' if prop is not specified or explicit 'outerHTML'
104
+ text = await locator.evaluate((el) => {
105
+ const clone = el.cloneNode(true);
106
+ const svgs = clone.querySelectorAll("svg");
107
+ svgs.forEach((svg) => svg.remove());
108
+ return clone.outerHTML;
109
+ });
108
110
  }
109
111
  return { success: true, extractedData: text?.trim() };
110
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto-wiz/playwright",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "author": "JaeSang",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "playwright": "^1.40.0",
27
- "@auto-wiz/core": "1.0.1"
27
+ "@auto-wiz/core": "1.1.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "typescript": "^5.0.0",