Skip to content

Commit e86feb2

Browse files
stefanonardoclaude
andcommitted
OCPBUGS-82510: Fix web-terminal-adminuser e2e tests broken by createRoot
Replace clickStartButton's synchronous $body.find() check with a Cypress retry-based assertion. createRoot defers renders, so the old check always failed and triggered a recovery path that broke the test state. Also fix broken cos-status-box selectors, move workspace cleanup to Background, and add scrollIntoView() to the perspective switcher toggle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 982f7c1 commit e86feb2

File tree

6 files changed

+10
-37
lines changed

6 files changed

+10
-37
lines changed

frontend/packages/dev-console/integration-tests/support/pages/search-resources/search-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const searchResource = {
2525
navigateToAdminMenu(adminNavigationBar.Home);
2626
}
2727
});
28-
cy.get(adminNavigationMenuPO.home.search).click();
28+
cy.get(adminNavigationMenuPO.home.search).scrollIntoView().click();
2929
performResourceSearching(resourceName);
3030
cy.get('[id="resource-dropdown-listbox"]').scrollTo('top', { ensureScrollable: false });
3131
cy.byLegacyTestID('close-icon').should('be.visible').click({ force: true });

frontend/packages/integration-tests/views/nav.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const nav = {
1111
// dropdown menu inside the toggle element, so .text() on the toggle
1212
// itself would include menu item labels.
1313
cy.byLegacyTestID('perspective-switcher-toggle')
14+
.scrollIntoView()
1415
.should('be.visible')
1516
.then(($toggle) => {
1617
if (text === switchPerspective.Administrator) {
@@ -32,6 +33,7 @@ export const nav = {
3233
case 'Admin':
3334
case 'admin':
3435
cy.byLegacyTestID('perspective-switcher-toggle')
36+
.scrollIntoView()
3537
.should('be.visible')
3638
.then(($toggle) => {
3739
if ($toggle.attr('id') === 'core-platform-perspective') {
@@ -76,6 +78,7 @@ export const nav = {
7678
// dropdown menu item text (PF appends the menu inside the toggle
7779
// element via popperProps.appendTo).
7880
cy.byLegacyTestID('perspective-switcher-toggle')
81+
.scrollIntoView()
7982
.should('be.visible')
8083
.find('.pf-v6-c-menu-toggle__text')
8184
.invoke('text')

frontend/packages/webterminal-plugin/integration-tests/features/web-terminal/web-terminal-adminuser.feature

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Disabled due to createRoot concurrent rendering failures (OCPBUGS-82510)
2-
@web-terminal @manual
1+
@web-terminal
32
Feature: Web Terminal for Admin user
43
As a user with admin rights, I should be able to use web terminal
54

65

76
Background:
87
Given user has logged in
9-
# And user is at administrator perspective
10-
# And user has created or selected namespace "aut-terminal"
8+
And user has closed existing terminal workspace
119

1210

1311
@regression @ODC-6463
@@ -33,7 +31,6 @@ Feature: Web Terminal for Admin user
3331
And user clicks on Start button
3432
Then user will see the terminal instance for namespace "openshift-terminal"
3533
And user ID obtained by API should match with user id in yaml editor for "openshift-terminal" namespace
36-
And user has closed existing terminal workspace
3734

3835

3936
@smoke @ODC-6745
@@ -44,4 +41,3 @@ Feature: Web Terminal for Admin user
4441
Then user will see the terminal window
4542
And user will see the terminal instance for namespace "openshift-terminal"
4643
And user ID obtained by API should match with user id in yaml editor for "openshift-terminal" namespace
47-
And user has closed existing terminal workspace

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Given('user can see terminal icon on masthead', () => {
4848

4949
When('user clicks on the Web Terminal icon on the Masthead', () => {
5050
webTerminalPage.clickOpenCloudShellBtn();
51-
cy.get('cos-status-box cos-status-box--loading').should('not.exist');
51+
cy.get('[data-test="loading-box"]').should('not.exist');
5252
});
5353

5454
Then('user will see the terminal window', () => {

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/initTerminal-page.ts

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
import { switchPerspective } from '@console/dev-console/integration-tests/support/constants';
21
import { formPO } from '@console/dev-console/integration-tests/support/pageObjects';
32
import { webTerminalPO } from '@console/dev-console/integration-tests/support/pageObjects/webterminal-po';
4-
import {
5-
app,
6-
perspective,
7-
projectNameSpace,
8-
} from '@console/dev-console/integration-tests/support/pages/app';
9-
import { searchResource } from '@console/dev-console/integration-tests/support/pages/search-resources/search-page';
10-
import { webTerminalPage } from './webTerminal-page';
3+
import { app } from '@console/dev-console/integration-tests/support/pages/app';
114

125
export const initTerminalPage = {
136
clickOnProjectDropDown: () => {
@@ -25,26 +18,7 @@ export const initTerminalPage = {
2518

2619
clickStartButton: () => {
2720
cy.get(formPO.create).should('be.enabled').click({ force: true });
28-
cy.get('body').then(($body) => {
29-
cy.wait(5000);
30-
// Due to initialization issue if multiple operators present OCPBUGS-44891
31-
if ($body.find('[data-test="loading-box-body"]').length === 0) {
32-
cy.log('loading did not go through');
33-
cy.wait(10000);
34-
cy.get(webTerminalPO.closeTerminalIcon).click();
35-
cy.reload();
36-
app.waitForDocumentLoad();
37-
perspective.switchTo(switchPerspective.Administrator);
38-
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
39-
projectNameSpace.selectProject('openshift-terminal');
40-
webTerminalPage.clickOpenCloudShellBtn();
41-
searchResource.searchResourceByNameAsAdmin('DevWorkspace');
42-
searchResource.selectSearchedItem('terminal');
43-
// cy.get('[data-test="loading-indicator"]').should('not.exist', { timeout: 210000 });
44-
} else {
45-
cy.wait(5000);
46-
}
47-
});
21+
cy.get('[data-test="loading-box-body"]').should('exist');
4822
},
4923

5024
selectProject: (projectName: string) => {

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Given('user can see terminal icon on masthead', () => {
4242

4343
When('user clicks on the Web Terminal icon on the Masthead', () => {
4444
cy.get(webTerminalPO.webTerminalIcon).click();
45-
cy.get('cos-status-box cos-status-box--loading').should('not.exist');
45+
cy.get('[data-test="loading-box"]').should('not.exist');
4646
});
4747

4848
When('user clicks advanced option for Timeout', () => {

0 commit comments

Comments
 (0)