@thinkwise/testwise 0.2.0-beta.22 → 0.2.4
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 +1 -3
- package/artifact-builder/InterfaceGenerator.ts +9 -1
- package/artifact-builder/ModelDataBuilder.ts +31 -60
- package/artifact-builder/ModelDataRefiner.ts +9 -5
- package/artifact-builder/SelectorBuilder.ts +8 -1
- package/artifact-builder/SubjectComponentGenerator.ts +77 -7
- package/artifact-builder/SubjectGenerator.ts +1 -1
- package/artifact-builder/SubjectRegistration.ts +68 -55
- package/artifact-builder/helpers/DataRetriever.ts +5 -2
- package/artifact-builder/helpers/NamingHandler.ts +25 -19
- package/components/BaseComponentObjects.ts +4 -1
- package/components/action-bar/ActionBar.ts +3 -3
- package/components/grid/Grid.ts +18 -21
- package/components/tab/BaseTab.ts +2 -2
- package/components/tab/BaseTabObjects.ts +1 -1
- package/components/tab/DetailTabPage.ts +2 -2
- package/components/tab/Tab.ts +4 -4
- package/controls/LookupDropdown.ts +7 -2
- package/dist/Testwise.js +1 -3
- package/dist/Testwise.js.map +1 -1
- package/dist/artifact-builder/InterfaceGenerator.d.ts +1 -0
- package/dist/artifact-builder/InterfaceGenerator.js +6 -1
- package/dist/artifact-builder/InterfaceGenerator.js.map +1 -1
- package/dist/artifact-builder/ModelDataBuilder.js +26 -50
- package/dist/artifact-builder/ModelDataBuilder.js.map +1 -1
- package/dist/artifact-builder/ModelDataRefiner.js +9 -5
- package/dist/artifact-builder/ModelDataRefiner.js.map +1 -1
- package/dist/artifact-builder/SelectorBuilder.js +3 -1
- package/dist/artifact-builder/SelectorBuilder.js.map +1 -1
- package/dist/artifact-builder/SubjectComponentGenerator.d.ts +4 -0
- package/dist/artifact-builder/SubjectComponentGenerator.js +61 -5
- package/dist/artifact-builder/SubjectComponentGenerator.js.map +1 -1
- package/dist/artifact-builder/SubjectGenerator.js +1 -1
- package/dist/artifact-builder/SubjectGenerator.js.map +1 -1
- package/dist/artifact-builder/SubjectRegistration.d.ts +9 -9
- package/dist/artifact-builder/SubjectRegistration.js +51 -42
- package/dist/artifact-builder/SubjectRegistration.js.map +1 -1
- package/dist/artifact-builder/helpers/DataRetriever.js +3 -2
- package/dist/artifact-builder/helpers/DataRetriever.js.map +1 -1
- package/dist/artifact-builder/helpers/NamingHandler.d.ts +2 -1
- package/dist/artifact-builder/helpers/NamingHandler.js +20 -15
- package/dist/artifact-builder/helpers/NamingHandler.js.map +1 -1
- package/dist/components/BaseComponentObjects.d.ts +1 -0
- package/dist/components/BaseComponentObjects.js +3 -1
- package/dist/components/BaseComponentObjects.js.map +1 -1
- package/dist/components/action-bar/ActionBar.d.ts +1 -1
- package/dist/components/action-bar/ActionBar.js +3 -3
- package/dist/components/grid/Grid.d.ts +5 -4
- package/dist/components/grid/Grid.js +13 -19
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/tab/BaseTab.d.ts +2 -2
- package/dist/components/tab/BaseTab.js +2 -2
- package/dist/components/tab/BaseTab.js.map +1 -1
- package/dist/components/tab/BaseTabObjects.js +1 -1
- package/dist/components/tab/BaseTabObjects.js.map +1 -1
- package/dist/components/tab/DetailTabPage.d.ts +2 -2
- package/dist/components/tab/DetailTabPage.js +2 -2
- package/dist/components/tab/DetailTabPage.js.map +1 -1
- package/dist/components/tab/Tab.d.ts +3 -3
- package/dist/components/tab/Tab.js +4 -4
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/controls/LookupDropdown.d.ts +3 -7
- package/dist/controls/LookupDropdown.js.map +1 -1
- package/dist/enums/ElementTypes.d.ts +1 -1
- package/dist/enums/ElementTypes.js +1 -1
- package/dist/enums/ElementTypes.js.map +1 -1
- package/dist/helpers/ConfigChecker.d.ts +3 -0
- package/dist/helpers/ConfigChecker.js +7 -0
- package/dist/helpers/ConfigChecker.js.map +1 -0
- package/dist/helpers/LoginHelper.js +1 -1
- package/dist/helpers/LoginHelper.js.map +1 -1
- package/dist/interfaces/IComponentObjects.d.ts +1 -0
- package/dist/page-extensions/SubjectRegistry.d.ts +0 -8
- package/dist/page-extensions/SubjectRegistry.js +2 -6
- package/dist/page-extensions/SubjectRegistry.js.map +1 -1
- package/dist/page-extensions/index.d.ts +0 -1
- package/dist/page-extensions/index.js +0 -1
- package/dist/page-extensions/index.js.map +1 -1
- package/dist/services/IndiciumApi.service.d.ts +27 -0
- package/dist/services/IndiciumApi.service.js +135 -0
- package/dist/services/IndiciumApi.service.js.map +1 -0
- package/dist/templates/test-artifacts/SubjectPageBase.d.ts +5 -0
- package/dist/templates/test-artifacts/SubjectPageBase.js +6 -0
- package/dist/templates/test-artifacts/SubjectPageBase.js.map +1 -0
- package/dist/templates/test-artifacts/screens/index.d.ts +1 -0
- package/dist/templates/test-artifacts/screens/index.js +2 -0
- package/dist/templates/test-artifacts/screens/index.js.map +1 -0
- package/dist/templates/test-artifacts/subjects/index.d.ts +1 -0
- package/dist/templates/test-artifacts/subjects/index.js +2 -0
- package/dist/templates/test-artifacts/subjects/index.js.map +1 -0
- package/enums/ElementTypes.ts +1 -1
- package/helpers/ConfigChecker.ts +7 -0
- package/helpers/LoginHelper.ts +1 -1
- package/interfaces/IComponentObjects.ts +1 -0
- package/package.json +3 -2
- package/page-extensions/SubjectRegistry.ts +2 -19
- package/page-extensions/index.ts +0 -1
- package/scripts/main.js +48 -69
- package/scripts/postinstall.js +40 -39
- package/scripts/sync.js +756 -102
- package/services/IndiciumApi.service.ts +159 -0
- package/templates/SubjectRegistry.template.ts +73 -0
- package/templates/test-artifacts/SubjectPageBase.ts +9 -0
- package/templates/test-artifacts/screens/index.ts +0 -0
- package/templates/test-artifacts/subjects/index.ts +0 -0
- package/tsconfig.json +2 -3
- package/dist/config.json +0 -10
- package/dist/page-extensions/SubjectProvider.d.ts +0 -11
- package/dist/page-extensions/SubjectProvider.js +0 -24
- package/dist/page-extensions/SubjectProvider.js.map +0 -1
- package/dist/test-artifacts/index.d.ts +0 -3
- package/dist/test-artifacts/index.js +0 -4
- package/dist/test-artifacts/index.js.map +0 -1
- package/page-extensions/SubjectProvider.ts +0 -41
- package/test-artifacts/index.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../templates/test-artifacts/screens/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../templates/test-artifacts/subjects/index.ts"],"names":[],"mappings":""}
|
package/enums/ElementTypes.ts
CHANGED
package/helpers/LoginHelper.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { UniversalConfigOptions, UniversalLoginOptions } from '../types/ind
|
|
|
7
7
|
import { pollUntil } from './Poll.js';
|
|
8
8
|
|
|
9
9
|
const _dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
const configFixture = JSON.parse(fs.readFileSync(path.resolve(_dirname, '
|
|
10
|
+
const configFixture = JSON.parse(fs.readFileSync(path.resolve(_dirname, '../../config.json'), 'utf-8'));
|
|
11
11
|
|
|
12
12
|
export class LoginHelper {
|
|
13
13
|
private _page: Page;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thinkwise/testwise",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"interfaces/",
|
|
73
73
|
"test-artifacts/",
|
|
74
74
|
"artifact-builder/",
|
|
75
|
-
"**/config.json"
|
|
75
|
+
"**/config.json",
|
|
76
|
+
"templates/"
|
|
76
77
|
]
|
|
77
78
|
}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
// import type { Page } from '@playwright/test';
|
|
2
1
|
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
2
|
export class SubjectRegistry {
|
|
15
3
|
private _test: Test;
|
|
16
4
|
|
|
17
5
|
constructor(test: Test) {
|
|
18
|
-
this
|
|
19
|
-
|
|
20
|
-
page.subject = {} as SubjectType;
|
|
21
|
-
|
|
22
|
-
await use(page);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
6
|
+
// Implementation of this class is in the templates folder, don't edit here
|
|
7
|
+
this._test = test;
|
|
25
8
|
}
|
|
26
9
|
|
|
27
10
|
get test() {
|
package/page-extensions/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './GlobalComponents.js';
|
|
2
2
|
export * from './GoToDeepLink.js';
|
|
3
3
|
export * from './LoginFeatures.js';
|
|
4
|
-
export * from './SubjectProvider.js';
|
|
5
4
|
export * from './SubjectRegistry.js';
|
|
6
5
|
export * from './UserSimulation.js';
|
|
7
6
|
export * from './WaitEventHandler.js';
|
package/scripts/main.js
CHANGED
|
@@ -1,84 +1,63 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
2
|
import process from 'node:process';
|
|
5
|
-
import { PathResolver } from '../dist/helpers/index.js';
|
|
6
3
|
import { postinstall } from './postinstall.js';
|
|
7
4
|
import { setup } from './setup.js';
|
|
8
5
|
import { sync } from './sync.js';
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} else {
|
|
24
|
-
console.warn('Command unknown.');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function verifiedSeedData() {
|
|
28
|
-
const consumerRoot = new PathResolver().getConsumerRootDirectory();
|
|
29
|
-
const seedDataDir = path.join(consumerRoot, 'seed-data');
|
|
30
|
-
const subjectsJson = path.join(seedDataDir, 'subjects.json');
|
|
31
|
-
const screensDir = path.join(seedDataDir, 'screen-schemas');
|
|
32
|
-
const projectIsConfigured = await isConfigured();
|
|
33
|
-
|
|
34
|
-
if (!fs.existsSync(seedDataDir)) {
|
|
35
|
-
if (projectIsConfigured) {
|
|
36
|
-
fs.mkdirSync(seedDataDir);
|
|
37
|
-
fs.mkdirSync(screensDir);
|
|
38
|
-
|
|
39
|
-
console.log('Created seed-data directory structure.');
|
|
40
|
-
return true;
|
|
7
|
+
/**
|
|
8
|
+
* Main entry point for Testwise CLI commands
|
|
9
|
+
* @param {string[]} args - Command line arguments
|
|
10
|
+
*/
|
|
11
|
+
async function main() {
|
|
12
|
+
try {
|
|
13
|
+
const command = process.argv[2];
|
|
14
|
+
|
|
15
|
+
if (!command) {
|
|
16
|
+
console.error('Error: No command provided.');
|
|
17
|
+
console.log('Usage: main.js <command>');
|
|
18
|
+
console.log('Available commands: postinstall, sync');
|
|
19
|
+
process.exit(1);
|
|
41
20
|
}
|
|
42
21
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!fs.existsSync(screensDir)) {
|
|
53
|
-
if (projectIsConfigured) {
|
|
54
|
-
fs.mkdirSync(screensDir);
|
|
55
|
-
console.log('Created screen-schemas directory.');
|
|
56
|
-
return true;
|
|
22
|
+
if (command === 'postinstall') {
|
|
23
|
+
await handlePostinstall();
|
|
24
|
+
} else if (command === 'sync') {
|
|
25
|
+
await handleSync();
|
|
26
|
+
} else {
|
|
27
|
+
console.error(`Error: Unknown command '${command}'.`);
|
|
28
|
+
console.log('Available commands: postinstall, sync');
|
|
29
|
+
process.exit(1);
|
|
57
30
|
}
|
|
58
|
-
|
|
59
|
-
console.
|
|
60
|
-
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Fatal error:', error.message);
|
|
33
|
+
process.exit(1);
|
|
61
34
|
}
|
|
35
|
+
}
|
|
62
36
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Handle postinstall command
|
|
39
|
+
*/
|
|
40
|
+
async function handlePostinstall() {
|
|
41
|
+
try {
|
|
42
|
+
await setup();
|
|
43
|
+
postinstall();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Postinstall failed:', error.message);
|
|
46
|
+
process.exit(1);
|
|
67
47
|
}
|
|
68
|
-
return true;
|
|
69
48
|
}
|
|
70
49
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
guiApplAlias &&
|
|
82
|
-
guiApplAlias !== 'ExampleName'
|
|
83
|
-
);
|
|
50
|
+
/**
|
|
51
|
+
* Handle sync command
|
|
52
|
+
*/
|
|
53
|
+
async function handleSync() {
|
|
54
|
+
try {
|
|
55
|
+
sync();
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('Sync failed:', error.message);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
84
60
|
}
|
|
61
|
+
|
|
62
|
+
// Start the application
|
|
63
|
+
main();
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import process from 'node:process';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { ArtifactManager } from '../dist/artifact-builder/index.js';
|
|
6
|
-
import { testwiseConfig } from '../dist/services/ConfigBuilder.js';
|
|
7
|
-
import { sync } from './sync.js';
|
|
8
|
-
|
|
9
|
-
const _filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const _dirname = path.dirname(_filename);
|
|
11
|
-
|
|
12
|
-
export async function postinstall() {
|
|
13
|
-
try {
|
|
14
|
-
const autoSync = testwiseConfig().get('featureSettings.other.autoSync') ?? true;
|
|
15
|
-
if (!autoSync) return;
|
|
16
|
-
|
|
17
|
-
const rootDir = path.resolve(_dirname, '..');
|
|
18
|
-
const artifactManager = new ArtifactManager();
|
|
19
|
-
|
|
20
|
-
if (artifactManager.backupExists()) {
|
|
21
|
-
artifactManager.restoreBackup();
|
|
22
|
-
console.info('Restored artifacts from backup.');
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
process.
|
|
38
|
-
|
|
39
|
-
}
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { ArtifactManager } from '../dist/artifact-builder/index.js';
|
|
6
|
+
import { testwiseConfig } from '../dist/services/ConfigBuilder.js';
|
|
7
|
+
import { sync } from './sync.js';
|
|
8
|
+
|
|
9
|
+
const _filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const _dirname = path.dirname(_filename);
|
|
11
|
+
|
|
12
|
+
export async function postinstall() {
|
|
13
|
+
try {
|
|
14
|
+
const autoSync = testwiseConfig().get('featureSettings.other.autoSync') ?? true;
|
|
15
|
+
if (!autoSync) return;
|
|
16
|
+
|
|
17
|
+
const rootDir = path.resolve(_dirname, '..');
|
|
18
|
+
const artifactManager = new ArtifactManager();
|
|
19
|
+
|
|
20
|
+
if (artifactManager.backupExists()) {
|
|
21
|
+
artifactManager.restoreBackup();
|
|
22
|
+
console.info('Restored artifacts from backup.');
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
|
+
const { SubjectRegistration } = await import('../dist/artifact-builder/index.js');
|
|
26
|
+
new SubjectRegistration().run();
|
|
27
|
+
|
|
28
|
+
execSync('npx tsc', { cwd: rootDir, stdio: 'inherit' });
|
|
29
|
+
|
|
30
|
+
console.info('Postinstall restore process completed successfully.');
|
|
31
|
+
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
await sync();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error('Postinstall process failed:', error.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|