@thinkwise/testwise 0.1.97 → 0.2.0-beta.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/Testwise.ts +8 -13
- package/artifact-builder/ArtifactManager.ts +34 -0
- package/artifact-builder/InterfaceGenerator.ts +183 -0
- package/artifact-builder/ModelDataBuilder.ts +177 -0
- package/artifact-builder/ModelDataRefiner.ts +38 -0
- package/artifact-builder/SchemaGenerator.ts +134 -0
- package/artifact-builder/ScreenInterfaceRefiner.ts +159 -0
- package/artifact-builder/SelectorBuilder.ts +82 -0
- package/artifact-builder/SubjectComponentGenerator.ts +186 -0
- package/artifact-builder/SubjectGenerator.ts +332 -0
- package/artifact-builder/SubjectRegistration.ts +136 -0
- package/artifact-builder/helpers/DataRetriever.ts +64 -0
- package/artifact-builder/helpers/NamingHandler.ts +180 -0
- package/artifact-builder/helpers/index.ts +2 -0
- package/artifact-builder/index.ts +9 -0
- package/components/{actionbar/Actionbar.ts → action-bar/ActionBar.ts} +12 -12
- package/components/{actionbar/ActionbarObjects.ts → action-bar/ActionBarObjects.ts} +4 -4
- package/components/{actionbar → action-bar}/CustomActionBar.ts +2 -2
- package/components/index.ts +3 -4
- package/components/tab/DetailTabPage.ts +20 -0
- package/components/tab/{DetailTabObjects.ts → DetailTabPageObjects.ts} +1 -1
- package/components/tab/Tab.ts +31 -5
- package/components/tab/TabObjects.ts +15 -3
- package/dist/Testwise.d.ts +0 -1
- package/dist/Testwise.js +7 -14
- package/dist/Testwise.js.map +1 -1
- package/dist/artifact-builder/ArtifactManager.d.ts +8 -0
- package/dist/artifact-builder/ArtifactManager.js +27 -0
- package/dist/artifact-builder/ArtifactManager.js.map +1 -0
- package/dist/artifact-builder/InterfaceGenerator.d.ts +16 -0
- package/dist/artifact-builder/InterfaceGenerator.js +134 -0
- package/dist/artifact-builder/InterfaceGenerator.js.map +1 -0
- package/dist/artifact-builder/ModelDataBuilder.d.ts +2 -0
- package/dist/artifact-builder/ModelDataBuilder.js +128 -0
- package/dist/artifact-builder/ModelDataBuilder.js.map +1 -0
- package/dist/artifact-builder/ModelDataRefiner.d.ts +4 -0
- package/dist/artifact-builder/ModelDataRefiner.js +28 -0
- package/dist/artifact-builder/ModelDataRefiner.js.map +1 -0
- package/dist/artifact-builder/SchemaGenerator.d.ts +12 -0
- package/dist/artifact-builder/SchemaGenerator.js +104 -0
- package/dist/artifact-builder/SchemaGenerator.js.map +1 -0
- package/dist/artifact-builder/ScreenInterfaceRefiner.d.ts +15 -0
- package/dist/artifact-builder/ScreenInterfaceRefiner.js +125 -0
- package/dist/artifact-builder/ScreenInterfaceRefiner.js.map +1 -0
- package/dist/artifact-builder/SelectorBuilder.d.ts +13 -0
- package/dist/artifact-builder/SelectorBuilder.js +69 -0
- package/dist/artifact-builder/SelectorBuilder.js.map +1 -0
- package/dist/artifact-builder/SubjectComponentGenerator.d.ts +23 -0
- package/dist/artifact-builder/SubjectComponentGenerator.js +136 -0
- package/dist/artifact-builder/SubjectComponentGenerator.js.map +1 -0
- package/dist/artifact-builder/SubjectGenerator.d.ts +27 -0
- package/dist/artifact-builder/SubjectGenerator.js +235 -0
- package/dist/artifact-builder/SubjectGenerator.js.map +1 -0
- package/dist/artifact-builder/SubjectRegistration.d.ts +22 -0
- package/dist/artifact-builder/SubjectRegistration.js +96 -0
- package/dist/artifact-builder/SubjectRegistration.js.map +1 -0
- package/dist/artifact-builder/helpers/DataRetriever.d.ts +12 -0
- package/dist/artifact-builder/helpers/DataRetriever.js +52 -0
- package/dist/artifact-builder/helpers/DataRetriever.js.map +1 -0
- package/dist/artifact-builder/helpers/NamingHandler.d.ts +24 -0
- package/dist/artifact-builder/helpers/NamingHandler.js +145 -0
- package/dist/artifact-builder/helpers/NamingHandler.js.map +1 -0
- package/dist/artifact-builder/helpers/index.d.ts +2 -0
- package/dist/artifact-builder/helpers/index.js +3 -0
- package/dist/artifact-builder/helpers/index.js.map +1 -0
- package/dist/artifact-builder/index.d.ts +9 -0
- package/dist/artifact-builder/index.js +10 -0
- package/dist/artifact-builder/index.js.map +1 -0
- package/dist/components/{actionbar/Actionbar.d.ts → action-bar/ActionBar.d.ts} +4 -4
- package/dist/components/{actionbar/Actionbar.js → action-bar/ActionBar.js} +9 -9
- package/dist/components/action-bar/ActionBar.js.map +1 -0
- package/dist/components/{actionbar/ActionbarObjects.d.ts → action-bar/ActionBarObjects.d.ts} +2 -2
- package/dist/components/{actionbar/ActionbarObjects.js → action-bar/ActionBarObjects.js} +5 -5
- package/dist/components/action-bar/ActionBarObjects.js.map +1 -0
- package/dist/components/{actionbar → action-bar}/CustomActionBar.d.ts +2 -2
- package/dist/components/action-bar/CustomActionBar.js +7 -0
- package/dist/components/action-bar/CustomActionBar.js.map +1 -0
- package/dist/components/index.d.ts +3 -4
- package/dist/components/index.js +3 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/tab/DetailTabPage.d.ts +9 -0
- package/dist/components/tab/DetailTabPage.js +15 -0
- package/dist/components/tab/DetailTabPage.js.map +1 -0
- package/dist/components/tab/{DetailTabObjects.d.ts → DetailTabPageObjects.d.ts} +1 -1
- package/dist/components/tab/{DetailTabObjects.js → DetailTabPageObjects.js} +2 -2
- package/dist/components/tab/DetailTabPageObjects.js.map +1 -0
- package/dist/components/tab/Tab.d.ts +8 -3
- package/dist/components/tab/Tab.js +25 -4
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/tab/TabObjects.d.ts +7 -2
- package/dist/components/tab/TabObjects.js +9 -2
- package/dist/components/tab/TabObjects.js.map +1 -1
- package/dist/enums/ElementTypes.d.ts +8 -0
- package/dist/enums/ElementTypes.js +10 -0
- package/dist/enums/ElementTypes.js.map +1 -0
- package/dist/helpers/PathResolver.d.ts +3 -0
- package/dist/helpers/PathResolver.js +26 -0
- package/dist/helpers/PathResolver.js.map +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IProperty.d.ts +4 -0
- package/dist/interfaces/IProperty.js +2 -0
- package/dist/interfaces/IProperty.js.map +1 -0
- package/dist/interfaces/IRegisteredSubjects.d.ts +5 -0
- package/dist/interfaces/IRegisteredSubjects.js +2 -0
- package/dist/interfaces/IRegisteredSubjects.js.map +1 -0
- package/dist/interfaces/ISubject.d.ts +8 -0
- package/dist/interfaces/ISubject.js +2 -0
- package/dist/interfaces/ISubject.js.map +1 -0
- package/dist/page-extensions/SubjectProvider.d.ts +11 -0
- package/dist/page-extensions/SubjectProvider.js +24 -0
- package/dist/page-extensions/SubjectProvider.js.map +1 -0
- package/dist/page-extensions/SubjectRegistry.d.ts +14 -0
- package/dist/page-extensions/SubjectRegistry.js +14 -0
- package/dist/page-extensions/SubjectRegistry.js.map +1 -0
- package/dist/page-extensions/index.d.ts +3 -0
- package/dist/page-extensions/index.js +3 -0
- package/dist/page-extensions/index.js.map +1 -1
- package/dist/services/ConfigBuilder.d.ts +1 -0
- package/dist/services/ConfigBuilder.js +20 -1
- package/dist/services/ConfigBuilder.js.map +1 -1
- package/dist/test-artifacts/SubjectPageBase.d.ts +5 -0
- package/dist/test-artifacts/SubjectPageBase.js +6 -0
- package/dist/test-artifacts/SubjectPageBase.js.map +1 -0
- package/dist/test-artifacts/index.d.ts +3 -0
- package/dist/test-artifacts/index.js +4 -0
- package/dist/test-artifacts/index.js.map +1 -0
- package/dist/test-artifacts/screens/index.d.ts +1 -0
- package/dist/test-artifacts/screens/index.js +2 -0
- package/dist/test-artifacts/screens/index.js.map +1 -0
- package/dist/test-artifacts/subjects/index.d.ts +1 -0
- package/dist/test-artifacts/subjects/index.js +2 -0
- package/dist/test-artifacts/subjects/index.js.map +1 -0
- package/dist/types/Components.d.ts +7 -0
- package/dist/types/Components.js +28 -0
- package/dist/types/Components.js.map +1 -0
- package/enums/ElementTypes.ts +8 -0
- package/helpers/PathResolver.ts +30 -0
- package/helpers/index.ts +1 -0
- package/index.ts +1 -0
- package/interfaces/IProperty.ts +4 -0
- package/interfaces/IRegisteredSubjects.ts +5 -0
- package/interfaces/ISubject.ts +9 -0
- package/package.json +26 -9
- package/page-extensions/SubjectProvider.ts +41 -0
- package/page-extensions/SubjectRegistry.ts +30 -0
- package/page-extensions/index.ts +3 -0
- package/promptCredentials.js +124 -124
- package/scripts/Testwise.template.json +4 -1
- package/scripts/main.js +75 -4
- package/scripts/postinstall.js +42 -0
- package/scripts/setup.js +17 -14
- package/scripts/sync.js +69 -0
- package/scripts/tsconfig.template.json +1 -1
- package/services/ConfigBuilder.ts +25 -2
- package/test-artifacts/SubjectPageBase.ts +9 -0
- package/test-artifacts/index.ts +3 -0
- package/test-artifacts/screens/index.ts +0 -0
- package/test-artifacts/subjects/index.ts +0 -0
- package/tsconfig.json +1 -1
- package/types/Components.ts +55 -0
- package/components/tab/ComponentTab.ts +0 -40
- package/components/tab/ComponentTabObjects.ts +0 -17
- package/components/tab/DetailTab.ts +0 -20
- package/dist/Testwise.json +0 -25
- package/dist/bdd.d.ts +0 -6
- package/dist/bdd.js +0 -9
- package/dist/bdd.js.map +0 -1
- package/dist/biome.json +0 -52
- package/dist/components/actionbar/Actionbar.js.map +0 -1
- package/dist/components/actionbar/ActionbarObjects.js.map +0 -1
- package/dist/components/actionbar/CustomActionBar.js +0 -7
- package/dist/components/actionbar/CustomActionBar.js.map +0 -1
- package/dist/components/tab/ComponentTab.d.ts +0 -12
- package/dist/components/tab/ComponentTab.js +0 -31
- package/dist/components/tab/ComponentTab.js.map +0 -1
- package/dist/components/tab/ComponentTabObjects.d.ts +0 -8
- package/dist/components/tab/ComponentTabObjects.js +0 -11
- package/dist/components/tab/ComponentTabObjects.js.map +0 -1
- package/dist/components/tab/DetailTab.d.ts +0 -9
- package/dist/components/tab/DetailTab.js +0 -15
- package/dist/components/tab/DetailTab.js.map +0 -1
- package/dist/components/tab/DetailTabObjects.js.map +0 -1
- package/dist/helpers/TestExtensions.d.ts +0 -8
- package/dist/helpers/TestExtensions.js +0 -21
- package/dist/helpers/TestExtensions.js.map +0 -1
- package/dist/package-lock.json +0 -3852
- package/dist/package.json +0 -59
- package/dist/scripts/Testwise.template.json +0 -25
- package/dist/scripts/tsconfig.template.json +0 -12
- package/dist/services/ReportingService.d.ts +0 -8
- package/dist/services/ReportingService.js +0 -29
- package/dist/services/ReportingService.js.map +0 -1
- package/dist/tsconfig.json +0 -20
- package/services/ReportingService.ts +0 -37
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export class PathResolver {
|
|
4
|
+
getConsumerRootDirectory() {
|
|
5
|
+
let directory = process.cwd();
|
|
6
|
+
let lastDir = '';
|
|
7
|
+
let found = false;
|
|
8
|
+
while (directory !== lastDir) {
|
|
9
|
+
const pkgPath = path.join(directory, 'package.json');
|
|
10
|
+
if (fs.existsSync(pkgPath)) {
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
12
|
+
if (pkg.name !== '@thinkwise/testwise') {
|
|
13
|
+
found = true;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
lastDir = directory;
|
|
18
|
+
directory = path.dirname(directory);
|
|
19
|
+
}
|
|
20
|
+
if (!found) {
|
|
21
|
+
directory = process.cwd();
|
|
22
|
+
}
|
|
23
|
+
return directory;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PathResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathResolver.js","sourceRoot":"","sources":["../../helpers/PathResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,YAAY;IAChB,wBAAwB;QAC7B,IAAI,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC9B,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,GAAG,KAAK,CAAC;QAElB,OAAO,SAAS,KAAK,OAAO,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YAErD,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC1D,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;oBACvC,KAAK,GAAG,IAAI,CAAC;oBACb,MAAM;gBACR,CAAC;YACH,CAAC;YAED,OAAO,GAAG,SAAS,CAAC;YACpB,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const originalDebug: {
|
|
|
19
19
|
(message?: any, ...optionalParams: any[]): void;
|
|
20
20
|
};
|
|
21
21
|
export { originalLog, originalInfo, originalWarn, originalError, originalDebug };
|
|
22
|
+
export * from './artifact-builder/index.js';
|
|
22
23
|
export * from './components/index.js';
|
|
23
24
|
export * from './controls/index.js';
|
|
24
25
|
export * from './enums/index.js';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ console.warn = (...args) => logger.warn(args.join(' '));
|
|
|
10
10
|
console.error = (...args) => logger.error(args.join(' '));
|
|
11
11
|
console.debug = (...args) => logger.debug(args.join(' '));
|
|
12
12
|
export { originalLog, originalInfo, originalWarn, originalError, originalDebug };
|
|
13
|
+
export * from './artifact-builder/index.js';
|
|
13
14
|
export * from './components/index.js';
|
|
14
15
|
export * from './controls/index.js';
|
|
15
16
|
export * from './enums/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;AAChC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AACpC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AAEpC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AACjF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;AAChC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;AAClC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AACpC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AAEpC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AACjF,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IProperty.js","sourceRoot":"","sources":["../../interfaces/IProperty.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRegisteredSubjects.js","sourceRoot":"","sources":["../../interfaces/IRegisteredSubjects.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISubject.js","sourceRoot":"","sources":["../../interfaces/ISubject.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Test } from '../types/Test.js';
|
|
2
|
+
declare module '@playwright/test' {
|
|
3
|
+
interface Page {
|
|
4
|
+
get: <T>(ctor: new (page: Page) => T) => T;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export declare class SubjectProvider {
|
|
8
|
+
private _test;
|
|
9
|
+
constructor(test: Test);
|
|
10
|
+
get test(): Test;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class Get {
|
|
2
|
+
constructor(page) {
|
|
3
|
+
this._page = page;
|
|
4
|
+
}
|
|
5
|
+
getSubject(ctor) {
|
|
6
|
+
return new ctor(this._page);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class SubjectProvider {
|
|
10
|
+
constructor(test) {
|
|
11
|
+
this._test = test.extend({
|
|
12
|
+
page: async ({ page }, use) => {
|
|
13
|
+
const getInstance = new Get(page);
|
|
14
|
+
page.get = getInstance.getSubject.bind(getInstance);
|
|
15
|
+
// page.subject definition goes here
|
|
16
|
+
await use(page);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
get test() {
|
|
21
|
+
return this._test;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=SubjectProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubjectProvider.js","sourceRoot":"","sources":["../../page-extensions/SubjectProvider.ts"],"names":[],"mappings":"AAGA,MAAM,GAAG;IAGP,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,UAAU,CAAI,IAA2B;QACvC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACF;AAQD,MAAM,OAAO,eAAe;IAG1B,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClC,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAEpD,oCAAoC;gBAEpC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Test } from '../types/Test.js';
|
|
2
|
+
export type SubjectType = {
|
|
3
|
+
none: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare module '@playwright/test' {
|
|
6
|
+
interface Page {
|
|
7
|
+
subject: SubjectType;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class SubjectRegistry {
|
|
11
|
+
private _test;
|
|
12
|
+
constructor(test: Test);
|
|
13
|
+
get test(): Test;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class SubjectRegistry {
|
|
2
|
+
constructor(test) {
|
|
3
|
+
this._test = test.extend({
|
|
4
|
+
page: async ({ page }, use) => {
|
|
5
|
+
page.subject = {};
|
|
6
|
+
await use(page);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
get test() {
|
|
11
|
+
return this._test;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SubjectRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubjectRegistry.js","sourceRoot":"","sources":["../../page-extensions/SubjectRegistry.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,eAAe;IAG1B,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,IAAI,CAAC,OAAO,GAAG,EAAiB,CAAC;gBAEjC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './GlobalComponents.js';
|
|
2
2
|
export * from './GoToDeepLink.js';
|
|
3
3
|
export * from './LoginFeatures.js';
|
|
4
|
+
export * from './SubjectProvider.js';
|
|
5
|
+
export * from './SubjectRegistry.js';
|
|
4
6
|
export * from './UserSimulation.js';
|
|
7
|
+
export * from './WaitEventHandler.js';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from './GlobalComponents.js';
|
|
2
2
|
export * from './GoToDeepLink.js';
|
|
3
3
|
export * from './LoginFeatures.js';
|
|
4
|
+
export * from './SubjectProvider.js';
|
|
5
|
+
export * from './SubjectRegistry.js';
|
|
4
6
|
export * from './UserSimulation.js';
|
|
7
|
+
export * from './WaitEventHandler.js';
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../page-extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../page-extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
4
|
class ConfigBuilder {
|
|
5
5
|
constructor() {
|
|
6
|
+
this.config = null;
|
|
6
7
|
const baseDir = process.env.INIT_CWD || process.cwd();
|
|
7
8
|
const configFilePath = path.resolve(baseDir, 'Testwise.json');
|
|
8
9
|
// Find all env files in the consuming project and apply them to process.env
|
|
@@ -12,17 +13,35 @@ class ConfigBuilder {
|
|
|
12
13
|
Object.assign(process.env, envConfig);
|
|
13
14
|
}
|
|
14
15
|
if (!fs.existsSync(configFilePath)) {
|
|
15
|
-
|
|
16
|
+
console.warn(`Config file not found at path: ${configFilePath}`);
|
|
17
|
+
return;
|
|
16
18
|
}
|
|
17
19
|
const fileContent = fs.readFileSync(configFilePath, 'utf-8');
|
|
18
20
|
this.config = JSON.parse(fileContent);
|
|
19
21
|
}
|
|
22
|
+
async load() {
|
|
23
|
+
const baseDir = process.env.INIT_CWD || process.cwd();
|
|
24
|
+
const configFilePath = path.resolve(baseDir, 'Testwise.json');
|
|
25
|
+
if (!fs.existsSync(configFilePath)) {
|
|
26
|
+
console.warn(`Config file not found at path: ${configFilePath}`);
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
const fileContent = fs.readFileSync(configFilePath, 'utf-8');
|
|
30
|
+
this.config = JSON.parse(fileContent);
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* Retrieves a value from the config using a dot-separated key.
|
|
22
35
|
* @param key - The dot-separated key to retrieve the value.
|
|
23
36
|
* @returns The value associated with the key, or undefined if not found.
|
|
24
37
|
*/
|
|
25
38
|
get(key) {
|
|
39
|
+
if (!key || typeof key !== 'string') {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
if (!this.config) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
26
45
|
const result = key
|
|
27
46
|
.split('.')
|
|
28
47
|
.reduce((obj, segment) => obj?.[segment], this.config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigBuilder.js","sourceRoot":"","sources":["../../services/ConfigBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,aAAa;IAGjB;
|
|
1
|
+
{"version":3,"file":"ConfigBuilder.js","sourceRoot":"","sources":["../../services/ConfigBuilder.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubjectPageBase.js","sourceRoot":"","sources":["../../test-artifacts/SubjectPageBase.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IAG1B,YAAY,WAAoB;QAC9B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../test-artifacts/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test-artifacts/screens/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test-artifacts/subjects/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SubjectAgnosticComponents = 'Chart' | 'PivotGridFieldList' | 'Splitter' | 'ActionBar' | 'CombinedFilter' | 'CustomActionBar' | 'DetailTabPage' | 'Tab' | 'Tab' | 'TaskTiles' | 'FilterForm' | 'PrefilterList' | 'TaskBar' | 'Cardlist' | 'TreeView' | 'CubeViewBar' | 'PivotGrid' | 'Maps' | 'ReportBar' | 'ReportTiles' | 'Scheduler' | 'Preview';
|
|
2
|
+
export declare const coreComponents: SubjectAgnosticComponents[];
|
|
3
|
+
export type SubjectComponents = 'Form' | 'Grid';
|
|
4
|
+
export declare const subjectComponents: SubjectComponents[];
|
|
5
|
+
export type ScreenComponents = SubjectComponents | SubjectAgnosticComponents;
|
|
6
|
+
export declare const screenComponents: ScreenComponents[];
|
|
7
|
+
export declare const disabledScreenComponents: ScreenComponents[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const coreComponents = [
|
|
2
|
+
'ActionBar',
|
|
3
|
+
'CombinedFilter',
|
|
4
|
+
'CustomActionBar',
|
|
5
|
+
'Splitter',
|
|
6
|
+
'Tab',
|
|
7
|
+
'DetailTabPage',
|
|
8
|
+
'TaskBar',
|
|
9
|
+
'Tab',
|
|
10
|
+
'Cardlist',
|
|
11
|
+
'FilterForm',
|
|
12
|
+
'TaskTiles',
|
|
13
|
+
'PrefilterList',
|
|
14
|
+
'Chart',
|
|
15
|
+
'TreeView',
|
|
16
|
+
'CubeViewBar',
|
|
17
|
+
'PivotGrid',
|
|
18
|
+
'PivotGridFieldList',
|
|
19
|
+
'Maps',
|
|
20
|
+
'ReportBar',
|
|
21
|
+
'ReportTiles',
|
|
22
|
+
'Scheduler',
|
|
23
|
+
'Preview'
|
|
24
|
+
];
|
|
25
|
+
export const subjectComponents = ['Form', 'Grid'];
|
|
26
|
+
export const screenComponents = [...coreComponents, ...subjectComponents];
|
|
27
|
+
export const disabledScreenComponents = ['Splitter'];
|
|
28
|
+
//# sourceMappingURL=Components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Components.js","sourceRoot":"","sources":["../../types/Components.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,UAAU;IACV,KAAK;IACL,eAAe;IACf,SAAS;IACT,KAAK;IACL,UAAU;IACV,YAAY;IACZ,WAAW;IACX,eAAe;IACf,OAAO;IACP,UAAU;IACV,aAAa;IACb,WAAW;IACX,oBAAoB;IACpB,MAAM;IACN,WAAW;IACX,aAAa;IACb,WAAW;IACX,SAAS;CACV,CAAC;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAGvE,MAAM,CAAC,MAAM,gBAAgB,GAAuB,CAAC,GAAG,cAAc,EAAE,GAAG,iBAAiB,CAAC,CAAC;AAC9F,MAAM,CAAC,MAAM,wBAAwB,GAAuB,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export class PathResolver {
|
|
5
|
+
public getConsumerRootDirectory(): string {
|
|
6
|
+
let directory = process.cwd();
|
|
7
|
+
let lastDir = '';
|
|
8
|
+
let found = false;
|
|
9
|
+
|
|
10
|
+
while (directory !== lastDir) {
|
|
11
|
+
const pkgPath = path.join(directory, 'package.json');
|
|
12
|
+
|
|
13
|
+
if (fs.existsSync(pkgPath)) {
|
|
14
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
15
|
+
if (pkg.name !== '@thinkwise/testwise') {
|
|
16
|
+
found = true;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
lastDir = directory;
|
|
22
|
+
directory = path.dirname(directory);
|
|
23
|
+
}
|
|
24
|
+
if (!found) {
|
|
25
|
+
directory = process.cwd();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return directory;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/helpers/index.ts
CHANGED
package/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ console.error = (...args: unknown[]) => logger.error(args.join(' '));
|
|
|
13
13
|
console.debug = (...args: unknown[]) => logger.debug(args.join(' '));
|
|
14
14
|
|
|
15
15
|
export { originalLog, originalInfo, originalWarn, originalError, originalDebug };
|
|
16
|
+
export * from './artifact-builder/index.js';
|
|
16
17
|
export * from './components/index.js';
|
|
17
18
|
export * from './controls/index.js';
|
|
18
19
|
export * from './enums/index.js';
|
package/package.json
CHANGED
|
@@ -1,43 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thinkwise/testwise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-beta.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"testwise": "
|
|
8
|
-
"testwise-credentials": "
|
|
7
|
+
"testwise": "scripts/main.js",
|
|
8
|
+
"testwise-credentials": "promptCredentials.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint ./ --cache --ignore-pattern .gitignore",
|
|
12
12
|
"format:fix": "run-s \"lint --fix\" && biome check --fix --unsafe",
|
|
13
|
-
"format:check": "run-s \"lint \" && biome check"
|
|
13
|
+
"format:check": "run-s \"lint \" && biome check",
|
|
14
|
+
"postinstall": "node scripts/main.js postinstall"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [],
|
|
16
17
|
"author": "",
|
|
17
18
|
"license": "ISC",
|
|
18
19
|
"description": "",
|
|
19
20
|
"dependencies": {
|
|
21
|
+
"@thinkwise/backups": "^1.0.9",
|
|
20
22
|
"@types/node": "^22.15.29",
|
|
21
23
|
"axios": "^1.9.0",
|
|
22
24
|
"chalk": "^5.4.1",
|
|
23
25
|
"csv-parse": "^5.6.0",
|
|
24
26
|
"dotenv": "^17.2.2",
|
|
25
|
-
"
|
|
26
|
-
"prompts": "^2.4.2"
|
|
27
|
+
"prettier": "^3.6.2",
|
|
28
|
+
"prompts": "^2.4.2",
|
|
29
|
+
"quicktype": "^23.2.6",
|
|
30
|
+
"rimraf": "^6.0.1",
|
|
31
|
+
"ts-node": "^10.9.2",
|
|
32
|
+
"typescript": "^5.8.3"
|
|
27
33
|
},
|
|
28
34
|
"peerDependencies": {
|
|
29
|
-
"@playwright/test": "^1.
|
|
30
|
-
"typescript": "^5.8.3"
|
|
35
|
+
"@playwright/test": "^1.56.1"
|
|
31
36
|
},
|
|
32
37
|
"devDependencies": {
|
|
33
38
|
"@biomejs/biome": "^2.3.8",
|
|
34
39
|
"@eslint/js": "^9.28.0",
|
|
35
|
-
"@playwright/test": "^1.52.0",
|
|
36
40
|
"eslint": "^9.28.0",
|
|
37
41
|
"eslint-plugin-playwright": "^2.2.0",
|
|
38
42
|
"npm-run-all": "^4.1.5",
|
|
39
43
|
"typescript-eslint": "^8.34.0"
|
|
40
44
|
},
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"types": "./dist/index.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./subjects/*": {
|
|
51
|
+
"types": "./dist/test-artifacts/subjects/*/index.d.ts",
|
|
52
|
+
"import": "./dist/test-artifacts/subjects/*/index.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
41
55
|
"files": [
|
|
42
56
|
"dist/",
|
|
43
57
|
"scripts/",
|
|
@@ -53,7 +67,10 @@
|
|
|
53
67
|
"enums/",
|
|
54
68
|
"tsconfig.json",
|
|
55
69
|
"example-code/",
|
|
70
|
+
"schemas/",
|
|
56
71
|
"interfaces/",
|
|
72
|
+
"test-artifacts/",
|
|
73
|
+
"artifact-builder/",
|
|
57
74
|
"**/config.json"
|
|
58
75
|
]
|
|
59
76
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
import type { Test } from '../types/Test.js';
|
|
3
|
+
|
|
4
|
+
class Get {
|
|
5
|
+
private _page: Page;
|
|
6
|
+
|
|
7
|
+
constructor(page: Page) {
|
|
8
|
+
this._page = page;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getSubject<T>(ctor: new (page: Page) => T): T {
|
|
12
|
+
return new ctor(this._page);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '@playwright/test' {
|
|
17
|
+
interface Page {
|
|
18
|
+
get: <T>(ctor: new (page: Page) => T) => T;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class SubjectProvider {
|
|
23
|
+
private _test: Test;
|
|
24
|
+
|
|
25
|
+
constructor(test: Test) {
|
|
26
|
+
this._test = test.extend({
|
|
27
|
+
page: async ({ page }, use) => {
|
|
28
|
+
const getInstance = new Get(page);
|
|
29
|
+
page.get = getInstance.getSubject.bind(getInstance);
|
|
30
|
+
|
|
31
|
+
// page.subject definition goes here
|
|
32
|
+
|
|
33
|
+
await use(page);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get test() {
|
|
39
|
+
return this._test;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// import type { Page } from '@playwright/test';
|
|
2
|
+
import type { Test } from '../types/Test.js';
|
|
3
|
+
|
|
4
|
+
export type SubjectType = {
|
|
5
|
+
none: unknown;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
declare module '@playwright/test' {
|
|
9
|
+
interface Page {
|
|
10
|
+
subject: SubjectType;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class SubjectRegistry {
|
|
15
|
+
private _test: Test;
|
|
16
|
+
|
|
17
|
+
constructor(test: Test) {
|
|
18
|
+
this._test = test.extend({
|
|
19
|
+
page: async ({ page }, use) => {
|
|
20
|
+
page.subject = {} as SubjectType;
|
|
21
|
+
|
|
22
|
+
await use(page);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get test() {
|
|
28
|
+
return this._test;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/page-extensions/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './GlobalComponents.js';
|
|
2
2
|
export * from './GoToDeepLink.js';
|
|
3
3
|
export * from './LoginFeatures.js';
|
|
4
|
+
export * from './SubjectProvider.js';
|
|
5
|
+
export * from './SubjectRegistry.js';
|
|
4
6
|
export * from './UserSimulation.js';
|
|
7
|
+
export * from './WaitEventHandler.js';
|