-
Notifications
You must be signed in to change notification settings - Fork 747
Bug OCPBUGS-105794: Fix P-01-TC04 step definition wiring and add defensive teardown #17084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
redhat-chai-bot
wants to merge
1
commit into
openshift:release-4.22
Choose a base branch
from
redhat-chai-bot:fix/OCPBUGS-P01TC04-step-definition-cascade-4.22
base: release-4.22
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+117
−10
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 1 addition & 9 deletions
10
...onsole/integration-tests/support/step-definitions/customization/configure-perspectives.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...ages/dev-console/integration-tests/support/step-definitions/e2e/enable-dev-perspective.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
| import { switchPerspective } from '../../constants'; | ||
| import { app, perspective } from '../../pages'; | ||
|
|
||
| Given('user is at admin perspective', () => { | ||
| perspective.switchTo(switchPerspective.Administrator); | ||
| }); | ||
|
|
||
| Given('user is at Search page in Home section', () => { | ||
| cy.get('[data-quickstart-id="qs-nav-home"]') | ||
| .scrollIntoView() | ||
| .then(($body) => { | ||
| if ($body.attr('aria-expanded') === 'false') { | ||
| cy.wrap($body).click(); | ||
| cy.get('[data-test="nav"][href*="/search"]').click({ force: true }); | ||
| } else { | ||
| cy.get('[data-test="nav"][href*="/search"]').click({ force: true }); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| When('user searches {string}', (value: string) => { | ||
| cy.get('[role="combobox"]').click(); | ||
| cy.get('[aria-label="Type to filter"]').should('be.visible').type(value); | ||
| cy.get('[class="co-resource-item"]').then(($el) => { | ||
| if ($el.text().includes('operator.openshift.io')) { | ||
| cy.wrap($el).contains('operator.openshift.io').click(); | ||
| cy.get('button[aria-label="Clear input value"]').should('be.visible').click(); | ||
| // close the select so it doesn't block the items on the page | ||
| cy.get('body').click(); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| When('user clicks on cluster', () => { | ||
| cy.byTestID('cluster').should('be.visible').click({ force: true }); | ||
| }); | ||
|
|
||
| When('user clicks the {string} button in the page heading', (item: string) => { | ||
| cy.get(`button[data-test-action="${item}"]`).should('be.visible').click(); | ||
| cy.get('[data-test="page-heading"] h1').should('have.text', 'Cluster configuration'); | ||
| }); | ||
|
|
||
| When( | ||
| 'user selects {string} in the Developer under perspective section of general customisation', | ||
| (key: string) => { | ||
| cy.get('[data-test="perspectives form-group"]') | ||
| .eq(1) | ||
| .find('button') | ||
| .contains('Disabled') | ||
| .click(); | ||
| cy.log('Perspective enabling menu to be opened'); | ||
| cy.get('[role="listbox"]').should('be.visible'); | ||
| cy.get('button[role="option"]').contains(key).click(); | ||
| cy.get('[data-test="perspectives form-group"]') | ||
| .eq(1) | ||
| .find('button[class*="menu-toggle"]') | ||
| .should('contain.text', key); | ||
| }, | ||
| ); | ||
|
|
||
| When('user will see Saved alert', () => { | ||
| cy.byTestID('success-alert').should('be.visible'); | ||
| }); | ||
|
|
||
| Then('user refreshes the page to see developer option', () => { | ||
| cy.exec('oc rollout status -w deploy/console -n openshift-console', { | ||
| failOnNonZeroExit: true, | ||
| }).then((result) => { | ||
| cy.log(result.stderr); | ||
| }); | ||
| cy.reload(true); | ||
| app.waitForDocumentLoad(); | ||
| }); | ||
|
|
||
| Then('user will see developer perspective in the perspective switcher', () => { | ||
| cy.byLegacyTestID('perspective-switcher-toggle') | ||
| .click({ force: true }) | ||
| .byLegacyTestID('perspective-switcher-menu-option') | ||
| .contains('Developer'); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure no other tests or steps enable/disable the dev perspective, otherwise your variable will be out of sync. Alternatively instead of keeping an internal variable, have a single source of truth--fetch data from the
occli.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point — the module-level
devPerspectiveDisabledflag could get out of sync if other steps also modify perspective visibility.The simplest fix that addresses your concern: make the
Afterhook unconditionally re-enable the Developer perspective without checking the flag. Theoc patchto enable it is idempotent — if the perspective is already enabled, the patch is a no-op ("no change"). This eliminates the state-tracking concern entirely:Would you prefer this unconditional approach, or the
ocCLI check for the current state? I can push the update either way.Also, the E2E job has failed twice due to
build08Boskos lease proxy 503 errors (infrastructure issue — the Cypress tests never actually ran). Would you mind retesting with/test e2e-gcp-consolewhen the infrastructure recovers?AI-generated. Review for accuracy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unconditional is fine