playwright-ui5 1.4.0 → 1.5.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 +10 -10
- package/dist/browser/main.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,13 +28,13 @@ test('ui5 example', ({ page }) => {
|
|
|
28
28
|
|
|
29
29
|
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`)
|
|
30
30
|
|
|
31
|
-
| feature | examples
|
|
32
|
-
| ------------------- |
|
|
33
|
-
| type selectors | `sap.m.Button`, `m.Button`, `*`
|
|
34
|
-
| class selectors | n/a
|
|
35
|
-
| attribute selectors | `[text]`, `[text='foo']
|
|
36
|
-
| id selectors | `sap.m.Button#foo`
|
|
37
|
-
| nesting | `sap.m.Table sap.m.Button`,`sap.m.Table > sap.m.Button`
|
|
38
|
-
| pseudo-classes | `sap.m.Table:has(sap.m.Button)`
|
|
39
|
-
| pseudo-elements | `sap.m.DateTimeField::subclass`
|
|
40
|
-
| selector lists | `sap.m.Button,sap.m.Table`
|
|
31
|
+
| feature | examples | suported | notes |
|
|
32
|
+
| ------------------- | ---------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| type selectors | `sap.m.Button`, `m.Button`, `*` | ✔ |
|
|
34
|
+
| class selectors | n/a | n/a | as mentioned above, `.` is treated as part of the control type |
|
|
35
|
+
| attribute selectors | `[text]`, `[text='foo']`, `[text*='foo']` ,`[text~='foo']` | ✔ | `~=` trims leading and trailing whitespace for the whole value instead of matching a whitespace-separated list of values like it does in CSS. |
|
|
36
|
+
| id selectors | `sap.m.Button#foo` | ✔ | you should not use id selectors if the id is generated (eg. `__button1`) as they can change often |
|
|
37
|
+
| 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`) |
|
|
38
|
+
| pseudo-classes | `sap.m.Table:has(sap.m.Button)` | ✔ | only `:has` is supported for now |
|
|
39
|
+
| pseudo-elements | `sap.m.DateTimeField::subclass` | ✔ | `::subclass` will match the specified control type and any subtypes (eg. both `sap.m.DateTimeField` and subtypes like `sap.m.DatePicker`) |
|
|
40
|
+
| selector lists | `sap.m.Button,sap.m.Table` | ✔ |
|
package/dist/browser/main.js
CHANGED
|
@@ -1431,7 +1431,7 @@ var querySelector = (root, selector) => selector.rules.flatMap((rule) => {
|
|
|
1431
1431
|
"^=": actualValue.startsWith(expectedValue),
|
|
1432
1432
|
"$=": actualValue.endsWith(expectedValue),
|
|
1433
1433
|
"*=": actualValue.includes(expectedValue),
|
|
1434
|
-
"~=": actualValue.
|
|
1434
|
+
"~=": actualValue.trim() === expectedValue,
|
|
1435
1435
|
"|=": actualValue.split("-")[0] === expectedValue
|
|
1436
1436
|
}[(0, import_throw_expression.throwIfUndefined)(
|
|
1437
1437
|
attr.operator,
|
|
@@ -1458,7 +1458,7 @@ var querySelector = (root, selector) => selector.rules.flatMap((rule) => {
|
|
|
1458
1458
|
var queryAll = (root, selector) => {
|
|
1459
1459
|
try {
|
|
1460
1460
|
const parsedSelector = parseSelector(selector);
|
|
1461
|
-
if (typeof sap === "undefined") {
|
|
1461
|
+
if (typeof sap === "undefined" || typeof sap.ui === "undefined") {
|
|
1462
1462
|
return [];
|
|
1463
1463
|
}
|
|
1464
1464
|
return querySelector(root, parsedSelector);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ui5",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src/node"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@detachhead/eslint-config": "^1.2.0",
|
|
32
32
|
"@detachhead/ts-helpers": "^16.1.0",
|
|
33
|
-
"@playwright/test": "^1.
|
|
33
|
+
"@playwright/test": "^1.39.0",
|
|
34
34
|
"@sapui5/ts-types": "^1.113.0",
|
|
35
35
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
36
36
|
"@types/eslint": "^8.4.6",
|