Skip to content

Commit 50840b2

Browse files
panayot-cankovpanayot-cankov
andauthored
chore: mcp for qa workflows (#28)
* chore: mcp for qa workflows * chore: add semantic objects * chore: add test-website, minor WebDriver protocol fixes, add express server * chore: bump to node 24 * feat: example using semantic objects * chore: simplified semantic objects authoring, support jsx snapshots * feat: comprehensive TypeScript strict typing and Node.js 22+ modernization - Complete elimination of :any types throughout codebase - Replace all any with unknown and proper interfaces for strict typing - Modernize to Node.js 22+ native AbortSignal.any() without conditionals - Implement ECMAScript 2024 Explicit Resource Management with Symbol.asyncDispose - Standardize Vitest to ^3.2.0 across all packages for consistency - Fix semantic discovery script generation with module import cleaning - Resolve port conflicts with dedicated environments (3000/5032 vs 3002/5033) - Remove emojis and maintain professional code standards - Migrate jest-web to vitest-web for framework consistency - Add comprehensive TypeScript declaration files - Ensure all tests pass with clean execution All objectives achieved: strict typing, modern Node.js features, robust infrastructure * feat: migrate from Lerna to Nx monorepo management - Install Nx 22.0.1 alongside existing Lerna setup - Add comprehensive nx.json configuration with intelligent caching - Configure targetDefaults for build, test, and prepare tasks - Set up proper cache inputs/outputs for TypeScript compilation - Replace lerna run commands with nx run-many for better performance - Add affected change detection commands (test:affected, build:affected) - Include dependency graph visualization and workspace utilities - Remove lerna.json as Nx now handles monorepo orchestration - Maintain existing publishing workflow through lerna commands - Enable intelligent build caching and parallel execution Benefits achieved: - Faster builds with intelligent caching (cache hits already observed) - Better dependency tracking and affected change detection - Parallel task execution with optimal scheduling - Visual dependency graph and workspace insights - Maintained compatibility with existing workflows * feat: complete migration from Lerna to Nx with semantic versioning - Remove Lerna dependency and configuration completely - Configure Nx release with conventional commits and independent versioning - Add @nx/js plugin for TypeScript/JavaScript release functionality - Update GitHub workflows to use Nx release instead of Lerna publish - Configure proper npm authentication and registry settings - Add intelligent caching and affected change detection to CI/CD - Enable automatic changelog generation and git tagging - Maintain semantic versioning with conventional commit standards Migration benefits: - Unified toolchain: build, test, and release all through Nx - Better caching and parallelization in CI/CD pipelines - Intelligent affected change detection for faster builds - Automatic changelog generation with conventional commits - Independent package versioning with proper git tagging - Streamlined publishing workflow with semantic release * feat: reorganizing the mcp - Add configurable ChromeDriver port support (default: 9515) - Restructure monolithic roadkill-mcp.ts into modular mcp/ architecture - Add VS Code MCP configuration documentation - Clean up Unicode arrows for better cross-platform compatibility - Modernize TypeScript strict typing and Node.js 22+ features - Implement proper ECMAScript 2024 resource management patterns * chore: add reexporting index.ts * Refactor MCP tools and improve test reliability - Move framework tools to mcp/reference.ts with reference.api and reference.example - Remove all semantic tools while keeping file structure - Remove step wrapper functions from all test files for cleaner async code - Add timeout methods to Session and WebDriverClient with signal support - Add comprehensive PageLoadStrategy documentation with usage guidance - Fix w3schools test hanging with PageLoadStrategy.none and click timeouts - Remove utils module and fix related imports - Remove test script from main package (no test files remaining) - All tests now pass reliably without hanging issues * Remove flaky external test examples - Delete selenium-interop and vitest-web examples (w3schools tests) - Update workspace configuration to only include stable test-website - Clean up package-lock.json dependencies - Focus on reliable local test examples only * feat: enhance DOM snapshot with HTML format and self-closing tags - Add HTML format output option for cleaner readability - Implement self-closing tag optimization for empty elements - Remove depth/children/text length limits for complete DOM capture - Maintain comprehensive whitespace normalization - Preserve all existing optimizations (no double newlines, clean formatting) * chore: clean up test dom * chore: keep dom-test-selector and dom-snapshot * chore: Rremove .js extensions and don't mention semantic obects * chore: Add MCP utilities for dom snapshot and selector exploration * chore: build all * chore: run all tests always, avoid nx cache * chore: build & test * chore: enable ci linux ui --------- Co-authored-by: panayot-cankov <[email protected]>
1 parent c966979 commit 50840b2

Some content is hidden

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

53 files changed

+12877
-11716
lines changed

.github/workflows/CD.yml

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
packages: read
1515

1616
steps:
17-
- uses: actions/setup-node@v3
18-
with:
19-
node-version: ^18.17
2017
- name: import secrets
2118
id: import-secrets
2219
uses: LanceMcCarthy/akeyless-action@v3
@@ -28,22 +25,70 @@ jobs:
2825
"/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN"
2926
}
3027
export-secrets-to-environment: false
28+
3129
- name: git config
3230
run: |
3331
git config --global user.email "[email protected]"
3432
git config --global user.name "kendo-bot"
33+
3534
- name: git checkout
3635
uses: actions/checkout@v4
3736
with:
3837
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}
38+
fetch-depth: 0 # Needed for Nx affected commands and release
39+
40+
- uses: actions/setup-node@v3
41+
with:
42+
node-version: ^24.1
43+
cache: 'npm'
44+
45+
# Setup Nx cache for faster builds
46+
- name: Setup Nx cache
47+
uses: actions/cache@v3
48+
with:
49+
path: |
50+
node_modules/.cache/nx
51+
.nx/cache
52+
key: ${{ runner.os }}-nx-${{ hashFiles('**/package-lock.json') }}
53+
restore-keys: |
54+
${{ runner.os }}-nx-
55+
3956
- name: install virtual display
40-
run: sudo apt-get install xvfb
57+
run: |
58+
sudo apt-get update
59+
sudo apt-get install -y xvfb fluxbox x11-utils
60+
61+
- name: setup virtual display
62+
run: |
63+
# Start Xvfb with full HD resolution
64+
export DISPLAY=:99
65+
Xvfb :99 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &
66+
# Wait for display to be ready
67+
sleep 3
68+
# Start a window manager for better compatibility
69+
fluxbox -display :99 &
70+
# Verify display is working
71+
xdpyinfo -display :99 | grep dimensions
72+
env:
73+
DISPLAY: :99
74+
4175
- name: npm install
4276
run: npm ci
43-
- name: npm test
44-
run: xvfb-run --auto-servernum npm test
45-
- name: lerna publish
46-
run: npm run lerna:publish
77+
78+
# Build all projects to ensure everything is ready for publishing
79+
- name: build all
80+
run: npm run build
81+
82+
# Test all projects to ensure quality before publishing
83+
- name: test all
84+
run: npm test
85+
env:
86+
DISPLAY: :99
87+
88+
# Nx handles versioning and publishing with semantic versioning
89+
- name: nx release
90+
run: npm run release
4791
env:
4892
NPM_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}
4993
GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }}
94+
NODE_AUTH_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}

