playwright-ui5 1.0.0 → 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.
- package/README.md +8 -10
- package/dist/browser/main.js +4 -0
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -25,13 +25,11 @@ selectors.register('ui5', ui5)
|
|
|
25
25
|
|
|
26
26
|
this selector engine uses css selector-like syntax. the main difference is that `.` is not used for class names, rather they are treated as part of the type name (ie. `sap.m.Button`)
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
| nesting | `sap.m.Table sap.m.Button`,`sap.m.Table > sap.m.Button` | ❌ |use playwright selector nesting instead (`ui5=sap.m.Table >> ui5=sap.m.Button`)
|
|
37
|
-
| pseudo-classes | `sap.m.Table:has(sap.m.Button)` | ❌ |
|
|
28
|
+
| feature | examples | suported | notes |
|
|
29
|
+
| ------------------- | ------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| type selectors | `sap.m.Button`, `m.Button`, `*` | ✔ |
|
|
31
|
+
| class selectors | n/a | n/a | as mentioned above, `.` is treated as part of the control type |
|
|
32
|
+
| attribute selectors | `[text]`, `[text='foo']`,`[text*='foo']` | ✔ | some equality mods are useless for ui5 (eg. `\|=`) but are supported for the sake of completeness |
|
|
33
|
+
| id selectors | `sap.m.Button#foo` | ✔ | you should not use id selectors if the id is generated (eg. `__button1`) as they can change often |
|
|
34
|
+
| nesting | `sap.m.Table sap.m.Button`,`sap.m.Table > sap.m.Button` | ❌ | use playwright selector nesting instead (`ui5=sap.m.Table >> ui5=sap.m.Button`) |
|
|
35
|
+
| pseudo-classes | `sap.m.Table:has(sap.m.Button)` | ❌ |
|
package/dist/browser/main.js
CHANGED
|
@@ -705,6 +705,10 @@ var queryAll = (_root, selector) => {
|
|
|
705
705
|
}
|
|
706
706
|
const { rule } = parsedSelector;
|
|
707
707
|
if (rule.tagName && rule.classNames) {
|
|
708
|
+
const sapNamespace = "sap";
|
|
709
|
+
if (rule.tagName !== sapNamespace) {
|
|
710
|
+
rule.tagName = `${sapNamespace}.${rule.tagName}`;
|
|
711
|
+
}
|
|
708
712
|
rule.tagName = [rule.tagName, ...rule.classNames].join(".");
|
|
709
713
|
delete rule.classNames;
|
|
710
714
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ui5",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src/node"
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
"main": "dist/node/main.js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "npm run build && tsc -p tests/tsconfig.json && playwright test",
|
|
11
|
-
"lint:check": "eslint .
|
|
11
|
+
"lint:check": "eslint .",
|
|
12
12
|
"lint:fix": "npm run lint:check -- --fix",
|
|
13
13
|
"format:check": "prettier --check .",
|
|
14
14
|
"format:fix": "prettier --write .",
|
|
15
15
|
"_esbuild": "tsc -p src/browser/tsconfig.json && esbuild src/browser/main.ts --bundle --define:global=window",
|
|
16
16
|
"build:browser": "npm run _esbuild -- --format=cjs --outdir=dist/browser",
|
|
17
17
|
"build:node": "tsc -p src/node/tsconfig.json",
|
|
18
|
-
"debug": "npm run _esbuild -- --format=esm --outdir=debug/dist/browser --servedir=debug",
|
|
19
18
|
"build": "rimraf ./dist && npm run build:browser && npm run build:node",
|
|
20
19
|
"check": "npm run test && npm run lint:check && npm run format:check",
|
|
21
20
|
"setup": "npm ci && playwright install-deps"
|
|
@@ -47,12 +46,12 @@
|
|
|
47
46
|
"throw-expression": "^1.0.2",
|
|
48
47
|
"ts-is-present": "^1.2.2"
|
|
49
48
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
"//": "https://github.com/trivago/prettier-plugin-sort-imports/issues/204#issuecomment-1431287240",
|
|
50
|
+
"overrides": {
|
|
51
|
+
"@trivago/prettier-plugin-sort-imports": {
|
|
52
|
+
"@babel/core": "7.20.12",
|
|
53
|
+
"@babel/parser": "7.20.15",
|
|
54
|
+
"@babel/traverse": "7.20.13"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
58
57
|
}
|