Commit 180918d
authored
fix(e2e): wait for projects page before filtering (RHOAIENG-57594) (#7255)
* fix(e2e): wait for projects page before filtering (RHOAIENG-57594)
After visitWithLogin('/projects'), the React app may still be
initializing. Calling filterProjectByName immediately races against
the page render — if the toolbar hasn't appeared within the default
4 s command timeout, the test fails with "view not loading".
Add projectListPage.waitForPageAndToolbar() (15 s title + 30 s
toolbar) after visitWithLogin in the three tests that were missing
it, matching the pattern already used in the permissions tests.
Made-with: Cursor
* fix(e2e): bake toolbar wait into ProjectListPage.navigate() (RHOAIENG-57594)
Instead of scattering waitForPageAndToolbar() calls at every call site,
move the title+toolbar visibility guard into the private wait() method
that both navigate() and visit() already call. This ensures every
future test that uses either method gets the full render gate for free.
Also standardise the three beforeEach blocks that called
cy.visitWithLogin('/projects', USER) directly — convert them to the
canonical cy.visitWithLogin('/', USER) + projectListPage.navigate()
pattern so private wait() covers them too, and the now-redundant
waitForPageAndToolbar() public method is removed entirely.
* fix(e2e): move timeout to query command in ProjectListPage.wait()
Passing { timeout } as the second arg to .should() is silently ignored
by Cypress — for 'be.visible' assertions Chai treats it as an unused
value argument. The timeout must be on the query command so Cypress
uses it to control retry duration.
Move both timeouts from .should() to cy.findByTestId() where they
will actually take effect.
* fix(e2e): move toolbar wait into filterProjectByName (RHOAIENG-57594)
Waiting for projects-table-toolbar in private wait() broke mock tests
that exercise the empty-state path (shouldBeEmpty) — the toolbar is
never rendered when there are no projects, so the assertion timed out.
The toolbar guard belongs in filterProjectByName(), the only caller
that actually interacts with the toolbar. private wait() keeps just
the page-title check, which works for all page states.
---------
Co-authored-by: Bob Gregor <Bob Gregor>1 parent 7e25239 commit 180918d
6 files changed
Lines changed: 8 additions & 12 deletions
File tree
- packages/cypress/cypress
- pages
- tests/e2e
- dataScienceProjects
- clusterStorage
- workbenches
- storageClasses
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 88 | | |
95 | 89 | | |
96 | 90 | | |
| |||
151 | 145 | | |
152 | 146 | | |
153 | 147 | | |
| 148 | + | |
154 | 149 | | |
155 | 150 | | |
156 | 151 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
0 commit comments