playwright-ui5 1.1.0 → 1.1.1

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.
@@ -652,39 +652,6 @@ var require_lib = __commonJS({
652
652
  }
653
653
  });
654
654
 
655
- // node_modules/ts-is-present/lib/index.js
656
- var require_lib2 = __commonJS({
657
- "node_modules/ts-is-present/lib/index.js"(exports) {
658
- "use strict";
659
- Object.defineProperty(exports, "__esModule", { value: true });
660
- exports.hasValueAtKey = exports.hasPresentKey = exports.isFilled = exports.isDefined = exports.isPresent = void 0;
661
- function isPresent(t) {
662
- return t !== void 0 && t !== null;
663
- }
664
- exports.isPresent = isPresent;
665
- function isDefined(t) {
666
- return t !== void 0;
667
- }
668
- exports.isDefined = isDefined;
669
- function isFilled2(t) {
670
- return t !== null;
671
- }
672
- exports.isFilled = isFilled2;
673
- function hasPresentKey(k) {
674
- return function(a) {
675
- return a[k] !== void 0 && a[k] !== null;
676
- };
677
- }
678
- exports.hasPresentKey = hasPresentKey;
679
- function hasValueAtKey(k, v) {
680
- return function(a) {
681
- return a[k] === v;
682
- };
683
- }
684
- exports.hasValueAtKey = hasValueAtKey;
685
- }
686
- });
687
-
688
655
  // src/browser/main.ts
689
656
  var main_exports = {};
690
657
  __export(main_exports, {
@@ -692,10 +659,9 @@ __export(main_exports, {
692
659
  });
693
660
  module.exports = __toCommonJS(main_exports);
694
661
  var import_css_selector_parser = __toESM(require_lib());
695
- var import_ts_is_present = __toESM(require_lib2());
696
662
  var parser = new import_css_selector_parser.CssSelectorParser();
697
663
  parser.registerAttrEqualityMods("^", "$", "*", "~", "|");
698
- var queryAll = (_root, selector) => {
664
+ var queryAll = (root, selector) => {
699
665
  const parsedSelector = parser.parse(selector);
700
666
  if (selector === "") {
701
667
  throw new Error("ui5 selector is empty");
@@ -737,7 +703,9 @@ var queryAll = (_root, selector) => {
737
703
  }[attr.operator];
738
704
  });
739
705
  });
740
- return controls.map((control) => control.getDomRef()).filter(import_ts_is_present.isFilled);
706
+ return controls.map((control) => control.getDomRef()).filter(
707
+ (element) => element !== null && root.querySelector(`#${element.id}`) !== null
708
+ );
741
709
  };
742
710
  var main_default = {
743
711
  queryAll,
@@ -1,4 +1,5 @@
1
1
  import { selectors } from 'playwright';
2
- declare const selectorEngine: Parameters<typeof selectors.register>[1];
2
+ export type SelectorEngine = Parameters<typeof selectors.register>[1];
3
+ declare const selectorEngine: SelectorEngine;
3
4
  export default selectorEngine;
4
5
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,QAAA,MAAM,cAAc,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAM5D,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AAErE,QAAA,MAAM,cAAc,EAAE,cAMrB,CAAA;AAED,eAAe,cAAc,CAAA"}
package/dist/node/main.js CHANGED
@@ -4,7 +4,7 @@ const fs_1 = require("fs");
4
4
  const path_1 = require("path");
5
5
  const selectorEngine = {
6
6
  // https://github.com/microsoft/playwright/issues/16705
7
- content: `(() => {${(0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../browser/main.js'), 'utf8')};return module.exports.default})()`,
7
+ content: `(() => {${(0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../dist/browser/main.js'), 'utf8')};return module.exports.default})()`,
8
8
  };
9
9
  exports.default = selectorEngine;
10
10
  //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":";;AAAA,2BAAiC;AACjC,+BAA2B;AAG3B,MAAM,cAAc,GAA6C;IAC7D,uDAAuD;IACvD,OAAO,EAAE,WAAW,IAAA,iBAAY,EAC5B,IAAA,WAAI,EAAC,SAAS,EAAE,oBAAoB,CAAC,EACrC,MAAM,CACT,oCAAoC;CACxC,CAAA;AAED,kBAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":";;AAAA,2BAAiC;AACjC,+BAA2B;AAK3B,MAAM,cAAc,GAAmB;IACnC,uDAAuD;IACvD,OAAO,EAAE,WAAW,IAAA,iBAAY,EAC5B,IAAA,WAAI,EAAC,SAAS,EAAE,4BAA4B,CAAC,EAC7C,MAAM,CACT,oCAAoC;CACxC,CAAA;AAED,kBAAe,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "playwright-ui5",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "files": [
5
5
  "dist",
6
6
  "src/node"
7
7
  ],