.github/workflows/CI.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,59 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Needed for Nx affected commands
1416
- uses: actions/setup-node@v3
1517
with:
16-
node-version: ^18.17
18+
node-version: ^24.1
19+
cache: 'npm'
20+
21+
# Setup Nx cache for faster builds
22+
- name: Setup Nx cache
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
node_modules/.cache/nx
27+
.nx/cache
28+
key: ${{ runner.os }}-nx-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-nx-
31+
1732
- name: install virtual display
18-
run: sudo apt-get install xvfb
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y xvfb fluxbox x11-utils
36+
37+
- name: setup virtual display
38+
run: |
39+
# Start Xvfb with full HD resolution
40+
export DISPLAY=:99
41+
Xvfb :99 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &
42+
# Wait for display to be ready
43+
sleep 3
44+
# Start a window manager for better compatibility
45+
fluxbox -display :99 &
46+
# Verify display is working
47+
xdpyinfo -display :99 | grep dimensions
48+
env:
49+
DISPLAY: :99
50+
1951
- name: npm install
2052
run: npm ci
21-
- name: npm test
22-
run: xvfb-run --auto-servernum npm test
53+
54+
# Build all projects
55+
- name: build all
56+
run: npm run build
57+
58+
# Test all projects
59+
- name: test all
60+
run: npm run test
61+
env:
62+
DISPLAY: :99
63+
2364
- name: npm pack
2465
run: npm pack --ws
66+
2567
- name: upload artefacts
2668
uses: actions/upload-artifact@v4
2769
with:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,10 @@ dist
133133
.yarn/build-state.yml
134134
.yarn/install-state.gz
135135
.pnp.*
136+
137+
138+
139+
.nx/cache
140+
.nx/workspace-data
141+
.cursor/rules/nx-rules.mdc
142+
.github/instructions/nx.instructions.md

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"files.exclude": {
33
"**/*.js": true,
4-
"**/*.js.map": true
4+
"**/*.js.map": true,
5+
"**/*.d.ts": true
6+
},
7+
"search.exclude": {
8+
"**/*.js": true,
9+
"**/*.js.map": true,
10+
"**/*.d.ts": true
511
}
612
}

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,40 @@
77

