Skip to content

Commit b12d721

Browse files
committed
Reorganize the setup/prerequisites
1 parent 7bb49e2 commit b12d721

1 file changed

Lines changed: 32 additions & 16 deletions

File tree

cypress/README.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,48 @@
11
### cypress in manageiq-ui-classic
22

3-
#### Run
3+
#### Setup
44

5-
**Prerequisites:**
5+
##### Initial Setup (One-Time)
66

7-
Before running Cypress tests, you must build webpack with the CYPRESS flag. This disables debug notifications that would block Cypress from accessing UI elements:
7+
```bash
8+
cd manageiq-ui-classic
9+
yarn # Install Cypress and dependencies (run once initially, then again when packages are updated)
10+
```
811

9-
CYPRESS=true bin/webpack
12+
**Database Requirements:**
1013

11-
If you skip this step, Cypress will show an error and refuse to start.
14+
Cypress uses the development database from `config/database.yml` and expects a clean, seeded database. If you need a populated development database for regular development, consider using a separate database for Cypress tests as pre-populated data may cause test failures. We are exploring ways to simplify this workflow.
1215

13-
**Webpack Options:**
14-
- Use `CYPRESS=true bin/webpack` for a one-time build
15-
- Use `CYPRESS=true bin/webpack --watch` if live editing UI files and want automatic pack updates
16-
17-
**Note:** The `CYPRESS` environment variable prevents code reloading in dev mode and disables debug notifications.
16+
The following command sets up the database as Cypress expects:
1817

18+
```bash
19+
dropdb vmdb_development; createdb vmdb_development; bundle exec rake db:migrate db:seed # from manageiq directory
20+
```
1921

20-
### Usage
22+
##### Before Running Tests
2123

22-
##### Initial Setup
24+
Build webpack with the CYPRESS flag (required before running tests, and whenever UI files change):
2325

2426
```bash
2527
cd manageiq-ui-classic
26-
yarn # Install Cypress the first time
28+
CYPRESS=true bin/webpack
2729
```
2830

29-
##### Optional Environment Variables
31+
**Webpack Options:**
32+
- Use `CYPRESS=true bin/webpack` for a one-time build
33+
- Use `CYPRESS=true bin/webpack --watch` for automatic rebuilds when editing UI files
34+
35+
**Note:** If you skip this step, Cypress will show an error and refuse to start.
36+
37+
### Usage
38+
39+
##### Environment Variables
40+
41+
**Required**
42+
43+
- `CYPRESS=true` - disables debug notifications that would prevent Cypress from accessing UI elements and development mode code reloading
44+
45+
**Optional**
3046

3147
- `HEADED=true` - Run with visible browser (default: headless)
3248
- `SPEC="**/reports.cy.js"` - Run specific test file (default: all tests)
@@ -53,7 +69,7 @@ CYPRESS=true bin/rails s
5369
Optional: Start queue worker simulation in another terminal (needed for some tests):
5470

5571
```bash
56-
bundle exec rake app:evm:simulate_queue_worker # from manageiq-ui-classic
72+
bundle exec rake app:evm:simulate_queue_worker # from manageiq-ui-classic directory
5773
# OR
5874
bundle exec rake evm:simulate_queue_worker # from manageiq directory
5975
```
@@ -91,7 +107,7 @@ CYPRESS=true bin/rails s
91107
Terminal 3 - Simulate queue worker (needed for some tests):
92108

93109
```bash
94-
bundle exec rake app:evm:simulate_queue_worker # from manageiq-ui-classic
110+
bundle exec rake app:evm:simulate_queue_worker # from manageiq-ui-classic directory
95111
# OR
96112
bundle exec rake evm:simulate_queue_worker # from manageiq directory
97113
```

0 commit comments

Comments
 (0)