8
8
  "main": "dist/node/main.js",
9
9
  "scripts": {
10
- "test": "npm run build && tsc -p tests/tsconfig.json && playwright test",
10
+ "test": "tsc -p tests/tsconfig.json && playwright test",
11
11
  "lint:check": "eslint .",
12
12
  "lint:fix": "npm run lint:check -- --fix",
13
13
  "format:check": "prettier --check .",
@@ -15,8 +15,9 @@
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
+ "typecheck:config-files": "tsc",
18
19
  "build": "rimraf ./dist && npm run build:browser && npm run build:node",
19
- "check": "npm run test && npm run lint:check && npm run format:check",
20
+ "check": "npm run typecheck:config-files && npm run build && npm run test && npm run lint:check && npm run format:check",
20
21
  "setup": "npm ci && playwright install-deps"
21
22
  },
22
23
  "keywords": [],
@@ -28,13 +29,16 @@
28
29
  },
29
30
  "devDependencies": {
30
31
  "@detachhead/eslint-config": "^1.2.0",
32
+ "@detachhead/ts-helpers": "^16.1.0",
31
33
  "@playwright/test": "^1.33.0",
32
34
  "@sapui5/ts-types": "^1.113.0",
33
35
  "@trivago/prettier-plugin-sort-imports": "^4.1.1",
34
36
  "@types/eslint": "^8.4.6",
37
+ "@types/is-ci": "^3.0.0",
35
38
  "@types/node": "^18.16.1",
36
39
  "@types/three": "^0.150.2",
37
40
  "esbuild": "^0.15.5",
41
+ "is-ci": "^3.0.1",
38
42
  "prettier": "^2.8.8",
39
43
  "rimraf": "^3.0.2",
40
44
  "typescript": "^4.7.4"
@@ -43,8 +47,7 @@
43
47
  "css-selector-parser": "^1.4.1",
44
48
  "lodash": "^4.17.21",
45
49
  "playwright": "^1.33.0",
46
- "throw-expression": "^1.0.2",
47
- "ts-is-present": "^1.2.2"
50
+ "throw-expression": "^1.0.2"
48
51
  },
49
52
  "//": "https://github.com/trivago/prettier-plugin-sort-imports/issues/204#issuecomment-1431287240",
50
53
  "overrides": {
package/src/node/main.ts CHANGED
@@ -2,10 +2,12 @@ import { readFileSync } from 'fs'
2
2
  import { join } from 'path'
3
3
  import { selectors } from 'playwright'
4
4
 
5
- const selectorEngine: Parameters<typeof selectors.register>[1] = {
5
+ export type SelectorEngine = Parameters<typeof selectors.register>[1]
6
+
7
+ const selectorEngine: SelectorEngine = {
6
8
  // https://github.com/microsoft/playwright/issues/16705
7
9
  content: `(() => {${readFileSync(
8
- join(__dirname, '../browser/main.js'),
10
+ join(__dirname, '../../dist/browser/main.js'),
9
11
  'utf8',
10
12
  )};return module.exports.default})()`,
11
13
  }
@@ -7,5 +7,6 @@
7
7
  "lib": ["es2021", "dom"], // https://github.com/microsoft/playwright/issues/16707,
8
8
  "rootDir": "../"
9
9
  },
10
- "include": ["**/*.ts"]
10
+ "include": ["**/*.ts"],
11
+ "exclude": []
11
12
  }