Skip to content

Commit 509ebb3

Browse files
DavidRajnohaclaude
andcommitted
refactor: reorganize claude commands and docs directory structure
- Rename cypress-run.md → run.md, cypress-setup.md → setup.md - Move test development commands to cypress/test-development/ as symlinks - Remove old command symlinks from commands root - Add clean-test-artifacts.sh utility script Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 51f9df7 commit 509ebb3

14 files changed

Lines changed: 104 additions & 84 deletions

.claude/commands/cypress/cypress-setup.md

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: cypress-run
2+
name: run
33
description: Display Cypress test commands - choose execution mode (headless recommended)
44
parameters:
55
- name: execution-mode
@@ -11,8 +11,8 @@ parameters:
1111
# Cypress Test Commands
1212

1313
**Prerequisites**:
14-
1. Run `/cypress-setup` first to configure your environment.
15-
2. Ensure the "Cypress Tests" terminal window is open (created by `/cypress-setup`)
14+
1. Run `/cypress:setup` first to configure your environment.
15+
2. Ensure the "Cypress Tests" terminal window is open (created by `/cypress:setup`)
1616

1717
**Note**: All commands are executed in the "Cypress Tests" terminal window using the helper scripts.
1818

@@ -340,7 +340,7 @@ Use these tags with `--env grepTags`:
340340

341341
## Related Commands
342342

343-
- **`/cypress-setup`** - Configure testing environment and open Cypress Tests terminal
343+
- **`/cypress:setup`** - Configure testing environment and open Cypress Tests terminal
344344

345345
---
346346

.claude/commands/cypress/setup.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: setup
3+
description: Automated Cypress environment setup with direct configuration
4+
parameters: []
5+
---
6+
7+
# Cypress Environment Setup
8+
9+
This command sets up the Cypress testing environment by checking prerequisites, installing dependencies, and configuring environment variables.
10+
11+
## Instructions for Claude
12+
13+
Follow these steps in order:
14+
15+
### Step 1: Check Prerequisites
16+
17+
1. **Check Node.js version** - Required: >= 18
18+
- Run `node --version` and verify it's >= 18
19+
- If not, inform the user they need to install Node.js 18 or higher
20+
21+
### Step 2: Navigate and Install Dependencies
22+
23+
1. **Navigate to the cypress directory**:
24+
```bash
25+
cd web/cypress
26+
```
27+
28+
2. **Install npm dependencies**:
29+
```bash
30+
npm install
31+
```
32+
33+
### Step 3: Create or Update Environment Configuration
34+
35+
**Important**: Do NOT run the interactive `configure-env.sh` script. Instead, create the `web/cypress/export-env.sh` file directly.
36+
37+
1. Check if `web/cypress/export-env.sh` already exists
38+
2. If it exists, read it and show the current values to the user. Ask if they want to keep or update them.
39+
3. Look for cluster credentials in the following order:
40+
- **Conversation context**: Check if the user already provided a console URL and kubeadmin password earlier in the conversation
41+
- **Existing export-env.sh**: Reuse values from an existing file if the user confirms they're current
42+
- **Ask the user directly**: If no credentials are found, ask the user to provide:
43+
- Console URL (e.g., `https://console-openshift-console.apps.ci-ln-xxxxx.aws-4.ci.openshift.org`)
44+
- Kubeadmin password
45+
- **Do NOT proceed without credentials** — the file cannot be created with placeholder values
46+
4. Write the file directly:
47+
48+
```bash
49+
cat > web/cypress/export-env.sh << 'ENVEOF'
50+
# shellcheck shell=bash
51+
export CYPRESS_BASE_URL='<console-url>'
52+
export CYPRESS_LOGIN_IDP='kube:admin'
53+
export CYPRESS_LOGIN_USERS='kubeadmin:<password>'
54+
export CYPRESS_KUBECONFIG_PATH='/tmp/kubeconfig'
55+
export CYPRESS_SKIP_ALL_INSTALL='false'
56+
export CYPRESS_SKIP_COO_INSTALL='false'
57+
export CYPRESS_COO_UI_INSTALL='true'
58+
export CYPRESS_SKIP_KBV_INSTALL='true'
59+
export CYPRESS_KBV_UI_INSTALL='false'
60+
export CYPRESS_TIMEZONE='UTC'
61+
export CYPRESS_MOCK_NEW_METRICS='false'
62+
export CYPRESS_SESSION='true'
63+
export CYPRESS_DEBUG='false'
64+
ENVEOF
65+
```
66+
67+
Notes on the values:
68+
- `CYPRESS_BASE_URL`: The OpenShift console URL from the cluster provisioning output
69+
- `CYPRESS_LOGIN_USERS`: Format is `kubeadmin:<password>` using the password from cluster provisioning
70+
- `CYPRESS_KUBECONFIG_PATH`: Use `/tmp/kubeconfig` when running in a Docker sandbox, or the actual path to kubeconfig on the host
71+
- `CYPRESS_SKIP_ALL_INSTALL='false'`: Ensures operators get installed on first run
72+
- `CYPRESS_COO_UI_INSTALL='true'`: Installs the Cluster Observability Operator UI plugin
73+
74+
### Step 4: Verify the setup
75+
76+
Source the file and confirm the variables are set:
77+
78+
```bash
79+
source web/cypress/export-env.sh
80+
echo "Base URL: $CYPRESS_BASE_URL"
81+
```
82+
83+
### Step 5: Inform the user
84+
85+
Let the user know the environment is configured and they can run tests using `/cypress:run`.
86+
87+
---
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.cursor/commands/fixture-schema-reference.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.cursor/commands/generate-incident-fixture.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.cursor/commands/generate-regression-test.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.cursor/commands/refactor-regression-test.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../.cursor/commands/validate-incident-fixtures.md

.claude/commands/fixture-schema-reference.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.claude/commands/generate-incident-fixture.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)