Skip to content

Commit 4e2bc05

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/lit/context-1.1.3
2 parents f8ff608 + 811532f commit 4e2bc05

92 files changed

Lines changed: 14114 additions & 9013 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: '/'
5-
schedule:
6-
interval: weekly
7-
open-pull-requests-limit: 10
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
time: "11:00"
8+
open-pull-requests-limit: 10
9+
versioning-strategy: increase-if-necessary
10+
groups:
11+
patch-deps-updates:
12+
update-types:
13+
- "patch"
14+
minor-deps-updates:
15+
update-types:
16+
- "minor"
17+
major-deps-updates:
18+
update-types:
19+
- "major"
20+
- package-ecosystem: github-actions
21+
directory: "/"
22+
schedule:
23+
interval: weekly
24+
time: "11:00"
25+
open-pull-requests-limit: 10
26+
groups:
27+
patch-deps-updates:
28+
update-types:
29+
- "patch"
30+
minor-deps-updates:
31+
update-types:
32+
- "minor"
33+
major-deps-updates:
34+
update-types:
35+
- "major"

.github/workflows/ci.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,30 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14-
strategy:
15-
matrix:
16-
node-version: [20.x]
17-
1814
steps:
19-
- uses: actions/checkout@v3
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
15+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16+
- name: Use Node.js
17+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2218
with:
23-
node-version: ${{ matrix.node-version }}
19+
node-version-file: .nvmrc
2420
- name: Cache pnpm modules
25-
uses: actions/cache@v3
21+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
2622
env:
2723
cache-name: cache-pnpm-modules
2824
with:
2925
path: ~/.pnpm-store
3026
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3127
restore-keys: |
3228
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
33-
- uses: pnpm/action-setup@v2
29+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
3430
with:
3531
version: 8.8.0
3632
run_install: false
33+
- name: Install dependencies
34+
run: pnpm install
35+
- name: Lint
36+
run: pnpm lint
3737
- name: 📦 Bundle
38-
run: pnpm test
38+
run: pnpm -r --workspace-concurrency=1 build
3939
- name: 🧪 Run Tests
4040
run: pnpm test
41-
- name: 🐛 Debug Build
42-
uses: stateful/vscode-server-action@v1
43-
if: failure()
44-
with:
45-
timeout: '120000'

.github/workflows/release.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,40 @@ on:
1818
default: 'latest'
1919

2020
env:
21-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
21+
NPM_CONFIG_PROVENANCE: true
2222

2323
jobs:
2424
release:
2525
runs-on: ubuntu-latest
26+
permissions:
27+
contents: write
28+
id-token: write
2629
steps:
27-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2831
with:
2932
ref: 'main'
3033
fetch-depth: 0
31-
- run: |
32-
echo "Not yet ready!"
33-
exit 1
34-
# - uses: actions/setup-node@v3
35-
# with:
36-
# node-version: 16.x
37-
# - uses: pnpm/action-setup@v2
38-
# with:
39-
# version: 8.8.0
40-
# run_install: true
41-
# - name: NPM Setup
42-
# run: |
43-
# pnpm set registry "https://registry.npmjs.org/"
44-
# pnpm set //registry.npmjs.org/:_authToken $NPM_TOKEN
45-
# pnpm whoami
46-
# - name: Git Setup
47-
# run: |
48-
# git config --global user.email "[email protected]"
49-
# git config --global user.name "WebdriverIO Release Bot"
50-
# - name: Install Dependencies
51-
# run: pnpm install --frozen-lockfile
52-
# - name: Build
53-
# run: pnpm build
54-
# - name: Release
55-
# run: pnpm run release:ci -- ${{github.event.inputs.releaseType}}
56-
# env:
57-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
35+
with:
36+
node-version-file: .nvmrc
37+
registry-url: "https://registry.npmjs.org"
38+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
39+
with:
40+
version: 10.26.1
41+
run_install: true
42+
- name: Git Setup
43+
run: |
44+
git config --global user.email "[email protected]"
45+
git config --global user.name "WebdriverIO Release Bot"
46+
- name: Install Dependencies
47+
run: pnpm install
48+
- name: Build
49+
run: |
50+
pnpm --filter "@wdio/devtools-backend" build
51+
pnpm --filter "@wdio/devtools-script" build
52+
pnpm --filter "@wdio/devtools-service" build
53+
pnpm --filter "@wdio/devtools-app" build
54+
- name: Release
55+
run: pnpm -r publish --access public --no-git-checks
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
steps:
2020
- name: Fetch PR metadata
2121
id: metadata
22-
uses: dependabot/fetch-metadata@v1.6.0
22+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
2323
with:
2424
github-token: ${{ secrets.GITHUB_TOKEN }}
2525

