@flowriki/agent 0.1.0-beta.26 → 0.1.0-beta.27
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.
|
@@ -6,7 +6,7 @@ import os from "os";
|
|
|
6
6
|
import path from "path";
|
|
7
7
|
import { createRequire } from "module";
|
|
8
8
|
import { spawnSync } from "child_process";
|
|
9
|
-
var AGENT_VERSION = "0.1.0-beta.
|
|
9
|
+
var AGENT_VERSION = "0.1.0-beta.27";
|
|
10
10
|
async function prepareBrowsers() {
|
|
11
11
|
if (browsersReady()) {
|
|
12
12
|
return { ok: true, already: true, message: "chromium is already installed" };
|
|
@@ -4095,6 +4095,11 @@ async function locateCandidates(page, step, opts = {}) {
|
|
|
4095
4095
|
async function locateAll(page, step, opts = {}) {
|
|
4096
4096
|
return fromPlan(page, step, locatorPlan(step), opts);
|
|
4097
4097
|
}
|
|
4098
|
+
var ICON_GLYPHS = "[\\s\\uE000-\\uF8FF\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}]*";
|
|
4099
|
+
function nameIgnoringIcons(name) {
|
|
4100
|
+
const escaped = name.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+");
|
|
4101
|
+
return new RegExp(`^${ICON_GLYPHS}${escaped}${ICON_GLYPHS}$`, "u");
|
|
4102
|
+
}
|
|
4098
4103
|
async function fromPlan(page, step, plan, opts = {}) {
|
|
4099
4104
|
let root = rootFor(page, step);
|
|
4100
4105
|
if ((step.scope || step.scopeRole) && !plan.overridden) {
|
|
@@ -4112,7 +4117,7 @@ async function fromPlan(page, step, plan, opts = {}) {
|
|
|
4112
4117
|
loc = root.getByTestId(plan.arg);
|
|
4113
4118
|
break;
|
|
4114
4119
|
case "getByText":
|
|
4115
|
-
loc = root.getByText(plan.arg, { exact: plan.exact });
|
|
4120
|
+
loc = root.getByText(plan.exact ? nameIgnoringIcons(plan.arg) : plan.arg, { exact: plan.exact });
|
|
4116
4121
|
break;
|
|
4117
4122
|
case "getByLabel":
|
|
4118
4123
|
loc = root.getByLabel(plan.arg, { exact: true });
|
|
@@ -4127,7 +4132,12 @@ async function fromPlan(page, step, plan, opts = {}) {
|
|
|
4127
4132
|
loc = root.getByTitle(plan.arg, { exact: true });
|
|
4128
4133
|
break;
|
|
4129
4134
|
case "getByRole":
|
|
4130
|
-
loc = root.getByRole(plan.arg, {
|
|
4135
|
+
loc = root.getByRole(plan.arg, {
|
|
4136
|
+
// Unchanged when there is no name to match, or an empty one.
|
|
4137
|
+
name: plan.name ? nameIgnoringIcons(plan.name) : plan.name,
|
|
4138
|
+
exact: true,
|
|
4139
|
+
includeHidden: opts.includeHidden
|
|
4140
|
+
});
|
|
4131
4141
|
break;
|
|
4132
4142
|
case "none":
|
|
4133
4143
|
if (opts.allowRoleOnly && step.role) {
|
package/dist/cli.js
CHANGED
package/dist/engine.js
CHANGED
package/package.json
CHANGED