You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before running Cypress tests, ensure the following:
7
+
```bash
8
+
cd manageiq-ui-classic
9
+
yarn # Install Cypress and dependencies (run once initially, then again when packages are updated)
10
+
```
8
11
9
-
1.**Build webpack with CYPRESS flag** - This disables debug notifications that would block Cypress from accessing UI elements:
12
+
**Database Requirements:**
10
13
11
-
CYPRESS=true bin/webpack
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.
12
15
13
-
If you skip this step, Cypress will show an error and refuse to start.
16
+
The following command sets up the database as Cypress expects:
Run tests interactively with the Cypress UI (useful for debugging).
94
+
95
+
Terminal 1 - Start webpack with --watch for live UI updates:
96
+
97
+
```bash
98
+
CYPRESS=true bin/webpack --watch
99
+
```
100
+
101
+
Terminal 2 - Start Rails server:
102
+
103
+
```bash
104
+
CYPRESS=true bin/rails s
105
+
```
106
+
107
+
Terminal 3 - Simulate queue worker (needed for some tests):
108
+
109
+
```bash
110
+
bundle exec rake app:evm:simulate_queue_worker # from manageiq-ui-classic directory
111
+
# OR
112
+
bundle exec rake evm:simulate_queue_worker # from manageiq directory
113
+
```
114
+
115
+
Terminal 4 - Open Cypress interactive UI:
116
+
117
+
```bash
118
+
CYPRESS=true yarn cypress:open
119
+
```
120
+
121
+
This opens the Cypress UI where you can select and watch individual tests run.
122
+
123
+
Note: Without `--watch`, you can run webpack and Cypress UI in the same terminal.
33
124
34
125
#### Write
35
126
@@ -43,7 +134,7 @@ ManageIQ implements the following cypress extensions:
43
134
44
135
*`cy.accordion(title)` - open an accordion panel. `title`: String for the accordion title for the accordion panel to open.
45
136
*`cy.accordionItem(name)` - click on a record in the accordion panel. `name`: String for the record to click in the accordion panel.
46
-
*`cy.selectAccordionItem(accordionPath)` - navigates the expanded accordion panel(use cy.accordion to expand an accordion panel) and then expand the nodes along the given path and click the final target item. `accordionPath`: A mixed array of strings and/or regex patterns that represent the path to the intended target node. e.g. Simple string path: `cy.selectAccordionItem(['Datastore', 'My-Domain', 'My-Namespace']);`, Path with regular expressions: `cy.selectAccordionItem([/^ManageIQ Region:/, /^Zone:/, /^Server:/]);`, Mixed path with strings and regular expressions: `cy.selectAccordionItem([/^ManageIQ Region:/, 'Zones', /^Zone:/]);`
137
+
*`cy.selectAccordionItem(accordionPath)` - navigates the expanded accordion panel(use cy.accordion to expand an accordion panel) and then expand the nodes along the given path and click the final target item. `accordionPath`: A mixed array of strings and/or regex patterns that represent the path to the intended target node. e.g. Simple string path: `cy.selectAccordionItem(['Datastore', 'My-Domain', 'My-Namespace']);`, Path with regular expressions: `cy.selectAccordionItem([/^ManageIQ Region:/, /^Zone:/, /^Server:/]);`, Mixed path with strings and regular expressions: `cy.selectAccordionItem([/^ManageIQ Region:/, 'Zones', /^Zone:/]);`
0 commit comments