qa 0.0.32 → 0.1.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/dist/api/index.js CHANGED
@@ -4,13 +4,13 @@ import { WORKER_URL, PLATFORM_URL } from '../constants.js';
4
4
  const PROBLEMATIC_ERROR_CODES = ['ECONNREFUSED', 'ECONNRESET', 'EPIPE', 'ETIMEDOUT'];
5
5
  const WORKER_ENDPOINT = `http${WORKER_URL.slice(2)}/api`;
6
6
  export async function runAPITest(token, argv) {
7
- const { sessionId } = await initiateSession(token, argv.project);
7
+ const { sessionId } = await initiateSession(token, { testId: argv.project, filter: argv.filter });
8
8
  await runTest(sessionId);
9
9
  const { passed } = await deleteSession(token, sessionId);
10
10
  console.log(`\n➡️ See more test details at ${PLATFORM_URL}/api-testing/tests/${sessionId}`);
11
11
  process.exit(passed ? 0 : 1);
12
12
  }
13
- async function initiateSession(token, testId) {
13
+ async function initiateSession(token, testParameters) {
14
14
  try {
15
15
  const res = await fetch(WORKER_ENDPOINT, {
16
16
  method: 'POST',
@@ -18,7 +18,7 @@ async function initiateSession(token, testId) {
18
18
  'Content-Type': 'application/json',
19
19
  Authorization: token
20
20
  },
21
- body: JSON.stringify({ testId })
21
+ body: JSON.stringify(testParameters)
22
22
  });
23
23
  if (!res.ok || res.status !== 200) {
24
24
  const error = await res.json();
@@ -6,9 +6,11 @@ let app;
6
6
  const onShutdown = async () => {
7
7
  await app?.handleShutdown();
8
8
  };
9
- process.on('SIGINT', onShutdown);
10
- process.on('SIGTERM', onShutdown);
11
- process.on('beforeExit', onShutdown);
9
+ if (process.argv[2] === 'start') {
10
+ process.on('SIGINT', onShutdown);
11
+ process.on('SIGTERM', onShutdown);
12
+ process.on('beforeExit', onShutdown);
13
+ }
12
14
  export const command = 'start [option]';
13
15
  export const desc = 'Start the VollQ IDE';
14
16
  export const cmdArgs = {
@@ -18,8 +18,14 @@ export declare const cmdArgs: {
18
18
  readonly default: "spec";
19
19
  readonly alias: "r";
20
20
  };
21
+ readonly filter: {
22
+ readonly desc: "Filter tests by tag or workflow id";
23
+ readonly type: "string";
24
+ readonly alias: "f";
25
+ readonly array: true;
26
+ };
21
27
  };
22
- export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "token" | "server" | "reporter"> & import("yargs").InferredOptionTypes<{
28
+ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "token" | "filter" | "server" | "reporter"> & import("yargs").InferredOptionTypes<{
23
29
  readonly token: {
24
30
  readonly alias: "t";
25
31
  readonly desc: "Provide an access token to authenticate with the platform";
@@ -35,6 +41,12 @@ export declare const builder: (yargs: Argv) => Argv<import("yargs").Omit<{}, "to
35
41
  readonly default: "spec";
36
42
  readonly alias: "r";
37
43
  };
44
+ readonly filter: {
45
+ readonly desc: "Filter tests by tag or workflow id";
46
+ readonly type: "string";
47
+ readonly alias: "f";
48
+ readonly array: true;
49
+ };
38
50
  }>>;
39
51
  export declare const handler: (argv: typeof cmdArgs & {
40
52
  type: "api" | "ui";
@@ -19,6 +19,12 @@ export const cmdArgs = {
19
19
  type: 'string',
20
20
  default: 'spec',
21
21
  alias: 'r',
22
+ },
23
+ filter: {
24
+ desc: 'Filter tests by tag or workflow id',
25
+ type: 'string',
26
+ alias: 'f',
27
+ array: true
22
28
  }
23
29
  };
24
30
  export const builder = (yargs) => {
@@ -26,7 +32,7 @@ export const builder = (yargs) => {
26
32
  .options(cmdArgs)
27
33
  .example('qa test ui login', 'Runs a UI browser test named "login"')
28
34
  .example('qa test api myAPI', 'Runs test on API named "myAPI"')
29
- .example('qa test api myAPI -r nyan', 'Runs tests using the Nyan reporter')
35
+ .example('qa test api myAPI -f loginFlow', 'Runs tests tagged or workflows named with "loginFlow"')
30
36
  .epilogue(CLI_EPILOGUE)
31
37
  .help();
32
38
  };
@@ -1,5 +1,6 @@
1
1
  export interface TestCommandParameters {
2
2
  reporter?: string;
3
3
  project: string;
4
+ filter?: string[];
4
5
  }
5
6
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qa",
3
- "version": "0.0.32",
3
+ "version": "0.1.0",
4
4
  "author": "Christian Bromann <christian@vollq.ai>",
5
5
  "description": "VollQ CLI",
6
6
  "license": "Apache-2.0",
@@ -25,7 +25,7 @@
25
25
  "ws": "^8.18.0",
26
26
  "yargs": "^17.7.2",
27
27
  "webdriverio": "^9.6.4",
28
- "@vollq/contracts": "0.0.13",
28
+ "@vollq/contracts": "0.0.14",
29
29
  "@vollq/ide": "0.0.8",
30
30
  "localdriver": "0.0.4",
31
31
  "neuralspec": "0.0.5"