@qawolf/cli 0.9.3-alpha.0 → 1.0.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/package.json CHANGED
@@ -1,55 +1,97 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "description": "qawolf cli for running tests",
4
- "version": "0.9.3-alpha.0",
5
- "license": "BSD-3.0",
6
- "main": "./lib/index.js",
7
- "types": "./lib/index.d.ts",
8
- "files": [
9
- "lib",
10
- "src",
11
- "static"
3
+ "version": "1.0.0",
4
+ "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
+ "keywords": [
6
+ "automation",
7
+ "cli",
8
+ "e2e",
9
+ "playwright",
10
+ "qa",
11
+ "qawolf",
12
+ "testing"
12
13
  ],
13
- "scripts": {
14
- "cli": "ts-node ./src/index",
15
- "test": "jest"
14
+ "homepage": "https://docs.qawolf.com",
15
+ "bugs": {
16
+ "url": "https://github.com/qawolf/cli/issues"
16
17
  },
18
+ "license": "Apache-2.0",
19
+ "author": "QA Wolf <support@qawolf.com>",
17
20
  "repository": {
18
21
  "type": "git",
19
- "url": "git+https://github.com/qawolf/qawolf.git"
22
+ "url": "git+https://github.com/qawolf/cli.git"
20
23
  },
21
- "bugs": {
22
- "url": "https://github.com/qawolf/qawolf/issues"
24
+ "bin": {
25
+ "qawolf": "./dist/cli.js"
23
26
  },
27
+ "files": [
28
+ "LICENSE",
29
+ "README.md",
30
+ "dist/cli.js",
31
+ "skills"
32
+ ],
33
+ "type": "module",
24
34
  "publishConfig": {
25
35
  "access": "public"
26
36
  },
37
+ "scripts": {
38
+ "build": "bun run generate && bun scripts/build.ts",
39
+ "build:binary": "bun scripts/buildBinary.ts",
40
+ "dev": "bun run src/main.ts",
41
+ "format": "oxfmt .",
42
+ "format:check": "oxfmt --check .",
43
+ "generate": "bun scripts/genDependencyVersions.ts && bun scripts/genSkillMd.ts",
44
+ "install:binary": "bun run build:binary && mkdir -p ~/.local/bin && cp dist/qawolf ~/.local/bin/qawolf",
45
+ "install:local": "bun run build && npm link",
46
+ "knip": "knip",
47
+ "lint": "oxlint",
48
+ "lint:fix": "oxlint --fix",
49
+ "postbuild": "./scripts/postbuild.sh",
50
+ "prepare": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath .githooks || true",
51
+ "test": "bun run generate && bun test",
52
+ "test:watch": "bun test --watch",
53
+ "typecheck": "bun run generate && tsc --noEmit",
54
+ "uninstall:binary": "rm ~/.local/bin/qawolf",
55
+ "uninstall:local": "npm unlink -g @qawolf/cli",
56
+ "version-packages": "changeset version && bun run format"
57
+ },
27
58
  "dependencies": {
28
- "@qawolf/browser": "0.9.3-alpha.0",
29
- "@qawolf/create-code": "0.9.3-alpha.0",
30
- "@qawolf/jest-plugin": "0.9.3-alpha.0",
31
- "@qawolf/logger": "0.9.3-alpha.0",
32
- "@qawolf/repl": "0.9.3-alpha.0",
33
- "commander": "^4.1.1",
34
- "inquirer": "^7.0.0",
35
- "jest": "^25.1.0"
59
+ "@clack/prompts": "1.5.1",
60
+ "@napi-rs/keyring": "1.3.0",
61
+ "@playwright/test": "1.60.0",
62
+ "@qawolf/api-contracts": "0.1.0",
63
+ "@qawolf/emails": "1.1.1",
64
+ "@qawolf/flow-targets": "1.0.0",
65
+ "@qawolf/flows": "0.1.1",
66
+ "@qawolf/testkit": "1.1.1",
67
+ "appium": "2.11.3",
68
+ "appium-uiautomator2-driver": "3.7.0",
69
+ "appium-xcuitest-driver": "9.10.5",
70
+ "commander": "14.0.3",
71
+ "env-paths": "4.0.0",
72
+ "picomatch": "4.0.4",
73
+ "pino": "10.3.1",
74
+ "playwright": "1.58.2",
75
+ "superjson": "2.2.6",
76
+ "tar": "7.5.16",
77
+ "tinyglobby": "0.2.17",
78
+ "webdriverio": "9.27.1",
79
+ "zod": "4.4.3"
36
80
  },
37
81
  "devDependencies": {
38
- "@qawolf/types": "0.9.3-alpha.0",
39
- "@types/inquirer": "^6.5.0",
40
- "fs-extra": "^8.1.0",
41
- "handlebars": "^4.x",
42
- "kleur": "^3.x",
43
- "lodash": "^4.x"
44
- },
45
- "peerDependencies": {
46
- "fs-extra": "^8.1.0",
47
- "handlebars": "^4.x",
48
- "kleur": "^3.x",
49
- "lodash": "^4.x"
82
+ "@changesets/cli": "2.31.0",
83
+ "@tsconfig/bun": "1.0.10",
84
+ "@tsconfig/strictest": "2.0.8",
85
+ "@types/bun": "1.3.14",
86
+ "@types/picomatch": "4.0.3",
87
+ "knip": "6.16.1",
88
+ "oxfmt": "0.54.0",
89
+ "oxlint": "1.69.0",
90
+ "oxlint-tsgolint": "0.23.0",
91
+ "typescript": "6.0.3"
50
92
  },
51
- "bin": {
52
- "qawolf": "lib/index.js"
93
+ "engines": {
94
+ "node": ">=22.12.0"
53
95
  },
54
- "gitHead": "4a729506a9cbe8fe126682d77000727472a440ba"
96
+ "packageManager": "bun@1.3.13"
55
97
  }
File without changes
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: qawolf-cli
3
+ description: Run QA Wolf flows and trigger runs through the QA Wolf public API using the qawolf CLI. Use when asked to run, list, pull, or create QA Wolf tests/runs from a shell.
4
+ ---
5
+
6
+ # QA Wolf CLI
7
+
8
+ `qawolf` runs QA Wolf flows locally and calls the QA Wolf public API.
9
+
10
+ This file is an overview, not a reference. Before using any command, run
11
+ `qawolf <command> --help` — the installed CLI is authoritative for flags and
12
+ always matches its version.
13
+
14
+ ## Auth
15
+
16
+ Commands that talk to QA Wolf authenticate via the `QAWOLF_API_KEY`
17
+ environment variable (or stored credentials from `qawolf auth login`).
18
+ `read` and `write` commands require auth; `local` commands do not, unless
19
+ their table entry notes a flag that switches them to `read`.
20
+ Verify with `qawolf auth whoami`. Never print or log the key.
21
+
22
+ ## Output
23
+
24
+ When consuming output programmatically, always pass `--json` (or `--agent`).
25
+ Human-formatted output is not stable across versions. Errors go to stderr;
26
+ a non-zero exit code means the command failed.
27
+
28
+ ## Safety: reads vs writes
29
+
30
+ Read commands are safe to run and retry freely. Write commands act on the
31
+ real team — confirm intent before running them, and never blind-retry a
32
+ write on timeout: it may have reached the server the first time.
33
+
34
+ ## Commands
35
+
36
+ <!-- commands-table:start — generated by `bun run generate`, do not edit -->
37
+
38
+ | Command | Kind | What it does |
39
+ | ------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
40
+ | `qawolf auth login` | local | Authenticate with your QA Wolf API key |
41
+ | `qawolf auth logout` | local | Remove stored credentials |
42
+ | `qawolf auth whoami` | read | Show authentication status |
43
+ | `qawolf doctor` | local | Diagnose problems running flows locally |
44
+ | `qawolf flows list` | local (read with --remote) | List flows matching [pattern] from the local project, or from QA Wolf with --remote |
45
+ | `qawolf flows pull` | read | Download an environment's flows into the local .qawolf/<env>/ cache |
46
+ | `qawolf flows run` | local (read with --env) | Run flows matching [pattern], or every flow when omitted; with --env, pull missing flows from that QA Wolf environment |
47
+ | `qawolf init` | local | Scaffold a QA Wolf project in the current directory |
48
+ | `qawolf install` | local | Install every runtime dependency the project's flows need |
49
+ | `qawolf install android` | local | Install Android system images, AVDs, and the Appium driver used by the project's Android flows |
50
+ | `qawolf install browsers` | local | Install Playwright browsers used by the project's web flows |
51
+ | `qawolf run create` | write | Create a run for selected flows in an environment. |
52
+
53
+ <!-- commands-table:end -->
54
+
55
+ Kinds: `read` calls the QA Wolf API without changing anything; `write`
56
+ changes team state; `local` only affects this machine. A parenthesized
57
+ note like `local (read with --remote)` means that flag makes the command
58
+ call the QA Wolf API and require auth.
59
+
60
+ ## Typical tasks
61
+
62
+ - Trigger a run of flows on QA Wolf: `qawolf run create --help` for the
63
+ required flags, then run it once and report the returned run id.
64
+ - Run flows locally during development: `qawolf flows run` (use
65
+ `qawolf install` first if dependencies are missing; `qawolf doctor` when
66
+ something is broken).
67
+ - Get flows for an environment: `qawolf flows pull`.
package/LICENSE.md DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2019 QA Wolf (https://qawolf.com).
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- 3. Neither the name QA Wolf nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
1
- /// <reference types="node" />
2
- import { BrowserContext } from "@qawolf/browser";
3
- import { CodeCreator } from "@qawolf/create-code";
4
- import { Url } from "url";
5
- declare type CreateOptions = {
6
- codePath?: string;
7
- debug?: boolean;
8
- device?: string;
9
- isTest?: boolean;
10
- name: string;
11
- path?: string;
12
- selectorPath?: string;
13
- url: Url;
14
- };
15
- declare type ConstructOptions = {
16
- context: BrowserContext;
17
- codePath: string;
18
- codeCreator: CodeCreator;
19
- debug: boolean;
20
- isTest: boolean;
21
- };
22
- export declare class CreateCodeCLI {
23
- private _codePath;
24
- private _codeCreator;
25
- private _context;
26
- private _debug;
27
- private _isTest;
28
- protected constructor(options: ConstructOptions);
29
- static start(options: CreateOptions): Promise<void>;
30
- protected _prompt(): Promise<void>;
31
- }
32
- export {};
@@ -1,112 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const browser_1 = require("@qawolf/browser");
13
- const create_code_1 = require("@qawolf/create-code");
14
- const repl_1 = require("@qawolf/repl");
15
- const inquirer_1 = require("inquirer");
16
- const kleur_1 = require("kleur");
17
- const path_1 = require("path");
18
- class CreateCodeCLI {
19
- constructor(options) {
20
- this._codePath = options.codePath;
21
- this._codeCreator = options.codeCreator;
22
- this._context = options.context;
23
- this._debug = options.debug;
24
- this._isTest = options.isTest;
25
- }
26
- static start(options) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- try {
29
- const contextPromise = browser_1.launch({
30
- device: options.device,
31
- shouldRecordEvents: true,
32
- timeout: 0
33
- });
34
- const rootPath = options.path || `${process.cwd()}/.qawolf`;
35
- let codePath = options.codePath;
36
- if (!codePath) {
37
- codePath = options.isTest
38
- ? path_1.join(rootPath, "tests", `${options.name}.test.js`)
39
- : path_1.join(rootPath, "scripts", `${options.name}.js`);
40
- }
41
- const selectorPath = options.selectorPath ||
42
- path_1.join(rootPath, "selectors", `${options.name}.json`);
43
- const codeCreator = yield create_code_1.CodeCreator.start({
44
- codePath,
45
- device: options.device,
46
- isTest: options.isTest,
47
- name: options.name,
48
- selectorPath,
49
- url: options.url.href
50
- });
51
- const context = yield contextPromise;
52
- context.qawolf().goto(options.url.href);
53
- context.qawolf().on("recorded_event", event => {
54
- codeCreator.pushEvent(event);
55
- });
56
- codeCreator.startPolling();
57
- const command = new CreateCodeCLI({
58
- codePath,
59
- codeCreator,
60
- context,
61
- debug: !!options.debug,
62
- isTest: !!options.isTest
63
- });
64
- yield command._prompt();
65
- }
66
- catch (e) {
67
- if (e.message === "Cannot find selector file to update") {
68
- logNoSelectors();
69
- }
70
- else {
71
- throw e;
72
- }
73
- process.exit(1);
74
- }
75
- });
76
- }
77
- _prompt() {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- const { choice } = yield inquirer_1.prompt([
80
- {
81
- choices: [
82
- "💾 Save and exit",
83
- "🖥️ Open REPL to run code",
84
- "🗑️ Discard and exit"
85
- ],
86
- message: `Edit your ${this._isTest ? "test" : "script"} at: ${path_1.relative(process.cwd(), this._codePath)}`,
87
- name: "choice",
88
- type: "list"
89
- }
90
- ]);
91
- if (choice.includes("REPL")) {
92
- yield repl_1.repl();
93
- yield this._prompt();
94
- return;
95
- }
96
- yield this._context.close();
97
- if (choice.includes("Save")) {
98
- yield this._codeCreator.save({ debug: this._debug });
99
- }
100
- else {
101
- yield this._codeCreator.discard();
102
- }
103
- process.exit(0);
104
- });
105
- }
106
- }
107
- exports.CreateCodeCLI = CreateCodeCLI;
108
- const logNoSelectors = () => {
109
- console.log(kleur_1.bold().red("Cannot find selectors to update"));
110
- console.log(kleur_1.bold().blue("Specify them with:"), "npx qawolf create --selectors /path/to/selectors.json");
111
- };
112
- //# sourceMappingURL=CreateCodeCLI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateCodeCLI.js","sourceRoot":"","sources":["../src/CreateCodeCLI.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6CAAyD;AACzD,qDAAkD;AAClD,uCAAoC;AACpC,uCAAkC;AAClC,iCAA6B;AAC7B,+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AI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;iBACb;aACF,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC3B,MAAM,WAAI,EAAE,CAAC;gBACb,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO;aACR;YAED,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YAE5B,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC3B,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;aACtD;iBAAM;gBACL,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;aACnC;YAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;KAAA;CACF;AA3GD,sCA2GC;AAED,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,YAAI,EAAE,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,CACT,YAAI,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,EACjC,uDAAuD,CACxD,CAAC;AACJ,CAAC,CAAC"}
package/lib/ci.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare type CiProvider = "azure" | "bitbucket" | "circleci" | "github" | "gitlab" | "jenkins";
2
- export declare const saveCiTemplate: (provider: CiProvider) => Promise<void>;
3
- export {};
package/lib/ci.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const fs_extra_1 = require("fs-extra");
16
- const handlebars_1 = require("handlebars");
17
- const inquirer_1 = require("inquirer");
18
- const path_1 = __importDefault(require("path"));
19
- const { version } = require("../package");
20
- const paths = {
21
- azure: "azure-pipelines.yml",
22
- bitbucket: "bitbucket-pipelines.yml",
23
- circleci: ".circleci/config.yml",
24
- github: ".github/workflows/qawolf.yml",
25
- gitlab: ".gitlab-ci.yml",
26
- jenkins: "Jenkinsfile"
27
- };
28
- exports.saveCiTemplate = (provider) => __awaiter(void 0, void 0, void 0, function* () {
29
- const providerPath = paths[provider];
30
- const outputPath = path_1.default.join(process.cwd(), providerPath);
31
- if (yield fs_extra_1.pathExists(outputPath)) {
32
- const { overwrite } = yield inquirer_1.prompt([
33
- {
34
- message: `"${outputPath}" already exists, overwrite it?`,
35
- name: "overwrite",
36
- type: "confirm"
37
- }
38
- ]);
39
- if (!overwrite)
40
- return;
41
- }
42
- const ciTemplate = handlebars_1.compile(fs_extra_1.readFileSync(path_1.default.resolve(__dirname, `../static/${provider}.hbs`), "utf8"));
43
- const ci = ciTemplate({ version });
44
- yield fs_extra_1.outputFile(outputPath, ci, "utf8");
45
- console.log(`Saved ${provider} template to ${outputPath}`);
46
- });
47
- //# sourceMappingURL=ci.js.map
package/lib/ci.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"ci.js","sourceRoot":"","sources":["../src/ci.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAgE;AAChE,2CAAqC;AACrC,uCAAkC;AAClC,gDAAwB;AACxB,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAU1C,MAAM,KAAK,GAAG;IACZ,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,yBAAyB;IACpC,QAAQ,EAAE,sBAAsB;IAChC,MAAM,EAAE,8BAA8B;IACtC,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,aAAa;CACvB,CAAC;AAEW,QAAA,cAAc,GAAG,CAAO,QAAoB,EAAiB,EAAE;IAC1E,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IAErC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAC;IAE1D,IAAI,MAAM,qBAAU,CAAC,UAAU,CAAC,EAAE;QAChC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,iBAAM,CAAyB;YACzD;gBACE,OAAO,EAAE,IAAI,UAAU,iCAAiC;gBACxD,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;aAChB;SACF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS;YAAE,OAAO;KACxB;IAED,MAAM,UAAU,GAAG,oBAAO,CACxB,uBAAY,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,QAAQ,MAAM,CAAC,EAAE,MAAM,CAAC,CAC3E,CAAC;IACF,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAEnC,MAAM,qBAAU,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAEzC,OAAO,CAAC,GAAG,CAAC,SAAS,QAAQ,gBAAgB,UAAU,EAAE,CAAC,CAAC;AAC7D,CAAC,CAAA,CAAC"}
package/lib/howl.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const howl: () => void;
package/lib/howl.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const wolf = String.raw `
4
- .
5
- / V\
6
- / ' /
7
- << |
8
- / |
9
- / |
10
- / |
11
- / \ \ /
12
- ( ) | |
13
- ________| _/_ | |
14
- <__________\______)\__)
15
- `;
16
- exports.howl = () => {
17
- console.log(wolf);
18
- };
19
- //# sourceMappingURL=howl.js.map
package/lib/howl.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"howl.js","sourceRoot":"","sources":["../src/howl.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAYtB,CAAC;AAEW,QAAA,IAAI,GAAG,GAAG,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC"}
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/lib/index.js DELETED
@@ -1,137 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- const logger_1 = require("@qawolf/logger");
17
- const commander_1 = __importDefault(require("commander"));
18
- const kleur_1 = require("kleur");
19
- const ci_1 = require("./ci");
20
- const CreateCodeCLI_1 = require("./CreateCodeCLI");
21
- const howl_1 = require("./howl");
22
- const runJest_1 = require("./runJest");
23
- const utils_1 = require("./utils");
24
- const pkg = require("../package");
25
- commander_1.default.usage("<command> [options]").version(pkg.version);
26
- commander_1.default
27
- .command("create <url> [name]")
28
- .option("--code-path <codePath>", "path to save the code file")
29
- .option("--debug", "save events and workflow json for debugging")
30
- .option("-d, --device <device>", "emulate using a playwright.device")
31
- .option("-p, --path <path>", "path to save the files")
32
- .option("-s, --script", "create a script instead of a test")
33
- .option("--selector-path <selectorPath>", "path to save the selector file")
34
- .description("create a test from browser actions")
35
- .action((urlArgument, optionalName, cmd) => __awaiter(void 0, void 0, void 0, function* () {
36
- const url = utils_1.parseUrl(urlArgument);
37
- logger_1.logger.verbose(`create "${url.href}"`);
38
- const name = optionalName || url.hostname.replace(/\..*/g, "");
39
- yield CreateCodeCLI_1.CreateCodeCLI.start({
40
- codePath: cmd.codePath,
41
- debug: cmd.debug,
42
- device: cmd.device,
43
- name,
44
- isTest: !cmd.script,
45
- path: cmd.path,
46
- selectorPath: cmd.selectorPath,
47
- url
48
- });
49
- }));
50
- commander_1.default
51
- .command("test")
52
- .option("-p, --path <path>", "path to test code")
53
- .option("--all-browsers", "run tests on chromium, firefox, and webkit")
54
- .option("--chromium", "run tests on chromium")
55
- .option("--firefox", "run tests on firefox")
56
- .option("--repl", "open a REPL when repl() is called")
57
- .option("--webkit", "run tests on webkit")
58
- .description("run a test with Jest")
59
- .allowUnknownOption(true)
60
- .action((cmd = {}) => {
61
- const args = utils_1.omitArgs(process.argv.slice(3), [
62
- "--all-browsers",
63
- "--chromium",
64
- "--firefox",
65
- "-p",
66
- "--path",
67
- "--repl",
68
- "--webkit"
69
- ]);
70
- let browsers = [];
71
- if (cmd.allBrowsers || cmd.chromium) {
72
- browsers.push("chromium");
73
- }
74
- if (cmd.allBrowsers || cmd.firefox) {
75
- browsers.push("firefox");
76
- }
77
- if (cmd.allBrowsers || cmd.webkit) {
78
- browsers.push("webkit");
79
- }
80
- const code = runJest_1.runJest(args, {
81
- browsers,
82
- path: cmd.path,
83
- repl: !!cmd.repl
84
- });
85
- process.exit(code);
86
- });
87
- commander_1.default
88
- .command("azure")
89
- .description("set up an Azure Pipeline")
90
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
91
- yield ci_1.saveCiTemplate("azure");
92
- }));
93
- commander_1.default
94
- .command("bitbucket")
95
- .description("set up an Bitbucket Pipeline")
96
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
97
- yield ci_1.saveCiTemplate("bitbucket");
98
- }));
99
- commander_1.default
100
- .command("circleci")
101
- .description("set up CircleCI")
102
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
103
- yield ci_1.saveCiTemplate("circleci");
104
- }));
105
- commander_1.default
106
- .command("github")
107
- .description("set up a GitHub Action")
108
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
109
- yield ci_1.saveCiTemplate("github");
110
- }));
111
- commander_1.default
112
- .command("gitlab")
113
- .description("set up GitLab CI/CD")
114
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
115
- yield ci_1.saveCiTemplate("gitlab");
116
- }));
117
- commander_1.default
118
- .command("howl")
119
- .description("🐺")
120
- .action(howl_1.howl);
121
- commander_1.default
122
- .command("jenkins")
123
- .description("set up Jenkins")
124
- .action(() => __awaiter(void 0, void 0, void 0, function* () {
125
- yield ci_1.saveCiTemplate("jenkins");
126
- }));
127
- commander_1.default.arguments("<command>").action(cmd => {
128
- console.log(kleur_1.yellow(`Invalid command "${cmd}"\n`));
129
- commander_1.default.help();
130
- });
131
- commander_1.default.allowUnknownOption(false);
132
- commander_1.default.parse(process.argv);
133
- if (!process.argv.slice(2).length) {
134
- console.log("\n");
135
- commander_1.default.outputHelp();
136
- }
137
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,2CAAwC;AAExC,0DAAgC;AAChC,iCAA+B;AAC/B,6BAAsC;AACtC,mDAAgD;AAChD,iCAA8B;AAC9B,uCAAoC;AACpC,mCAA6C;AAC7C,MA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M,CAAC,oBAAoB,GAAG,KAAK,CAAC,CAAC,CAAC;IAClD,mBAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,mBAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAElC,mBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;IACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,mBAAO,CAAC,UAAU,EAAE,CAAC;CACtB"}
package/lib/runJest.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { BrowserType } from "@qawolf/types";
2
- declare type RunJestOptions = {
3
- browsers?: BrowserType[];
4
- config?: string;
5
- path?: string;
6
- repl?: boolean;
7
- };
8
- export declare const runJest: (args?: string[], options?: RunJestOptions) => 1 | 0;
9
- export {};