@testspectra/cli 1.0.32 → 1.0.33

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.
@@ -345,6 +345,7 @@ export async function initCommand(options = {}) {
345
345
  const rootConfigFiles = [
346
346
  "spectra.config.ts",
347
347
  "tsconfig.spectra.json",
348
+ "tsconfig.spectra.shared.json",
348
349
  "tsconfig.spectra.web.json",
349
350
  "tsconfig.spectra.android.json",
350
351
  "tsconfig.spectra.ios.json",
@@ -242,20 +242,20 @@ export class TypeGenerator {
242
242
  content += ` ${actionName}: (typeof import('${matchedFile}') extends { default: infer T } ? T : typeof import('${matchedFile}'));\n`;
243
243
  declaredActions.add(actionName);
244
244
  }
245
- else {
246
- content += ` ${actionName}: (...args: any[]) => Promise<any>;\n`;
247
- declaredActions.add(actionName);
248
- }
249
245
  }
250
246
  else if (entry.isFile() && entry.name.endsWith(".ts")) {
251
- const actionName = entry.name.split(".")[0];
252
- if (declaredActions.has(actionName))
253
- continue;
254
- let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(actionsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
255
- if (!rel.startsWith("."))
256
- rel = `./${rel}`;
257
- content += ` ${actionName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
258
- declaredActions.add(actionName);
247
+ const parts = entry.name.split(".");
248
+ const stem = parts.length > 2 ? parts[parts.length - 2] : parts[0];
249
+ const actionName = parts[0];
250
+ if (hierarchy.includes(stem) || hierarchy.includes(parts[1])) {
251
+ if (declaredActions.has(actionName))
252
+ continue;
253
+ let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(actionsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
254
+ if (!rel.startsWith("."))
255
+ rel = `./${rel}`;
256
+ content += ` ${actionName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
257
+ declaredActions.add(actionName);
258
+ }
259
259
  }
260
260
  }
261
261
  }
@@ -296,20 +296,20 @@ export class TypeGenerator {
296
296
  content += ` ${stepName}: (typeof import('${matchedFile}') extends { default: infer T } ? T : typeof import('${matchedFile}'));\n`;
297
297
  declaredSteps.add(stepName);
298
298
  }
299
- else {
300
- content += ` ${stepName}: (...args: any[]) => Promise<any>;\n`;
301
- declaredSteps.add(stepName);
302
- }
303
299
  }
304
300
  else if (entry.isFile() && entry.name.endsWith(".ts")) {
305
- const stepName = entry.name.split(".")[0];
306
- if (declaredSteps.has(stepName))
307
- continue;
308
- let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(stepsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
309
- if (!rel.startsWith("."))
310
- rel = `./${rel}`;
311
- content += ` ${stepName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
312
- declaredSteps.add(stepName);
301
+ const parts = entry.name.split(".");
302
+ const stem = parts.length > 2 ? parts[parts.length - 2] : parts[0];
303
+ const stepName = parts[0];
304
+ if (hierarchy.includes(stem) || hierarchy.includes(parts[1])) {
305
+ if (declaredSteps.has(stepName))
306
+ continue;
307
+ let rel = path.relative(path.join(cwd, ".testspectra/types"), path.join(stepsDir, entry.name)).replace(/\\/g, "/").replace(/\.ts$/, ".js");
308
+ if (!rel.startsWith("."))
309
+ rel = `./${rel}`;
310
+ content += ` ${stepName}: (typeof import('${rel}') extends { default: infer T } ? T : typeof import('${rel}'));\n`;
311
+ declaredSteps.add(stepName);
312
+ }
313
313
  }
314
314
  }
315
315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/cli",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "TestSpectra Zero-Config Cross-Platform Test Runner CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +1,4 @@
1
1
  export default async function loginAsAdmin(): Promise<void> {
2
- await Step.loginUser("admin", "SuperAdminSecretKey!");
2
+ // Shared business step directly interacting with shared navigation
3
+ await NavigationBar.goToHome();
3
4
  }
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "files": [],
14
14
  "references": [
15
+ { "path": "./tsconfig.spectra.shared.json" },
15
16
  { "path": "./tsconfig.spectra.web.json" },
16
17
  { "path": "./tsconfig.spectra.android.json" },
17
18
  { "path": "./tsconfig.spectra.ios.json" }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "composite": true,
7
+ "noEmit": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "types": ["node", "@wdio/globals/types", "@wdio/mocha-framework"]
11
+ },
12
+ "include": [
13
+ ".testspectra/types/common.d.ts",
14
+ ".testspectra/types/fixtures.d.ts",
15
+ "shared/testing/**/*.ts"
16
+ ],
17
+ "exclude": [
18
+ "node_modules",
19
+ "dist"
20
+ ]
21
+ }