@fasttest-ai/qa-agent 0.4.0 → 0.4.1
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/LICENSE +190 -0
- package/README.md +188 -0
- package/dist/actions.d.ts +0 -1
- package/dist/actions.js +0 -1
- package/dist/actions.js.map +1 -1
- package/dist/browser.d.ts +3 -1
- package/dist/browser.js +33 -10
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +16 -3
- package/dist/cli.js.map +1 -1
- package/dist/cloud.d.ts +16 -0
- package/dist/cloud.js +35 -0
- package/dist/cloud.js.map +1 -1
- package/dist/healer.d.ts +1 -0
- package/dist/healer.js +4 -3
- package/dist/healer.js.map +1 -1
- package/dist/index.js +191 -24
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +5 -5
- package/dist/install.js +367 -92
- package/dist/install.js.map +1 -1
- package/dist/runner.d.ts +21 -0
- package/dist/runner.js +181 -18
- package/dist/runner.js.map +1 -1
- package/package.json +24 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 FastTest AI
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# FastTest Agent
|
|
2
|
+
|
|
3
|
+
An MCP server that turns your coding agent into a QA engineer. Test, explore, and break web apps using Playwright -- driven entirely by your AI's reasoning.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npx -y @fasttest-ai/qa-agent install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
FastTest Agent is a [Model Context Protocol](https://modelcontextprotocol.io/) server that gives coding agents (Claude Code, Cursor, Windsurf, VS Code Copilot, Codex) the ability to:
|
|
12
|
+
|
|
13
|
+
- **Test** web applications by driving a real browser
|
|
14
|
+
- **Explore** apps to discover pages, forms, and flows
|
|
15
|
+
- **Heal** broken CSS selectors automatically
|
|
16
|
+
- **Save** tests as reusable suites for CI/CD replay and in editor replay
|
|
17
|
+
- **Break** apps with adversarial inputs (chaos mode)
|
|
18
|
+
|
|
19
|
+
The MCP server provides browser tools and structured prompts.
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Your IDE (Claude Code, Cursor, etc.)
|
|
25
|
+
│
|
|
26
|
+
├── Reasoning (your coding agent)
|
|
27
|
+
│
|
|
28
|
+
└── Tools (this MCP server)
|
|
29
|
+
├── browser_navigate, browser_click, browser_fill, ...
|
|
30
|
+
├── test, explore, chaos, vibe_shield
|
|
31
|
+
├── heal (selector self-repair)
|
|
32
|
+
└── save_suite, run (cloud features)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
1. You say "test the login flow on localhost:3000"
|
|
36
|
+
2. The `test` tool navigates to the URL, captures a page snapshot, and returns testing instructions
|
|
37
|
+
3. Your coding agent reads the snapshot and drives browser tools to execute tests
|
|
38
|
+
4. Results are reported inline. Optionally, save as a suite for CI/CD.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
### Claude Code (recommended)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y @fasttest-ai/qa-agent install
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This registers the MCP server and auto-approves its tools.
|
|
49
|
+
|
|
50
|
+
### Other IDEs
|
|
51
|
+
|
|
52
|
+
Add to your MCP configuration:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"fasttest": {
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": ["-y", "@fasttest-ai/qa-agent"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick start
|
|
66
|
+
|
|
67
|
+
Once installed, just ask your coding agent:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
"Test the login flow on http://localhost:3000"
|
|
71
|
+
"Explore my app at http://localhost:5173 and find all testable flows"
|
|
72
|
+
"Break my app at http://localhost:3000/signup"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Tools
|
|
76
|
+
|
|
77
|
+
### Browser tools (16)
|
|
78
|
+
|
|
79
|
+
Direct Playwright wrappers for page interaction:
|
|
80
|
+
|
|
81
|
+
| Tool | Description |
|
|
82
|
+
| ---------------------------------------- | ------------------------------------------------------------- |
|
|
83
|
+
| `browser_navigate` | Navigate to a URL |
|
|
84
|
+
| `browser_click` | Click an element |
|
|
85
|
+
| `browser_fill` | Fill a form field |
|
|
86
|
+
| `browser_fill_form` | Fill multiple fields at once |
|
|
87
|
+
| `browser_screenshot` | Capture a screenshot |
|
|
88
|
+
| `browser_snapshot` | Get the accessibility tree |
|
|
89
|
+
| `browser_assert` | Run assertions (visible, hidden, text, URL, count, attribute) |
|
|
90
|
+
| `browser_wait` | Wait for an element or timeout |
|
|
91
|
+
| `browser_press_key` | Press keyboard keys |
|
|
92
|
+
| `browser_evaluate` | Execute JavaScript |
|
|
93
|
+
| `browser_console_logs` | Get console log messages |
|
|
94
|
+
| `browser_save_session` | Save cookies/localStorage |
|
|
95
|
+
| `browser_restore_session` | Restore a saved session |
|
|
96
|
+
| `browser_go_back` / `browser_go_forward` | History navigation |
|
|
97
|
+
| `browser_handle_dialog` | Accept/dismiss alerts |
|
|
98
|
+
| `browser_file_upload` | Upload files |
|
|
99
|
+
| `browser_drag` | Drag and drop |
|
|
100
|
+
| `browser_resize` | Resize viewport |
|
|
101
|
+
| `browser_tabs` | Manage browser tabs |
|
|
102
|
+
| `browser_network_requests` | List captured network requests |
|
|
103
|
+
|
|
104
|
+
### Domain tools (14)
|
|
105
|
+
|
|
106
|
+
Higher-level tools that return structured prompts for your coding agent:
|
|
107
|
+
|
|
108
|
+
| Tool | Description |
|
|
109
|
+
| ----------------- | ------------------------------------------------------------------- |
|
|
110
|
+
| `test` | Test a web app (navigates, snapshots, returns testing instructions) |
|
|
111
|
+
| `explore` | Discover pages, forms, and flows |
|
|
112
|
+
| `chaos` | Adversarial testing (XSS, SQL injection, fuzzing) |
|
|
113
|
+
| `vibe_shield` | One-command safety net: explore, generate tests, run regressions |
|
|
114
|
+
| `heal` | Fix broken CSS selectors using multiple strategies |
|
|
115
|
+
| `setup` | Authenticate with FastTest cloud (device auth flow) |
|
|
116
|
+
| `save_suite` | Save tests as a reusable suite |
|
|
117
|
+
| `update_suite` | Update existing test cases |
|
|
118
|
+
| `run` | Execute a saved test suite |
|
|
119
|
+
| `status` | Check execution status |
|
|
120
|
+
| `cancel` | Cancel a running execution |
|
|
121
|
+
| `list_projects` | List QA projects |
|
|
122
|
+
| `list_suites` | List test suites |
|
|
123
|
+
| `health` | Check backend connectivity |
|
|
124
|
+
| `healing_history` | View selector healing patterns |
|
|
125
|
+
|
|
126
|
+
## Cloud features (optional)
|
|
127
|
+
|
|
128
|
+
FastTest Agent works fully offline with browser tools. For persistent test suites, CI/CD replay, regression tracking, and a dashboard, connect to [FastTest Cloud](https://fasttest.ai):
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
> Use the setup tool to connect to FastTest cloud
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
This opens a browser for secure device authentication. Once connected:
|
|
135
|
+
|
|
136
|
+
- `save_suite` persists tests for replay
|
|
137
|
+
- `run` executes suites and tracks regressions
|
|
138
|
+
- `vibe_shield` on subsequent calls shows what broke since last run
|
|
139
|
+
- CI runner (`fasttest-ci`) runs suites in GitHub Actions
|
|
140
|
+
|
|
141
|
+
### CI/CD usage
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
# .github/workflows/tests.yml
|
|
145
|
+
- name: Run FastTest suite
|
|
146
|
+
run: npx -y @fasttest-ai/qa-agent ci --api-key ${{ secrets.FASTTEST_API_KEY }} --suite-id ${{ vars.SUITE_ID }}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Use `{{VAR_NAME}}` placeholders in test steps for secrets (passwords, API keys). The runner resolves them from environment variables at execution time.
|
|
150
|
+
|
|
151
|
+
## CLI flags
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
--api-key <key> Organization API key
|
|
155
|
+
--base-url <url> Cloud API URL (default: https://api.fasttest.ai)
|
|
156
|
+
--headed Show browser window (debug mode)
|
|
157
|
+
--browser <type> chromium | firefox | webkit (default: chromium)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Architecture
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
local-skill/
|
|
164
|
+
src/
|
|
165
|
+
index.ts MCP server — tool registration and routing
|
|
166
|
+
browser.ts Playwright lifecycle, sessions, dialogs
|
|
167
|
+
actions.ts Browser action wrappers (navigate, click, fill, etc.)
|
|
168
|
+
runner.ts Test execution orchestrator
|
|
169
|
+
healer.ts Selector healing cascade
|
|
170
|
+
cloud.ts HTTPS client to FastTest cloud API
|
|
171
|
+
config.ts Config file management (~/.fasttest/)
|
|
172
|
+
variables.ts {{VAR}} placeholder resolution
|
|
173
|
+
cli.ts CI runner (no MCP dependency)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Key design principle: **the MCP server never calls an LLM**. Your coding agent drives all browser interactions using its own reasoning. The server provides tools and structured prompts.
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm install
|
|
182
|
+
npm run build # Compile TypeScript
|
|
183
|
+
npm run dev # Watch mode
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
Apache-2.0
|
package/dist/actions.d.ts
CHANGED
package/dist/actions.js
CHANGED
package/dist/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAU,EAAE,GAAW;IACpD,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CA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,KAAK,EAAE,CAAC;gBAClC,IAAI,OAAO,KAAK,CAAC;oBAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;gBACtE,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;gBACvE,OAAO,EAAE,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC;YACnE,CAAC;YACD;gBACE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5E,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface BrowserManagerOptions {
|
|
|
17
17
|
headless?: boolean;
|
|
18
18
|
orgSlug?: string;
|
|
19
19
|
}
|
|
20
|
+
/** Sanitize a name to prevent path traversal (used for session names and org slugs). */
|
|
21
|
+
export declare function sanitizePath(name: string): string;
|
|
20
22
|
export interface PendingDialog {
|
|
21
23
|
type: string;
|
|
22
24
|
message: string;
|
|
@@ -31,7 +33,7 @@ export declare class BrowserManager {
|
|
|
31
33
|
private browserType;
|
|
32
34
|
private headless;
|
|
33
35
|
private orgSlug;
|
|
34
|
-
pendingDialog
|
|
36
|
+
private pendingDialog;
|
|
35
37
|
private networkEntries;
|
|
36
38
|
constructor(options?: BrowserManagerOptions);
|
|
37
39
|
ensureBrowser(): Promise<Page>;
|
package/dist/browser.js
CHANGED
|
@@ -3,13 +3,18 @@
|
|
|
3
3
|
* Manages browser contexts and pages with session persistence.
|
|
4
4
|
*/
|
|
5
5
|
import { chromium, firefox, webkit } from "playwright";
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
6
7
|
import * as fs from "node:fs";
|
|
7
8
|
import * as path from "node:path";
|
|
8
9
|
import * as os from "node:os";
|
|
9
10
|
const SESSION_DIR = path.join(os.homedir(), ".fasttest", "sessions");
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** Windows reserved device names that cannot be used as file/directory names. */
|
|
12
|
+
const WINDOWS_RESERVED = /^(con|prn|aux|nul|com\d|lpt\d)$/i;
|
|
13
|
+
/** Sanitize a name to prevent path traversal (used for session names and org slugs). */
|
|
14
|
+
export function sanitizePath(name) {
|
|
15
|
+
const cleaned = name.replace(/[\/\\]/g, "_").replace(/\.\./g, "_").replace(/\0/g, "").replace(/^_+|_+$/g, "") || "default";
|
|
16
|
+
// Guard against Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9)
|
|
17
|
+
return WINDOWS_RESERVED.test(cleaned) ? `_${cleaned}` : cleaned;
|
|
13
18
|
}
|
|
14
19
|
export class BrowserManager {
|
|
15
20
|
browser = null;
|
|
@@ -23,7 +28,7 @@ export class BrowserManager {
|
|
|
23
28
|
constructor(options = {}) {
|
|
24
29
|
this.browserType = options.browserType ?? "chromium";
|
|
25
30
|
this.headless = options.headless ?? true;
|
|
26
|
-
this.orgSlug = options.orgSlug ?? "default";
|
|
31
|
+
this.orgSlug = sanitizePath(options.orgSlug ?? "default");
|
|
27
32
|
}
|
|
28
33
|
async ensureBrowser() {
|
|
29
34
|
// Quick health check: verify existing page is actually alive
|
|
@@ -45,10 +50,28 @@ export class BrowserManager {
|
|
|
45
50
|
: this.browserType === "webkit"
|
|
46
51
|
? webkit
|
|
47
52
|
: chromium;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
try {
|
|
54
|
+
this.browser = await launcher.launch({
|
|
55
|
+
headless: this.headless,
|
|
56
|
+
args: this.browserType === "chromium" ? ["--disable-blink-features=AutomationControlled"] : [],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
61
|
+
if (msg.includes("Executable doesn't exist") || msg.includes("browserType.launch")) {
|
|
62
|
+
const npx = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
63
|
+
execFileSync(npx, ["playwright", "install", "--with-deps", this.browserType], {
|
|
64
|
+
stdio: "inherit",
|
|
65
|
+
});
|
|
66
|
+
this.browser = await launcher.launch({
|
|
67
|
+
headless: this.headless,
|
|
68
|
+
args: this.browserType === "chromium" ? ["--disable-blink-features=AutomationControlled"] : [],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
52
75
|
}
|
|
53
76
|
if (!this.context) {
|
|
54
77
|
this.context = await this.browser.newContext({
|
|
@@ -88,7 +111,7 @@ export class BrowserManager {
|
|
|
88
111
|
if (!this.context) {
|
|
89
112
|
throw new Error("No browser context — nothing to save");
|
|
90
113
|
}
|
|
91
|
-
const safeName =
|
|
114
|
+
const safeName = sanitizePath(name);
|
|
92
115
|
const dir = path.join(SESSION_DIR, this.orgSlug);
|
|
93
116
|
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
94
117
|
const filePath = path.join(dir, `${safeName}.json`);
|
|
@@ -97,7 +120,7 @@ export class BrowserManager {
|
|
|
97
120
|
return filePath;
|
|
98
121
|
}
|
|
99
122
|
async restoreSession(name) {
|
|
100
|
-
const safeName =
|
|
123
|
+
const safeName = sanitizePath(name);
|
|
101
124
|
const filePath = path.join(SESSION_DIR, this.orgSlug, `${safeName}.json`);
|
|
102
125
|
if (!fs.existsSync(filePath)) {
|
|
103
126
|
throw new Error(`Session "${name}" not found at ${filePath}`);
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","s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AAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;CACF"}
|
package/dist/cli.js
CHANGED
|
@@ -16,9 +16,22 @@
|
|
|
16
16
|
* --test-case-ids Comma-separated test case IDs to run (default: all)
|
|
17
17
|
* --json Output results as JSON instead of formatted text
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { readFileSync } from "node:fs";
|
|
20
|
+
import { join, dirname } from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
import { BrowserManager, sanitizePath } from "./browser.js";
|
|
20
23
|
import { CloudClient } from "./cloud.js";
|
|
21
24
|
import { executeRun } from "./runner.js";
|
|
25
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
const PKG_VERSION = (() => {
|
|
27
|
+
try {
|
|
28
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
29
|
+
return pkg.version ?? "0.0.0";
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return "0.0.0";
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
22
35
|
function parseCliArgs() {
|
|
23
36
|
const args = process.argv.slice(2);
|
|
24
37
|
let apiKey = "";
|
|
@@ -97,7 +110,7 @@ function printFormattedResults(summary) {
|
|
|
97
110
|
// ---------------------------------------------------------------------------
|
|
98
111
|
async function main() {
|
|
99
112
|
const config = parseCliArgs();
|
|
100
|
-
const orgSlug = config.apiKey.split("_")[1] ?? "default";
|
|
113
|
+
const orgSlug = sanitizePath(config.apiKey.split("_")[1] ?? "default");
|
|
101
114
|
const browserMgr = new BrowserManager({
|
|
102
115
|
browserType: config.browser,
|
|
103
116
|
headless: true,
|
|
@@ -108,7 +121,7 @@ async function main() {
|
|
|
108
121
|
baseUrl: config.baseUrl,
|
|
109
122
|
});
|
|
110
123
|
const consoleLogs = [];
|
|
111
|
-
console.log(
|
|
124
|
+
console.log(`FastTest CI Runner v${PKG_VERSION}`);
|
|
112
125
|
console.log(`Suite: ${config.suiteId}`);
|
|
113
126
|
console.log(`Browser: ${config.browser}`);
|
|
114
127
|
if (config.appUrl)
|