2626
- name: Wait for PR CI
2727
# Don't merge updates to GitHub Actions versions automatically.
2828
# (Some repos may wish to limit by version range (major/minor/patch), or scope (dep vs dev-dep), too.)
2929
if: contains(steps.metadata.outputs.package-ecosystem, 'npm')
30-
uses: lewagon/wait-on-check-action@v1.3.1
30+
uses: lewagon/wait-on-check-action@3603e826ee561ea102b58accb5ea55a1a7482343 # v1.4.1
3131
with:
3232
ref: ${{ github.event.pull_request.head.sha }}
3333
repo-token: ${{ secrets.GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.8.1
1+
v24

README.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,125 @@
1-
# devtools
2-
Browser devtools extension for debugging WebdriverIO tests
1+
# WebdriverIO DevTools
2+
3+
A powerful browser devtools extension for debugging, visualizing, and controlling WebdriverIO test executions in real-time.
4+
5+
## Features
6+
7+
### 🎯 Interactive Test Execution
8+
- **Selective Test Rerun**: Click play buttons on individual test cases, test suites, or Cucumber scenario examples to re-execute them instantly
9+
- **Smart Browser Reuse**: Tests rerun in the same browser window without opening new tabs, improving performance and user experience
10+
- **Stop Test Execution**: Terminate running tests with proper process cleanup using the stop button
11+
- **Test List Preservation**: All tests remain visible in the sidebar during reruns, maintaining full context
12+
13+
### 🎭 Multi-Framework Support
14+
- **Mocha**: Full support with grep-based filtering for test/suite execution
15+
- **Jasmine**: Complete integration with grep-based filtering
16+
- **Cucumber**: Scenario-level and example-specific execution with feature:line targeting
17+
18+
### 📊 Real-Time Visualization
19+
- **Live Browser Preview**: View the application under test in a scaled iframe with automatic screenshot updates
20+
- **Actions Timeline**: Command-by-command execution log with timestamps and parameters
21+
- **Test Hierarchy**: Nested test suite and test case tree view with status indicators
22+
- **Live Status Updates**: Immediate spinner icons and visual feedback when tests start/stop
23+
24+
### 🧐 Debugging Capabilities
25+
- **Command Logging**: Detailed capture of all WebDriver commands with arguments and results
26+
- **Screenshot Capture**: Automatic screenshots after each command for visual debugging
27+
- **Source Code Mapping**: View the exact line of code that triggered each command
28+
- **Console Logs**: Capture and display application console output with timestamps and log levels
29+
- **Network Logs**: Monitor and inspect HTTP requests/responses including headers, payloads, timing, and status codes
30+
- **Error Tracking**: Full error messages and stack traces for failed tests
31+
32+
### 🎮 Execution Controls
33+
- **Global Test Running State**: All play buttons automatically disable during test execution to prevent conflicts
34+
- **Immediate Feedback**: Spinner icons update instantly when tests start
35+
- **Actions Tab Auto-Clear**: Execution data automatically clears and refreshes on reruns
36+
- **Metadata Tracking**: Test duration, status, and execution timestamps
37+
38+
### 🔍︎ TestLens
39+
- **Code Intelligence**: View test definitions directly in your editor
40+
- **Run/Debug Actions**: Execute individual tests or suites with inline CodeLens actions
41+
- **Quick Navigation**: Jump between test code and execution results seamlessly
42+
- **Status Indicators**: Visual feedback for test pass/fail states in the editor
43+
44+
### 🏗️ Architecture
45+
- **Frontend**: Lit web components with reactive state management (@lit/context)
46+
- **Backend**: Fastify server with WebSocket streaming for real-time updates
47+
- **Service**: WebdriverIO reporter integration with stable UID generation
48+
- **Process Management**: Tree-kill for proper cleanup of spawned processes
49+
50+
## Demo
51+
52+
### 🛠️ Test Rerunner & Snapshot
53+
<img src="https://github.com/user-attachments/assets/c3804559-c0ec-441a-80dc-e4048385f3b2" alt="Test Rerunner & Snapshot Demo" width="400" />
54+
55+
### 🛑 Stop Test Runner
56+
<img src="https://github.com/user-attachments/assets/f42e43ed-bfac-4280-be5f-87895fb232d3" alt="Stop Test Runner Demo" width="400" />
57+
58+
### 🔍︎ TestLens
59+
<img src="https://github.com/user-attachments/assets/72c576a1-330a-49c4-affe-df260e7c70df" alt="TestLens Demo" width="400" />
60+
61+
### >_ Console Logs
62+
<img src="https://github.com/user-attachments/assets/aff14f15-a298-4a12-bc3d-8e4deefddae6" alt="Console Logs" width="400" />
63+
64+
### 🌐 Network Logs
65+
<img src="https://github.com/user-attachments/assets/2cca4885-f989-4d07-b7ce-a4fa476c3c1c" alt="Network Logs 1" width="400" />
66+
67+
<img src="https://github.com/user-attachments/assets/0f81e0af-75b5-454f-bffb-e40654c89908" alt="Network Logs 2" width="400" />
68+
69+
## Installation
70+
71+
```bash
72+
npm install @wdio/devtools-service
73+
```
74+
75+
## Configuration
76+
77+
Add the service to your `wdio.conf.js`:
78+
79+
```javascript
80+
export const config = {
81+
// ...
82+
services: ['devtools']
83+
}
84+
```
85+
86+
## Usage
87+
88+
1. Run your WebdriverIO tests
89+
2. The devtools UI automatically opens in an external browser window at `http://localhost:3000`
90+
3. Tests begin executing immediately with real-time visualization
91+
4. View live browser preview, test progress, and command execution
92+
5. After initial run completes, use play buttons to rerun individual tests or suites
93+
6. Click stop button anytime to terminate running tests
94+
7. Explore actions, metadata, console logs, and source code in the workbench tabs
95+
96+
## Development
97+
98+
```bash
99+
# Install dependencies
100+
pnpm install
101+
102+
# Build all packages
103+
pnpm build
104+
105+
# Run demo
106+
pnpm demo
107+
```
108+
109+
## Project Structure
110+
111+
```
112+
packages/
113+
├── app/ # Frontend Lit-based UI application
114+
├── backend/ # Fastify server with test runner management
115+
├── service/ # WebdriverIO service and reporter
116+
└── script/ # Browser-injected trace collection script
117+
```
118+
119+
## Contributing
120+
121+
Contributions are welcome! Please feel free to submit a Pull Request.
122+
123+
## :page_facing_up: License
124+
125+
[MIT](/LICENSE)

0 commit comments

Comments
 (0)