Skip to content

Commit 17900d0

Browse files
committed
feat(cypress): Add cursor commands for incidents test generation
1 parent 9ee9b8e commit 17900d0

File tree

8 files changed

+1686
-4
lines changed

8 files changed

+1686
-4
lines changed

.cursor/commands/generate-regression-test.md

Lines changed: 643 additions & 0 deletions
Large diffs are not rendered by default.

.cursor/commands/refactor-regression-test.md

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.

.cursor/rules/incidents-testing-guidelines.mdc

Lines changed: 558 additions & 0 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ web/cypress/screenshots/
44
web/cypress/export-env.sh
55
web/screenshots/
66
web/cypress/videos/
7+
web/cypress/fixtures/incidents/test-docs/
78
web/dist/
89
web/node_modules/
910
plugin-backend

.gitmodules

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

web/cypress/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,15 @@ cypress/
428428

429429
---
430430

431+
### Optional Test Documentation Submodule
432+
433+
An optional submodule at `fixtures/incidents/test-docs/` contains AI-enhanced test development documentation. It's only needed for local development and not required for CI/CD.
434+
435+
To enable it locally:
436+
```bash
437+
./fixtures/incidents/setup-test-docs-submodule.sh
438+
```
439+
440+
---
441+
431442
*For questions about test architecture, creating tests, or testing workflows, refer to [CYPRESS_TESTING_GUIDE.md](CYPRESS_TESTING_GUIDE.md)*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SUBMODULE_PATH="web/cypress/fixtures/incidents/test-docs"
5+
SUBMODULE_URL="[email protected]:drajnoha/cat-test-docs.git"
6+
7+
echo "Setting up optional test-docs submodule..."
8+
9+
# Check if it's a valid git repository
10+
if [ -d "$SUBMODULE_PATH/.git" ] || [ -f "$SUBMODULE_PATH/.git" ]; then
11+
echo "✓ Repository already exists at $SUBMODULE_PATH"
12+
cd "$SUBMODULE_PATH"
13+
14+
# Handle case where .git is a file (submodule gitdir reference)
15+
if [ -f ".git" ]; then
16+
echo "Converting old submodule format to regular repository..."
17+
# Read the gitdir path from .git file
18+
GITDIR=$(cat .git | sed 's/gitdir: //')
19+
# Move the git directory here
20+
if [ -d "../../../../../../$GITDIR" ]; then
21+
mv "../../../../../../$GITDIR" .git
22+
fi
23+
fi
24+
25+
git pull
26+
echo "✓ Updated to latest version"
27+
else
28+
# Directory might exist but not be a git repo
29+
if [ -d "$SUBMODULE_PATH" ]; then
30+
echo "Removing non-git directory at $SUBMODULE_PATH..."
31+
rm -rf "$SUBMODULE_PATH"
32+
fi
33+
34+
# Clone the repository
35+
echo "Cloning test documentation..."
36+
git clone "$SUBMODULE_URL" "$SUBMODULE_PATH"
37+
38+
# Configure it as a submodule in local .git/config (optional, for git submodule commands to work)
39+
git config -f .git/config submodule.$SUBMODULE_PATH.url "$SUBMODULE_URL"
40+
git config -f .git/config submodule.$SUBMODULE_PATH.path "$SUBMODULE_PATH"
41+
git config -f .git/config submodule.$SUBMODULE_PATH.active true
42+
43+
echo "✓ Test documentation submodule setup complete!"
44+
fi
45+
46+
echo " Location: $SUBMODULE_PATH/"
47+
echo " (This directory is in .gitignore and won't be committed)"
Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)