88
A [node.js](https://nodejs.org/en) testing solution over the [WebDriver](https://www.w3.org/TR/webdriver2/) protocol. Will also consider [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/).
99

10+
## Requirements
11+
12+
- **Node.js 22+** (required for ECMAScript 2024 Explicit Resource Management)
13+
- **TypeScript 5.2+** (for native Disposable support)
14+
1015
Powered by:
16+
- [Vitest](https://vitest.dev) - Fast unit test framework
1117
- [TypeScript](https://www.typescriptlang.org)
1218
- [Promise based](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
1319
- [Errors with causes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause)
1420
- [AbortSignals](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)
21+
- [ECMAScript 2024 Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)
1522
- all the fancy tech...
1623

1724
A [WebDriver](https://www.w3.org/TR/webdriver2/) based slim testing framework. Closes the gaps between QAs and Front-End developers by:
1825

1926
- Sharing the same TypeScript or JavaScript language with ***Angular***, ***React*** and ***Vue*** front-end developers
2027
- Stay within the [nodejs](https://nodejs.org/en) ecosystem
2128
- Skill-transfer between QAs and Front-End devs
22-
- Share the lightweight VSCode IDE
23-
- Compile-time type-checking
29+
- **ECMAScript 2024 Only** - Pure symbol-based disposables, no legacy methods
30+
- **Node.js 22+ Required** - Cutting-edge JavaScript runtime features
31+
- **Zero Backward Compatibility** - Clean slate approach
32+
33+
## AI-Powered DOM Analysis
34+
35+
Roadkill includes advanced DOM snapshot capabilities designed for AI assistants like GitHub Copilot. The `dom-snapshot` and `dom-test-selector` tools provide comprehensive page structure analysis to help craft robust selectors:
36+
37+
- **`dom-snapshot`**: Captures complete DOM structure with element positioning, visibility states, and semantic information
38+
- **`dom-test-selector`**: Tests CSS/XPath selectors and shows element hierarchy with matches, parents, and children
39+
- **AI Integration**: Optimized for Copilot to understand page layout and suggest stable, maintainable selectors
40+
- **Intelligent Filtering**: Automatically excludes non-essential elements (style, script tags) for cleaner analysis
41+
- **Multiple Formats**: Supports both HTML and JSON output formats for different AI processing needs
42+
43+
**Note**: Large HTML pages may trigger chat summarization in AI assistants due to content length limits. For complex pages, consider using specific root selectors to focus analysis on relevant sections.
2444

2545
## Demo
2646
To run the demo code, clone the repo, execute the ***[./packages/@progress/roadkill/example.ts](./packages/@progress/roadkill/example.ts)*** by running:

examples/jest-web/CHANGELOG.md

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

examples/jest-web/package.json

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

examples/jest-web/tsconfig.json

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

0 commit comments

Comments
 (0)