Skip to content

Commit 6119cf2

Browse files
authored
chore(e2e): Add Makefile to make running specific e2e test apps easier (#18953)
We have many e2e test apps and it can be cumbersome to type in which exact app you want to run. This PR adds a Makefile that uses `fzf` to give a better experience: https://github.com/user-attachments/assets/8fe472a6-34ac-4311-81aa-e8d384e51760 Note: Requires having `fzf` installed via `brew install fzf` or other package managers.
1 parent 58d3206 commit 6119cf2

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

dev-packages/e2e-tests/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: run list
2+
3+
run:
4+
@if ! command -v fzf &> /dev/null; then \
5+
echo "Error: fzf is required. Install with: brew install fzf"; \
6+
exit 1; \
7+
fi
8+
@ls test-applications | fzf --height=10 --layout=reverse --border=rounded --margin=1.5% --color=dark --prompt="yarn test:run " | xargs -r yarn test:run
9+
10+
list:
11+
@ls test-applications

dev-packages/e2e-tests/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ yarn test:run <app-name> --variant <variant-name>
3333

3434
Variant name matching is case-insensitive and partial. For example, `--variant 13` will match `nextjs-pages-dir (next@13)` if a matching variant is present in the test app's `package.json`.
3535

36+
### Using the Makefile
37+
38+
Alternatively, you can use the provided Makefile for an interactive test selection experience:
39+
40+
**Prerequisites**: Install `fzf` with Homebrew:
41+
42+
```bash
43+
brew install fzf
44+
```
45+
46+
**Run tests interactively**:
47+
48+
```bash
49+
make run
50+
```
51+
52+
This will display a fuzzy-finder menu of all available test applications. Select one to run it automatically.
53+
54+
**List all test applications**:
55+
56+
```bash
57+
make list
58+
```
59+
3660
For example, if you have the following variants in your test app's `package.json`:
3761

3862
```json

0 commit comments

Comments
 (0)