playwright-ui5 1.5.0 → 1.6.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 +100 -5
- package/dist/browser/css.js +1166 -0
- package/dist/browser/xpath.js +29155 -0
- package/dist/node/main.d.ts +14 -2
- package/dist/node/main.d.ts.map +1 -1
- package/dist/node/main.js +10 -4
- package/dist/node/main.js.map +1 -1
- package/package.json +19 -12
- package/src/node/main.ts +10 -4
- package/dist/browser/main.js +0 -1474
package/dist/node/main.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { selectors } from 'playwright-core';
|
|
2
2
|
export type SelectorEngine = Parameters<typeof selectors.register>[1];
|
|
3
|
-
declare const
|
|
4
|
-
|
|
3
|
+
export declare const css: string | Function | {
|
|
4
|
+
path?: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const xpath: string | Function | {
|
|
8
|
+
path?: string;
|
|
9
|
+
content?: string;
|
|
10
|
+
};
|
|
11
|
+
/** @deprecated the default import is deprecated. explicitly import either the css or xpath selector engine instead */
|
|
12
|
+
declare const cssSelectorEngine: string | Function | {
|
|
13
|
+
path?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
};
|
|
16
|
+
export default cssSelectorEngine;
|
|
5
17
|
//# sourceMappingURL=main.d.ts.map
|
package/dist/node/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AAUrE,eAAO,MAAM,GAAG;;;CAAwB,CAAA;AACxC,eAAO,MAAM,KAAK;;;CAA0B,CAAA;AAE5C,sHAAsH;AACtH,QAAA,MAAM,iBAAiB;;;CAAM,CAAA;AAE7B,eAAe,iBAAiB,CAAA"}
|
package/dist/node/main.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.xpath = exports.css = void 0;
|
|
3
4
|
const fs_1 = require("fs");
|
|
4
5
|
const path_1 = require("path");
|
|
5
|
-
const selectorEngine = {
|
|
6
|
+
const selectorEngine = (fileName) => ({
|
|
6
7
|
// https://github.com/microsoft/playwright/issues/16705
|
|
7
|
-
content: `(() => {${(0, fs_1.readFileSync)((0, path_1.join)(__dirname,
|
|
8
|
-
};
|
|
9
|
-
exports.
|
|
8
|
+
content: `(() => {${(0, fs_1.readFileSync)((0, path_1.join)(__dirname, `../../dist/browser/${fileName}.js`), 'utf8')};return module.exports.default})()`,
|
|
9
|
+
});
|
|
10
|
+
exports.css = selectorEngine('css');
|
|
11
|
+
exports.xpath = selectorEngine('xpath');
|
|
12
|
+
/** @deprecated the default import is deprecated. explicitly import either the css or xpath selector engine instead */
|
|
13
|
+
const cssSelectorEngine = exports.css;
|
|
14
|
+
// eslint-disable-next-line detachhead/suggestions-as-errors -- deprecated usage, unfortunately you can't declare and export a default const in the same line
|
|
15
|
+
exports.default = cssSelectorEngine;
|
|
10
16
|
//# sourceMappingURL=main.js.map
|
package/dist/node/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":";;;AAAA,2BAAiC;AACjC,+BAA2B;AAK3B,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAkB,EAAE,CAAC,CAAC;IAC1D,uDAAuD;IACvD,OAAO,EAAE,WAAW,IAAA,iBAAY,EAC5B,IAAA,WAAI,EAAC,SAAS,EAAE,sBAAsB,QAAQ,KAAK,CAAC,EACpD,MAAM,CACT,oCAAoC;CACxC,CAAC,CAAA;AAEW,QAAA,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;AAC3B,QAAA,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AAE5C,sHAAsH;AACtH,MAAM,iBAAiB,GAAG,WAAG,CAAA;AAC7B,6JAA6J;AAC7J,kBAAe,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ui5",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src/node"
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"lint:fix": "npm run lint:check -- --fix",
|
|
13
13
|
"format:check": "prettier --check .",
|
|
14
14
|
"format:fix": "prettier --write .",
|
|
15
|
-
"
|
|
16
|
-
"build:browser": "npm run _esbuild -- --format=cjs --outdir=dist/browser",
|
|
15
|
+
"build:browser": "tsc -p src/browser/tsconfig.json && esbuild src/browser/css.ts --bundle --define:global=window --format=cjs --outdir=dist/browser && esbuild src/browser/xpath.ts --bundle --define:global=window --format=cjs --outdir=dist/browser",
|
|
17
16
|
"build:node": "tsc -p src/node/tsconfig.json",
|
|
18
17
|
"typecheck:config-files": "tsc",
|
|
19
18
|
"build": "rimraf ./dist && npm run build:browser && npm run build:node",
|
|
@@ -28,33 +27,41 @@
|
|
|
28
27
|
"url": "https://github.com/DetachHead/playwright-ui5.git"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@detachhead/eslint-config": "^1.
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@sapui5/ts-types": "^1.113.0",
|
|
30
|
+
"@detachhead/eslint-config": "^1.5.0",
|
|
31
|
+
"@playwright/test": "^1.43.0",
|
|
32
|
+
"@sapui5/ts-types-esm": "^1.123.1",
|
|
35
33
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
36
34
|
"@types/eslint": "^8.4.6",
|
|
37
35
|
"@types/is-ci": "^3.0.0",
|
|
38
|
-
"@types/
|
|
36
|
+
"@types/lodash": "^4.17.0",
|
|
37
|
+
"@types/node": "^20.12.6",
|
|
39
38
|
"@types/three": "^0.150.2",
|
|
40
39
|
"esbuild": "^0.15.5",
|
|
41
40
|
"is-ci": "^3.0.1",
|
|
42
41
|
"prettier": "^2.8.8",
|
|
43
42
|
"rimraf": "^3.0.2",
|
|
44
|
-
"typescript": "
|
|
43
|
+
"typescript": "5.5.0-dev.20240429"
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
47
46
|
"css-selector-parser": "^2",
|
|
47
|
+
"fontoxpath": "^3.30.3",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
|
-
"playwright-core": "^1.
|
|
50
|
-
"throw-expression": "^1.0.2"
|
|
49
|
+
"playwright-core": "^1.43.0",
|
|
50
|
+
"throw-expression": "^1.0.2",
|
|
51
|
+
"xmlbuilder2": "^3.1.1"
|
|
51
52
|
},
|
|
52
|
-
"//":
|
|
53
|
+
"//": [
|
|
54
|
+
"https://github.com/trivago/prettier-plugin-sort-imports/issues/204#issuecomment-1431287240",
|
|
55
|
+
"https://github.com/DetachHead/eslint-plugin-detachhead/blob/master/docs/rules/suggestions-as-errors.md#troubleshooting"
|
|
56
|
+
],
|
|
53
57
|
"overrides": {
|
|
54
58
|
"@trivago/prettier-plugin-sort-imports": {
|
|
55
59
|
"@babel/core": "7.20.12",
|
|
56
60
|
"@babel/parser": "7.20.15",
|
|
57
61
|
"@babel/traverse": "7.20.13"
|
|
62
|
+
},
|
|
63
|
+
"typescript": {
|
|
64
|
+
".": "5.5.0-dev.20240429"
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
}
|
package/src/node/main.ts
CHANGED
|
@@ -4,12 +4,18 @@ import { selectors } from 'playwright-core'
|
|
|
4
4
|
|
|
5
5
|
export type SelectorEngine = Parameters<typeof selectors.register>[1]
|
|
6
6
|
|
|
7
|
-
const selectorEngine: SelectorEngine
|
|
7
|
+
const selectorEngine = (fileName: string): SelectorEngine => ({
|
|
8
8
|
// https://github.com/microsoft/playwright/issues/16705
|
|
9
9
|
content: `(() => {${readFileSync(
|
|
10
|
-
join(__dirname,
|
|
10
|
+
join(__dirname, `../../dist/browser/${fileName}.js`),
|
|
11
11
|
'utf8',
|
|
12
12
|
)};return module.exports.default})()`,
|
|
13
|
-
}
|
|
13
|
+
})
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export const css = selectorEngine('css')
|
|
16
|
+
export const xpath = selectorEngine('xpath')
|
|
17
|
+
|
|
18
|
+
/** @deprecated the default import is deprecated. explicitly import either the css or xpath selector engine instead */
|
|
19
|
+
const cssSelectorEngine = css
|
|
20
|
+
// eslint-disable-next-line detachhead/suggestions-as-errors -- deprecated usage, unfortunately you can't declare and export a default const in the same line
|
|
21
|
+
export default cssSelectorEngine
|