-
Notifications
You must be signed in to change notification settings - Fork 764
CONSOLE-5239: Migrate remaining dev-console scenarios #17153
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
30c4d32
CONSOLE-5239: Migrate remaining dev-console scenarios
shahsahil264 86993f2
test: stabilize dev-console migrations
shahsahil264 1362a85
Merge branch 'openshift:main' into CONSOLE-5239
shahsahil264 f7dab34
test: clarify manual build config scenario
shahsahil264 c0875fc
test: address dev-console review feedback
shahsahil264 df917dc
test: wait for route editor mode
shahsahil264 369a5bb
test: fix live deployment and customization waits
shahsahil264 0623e81
Merge branch 'openshift:main' into CONSOLE-5239
shahsahil264 2bae7c6
test: harden live dev-console coverage
shahsahil264 d9515d1
test: select deployment resource explicitly
shahsahil264 fb8bdc8
test: handle streaming events route
shahsahil264 6ff8c41
test: restore migrated dev-console parity
shahsahil264 6e697dc
test: add migrated custom icon coverage
shahsahil264 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
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
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
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
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,78 @@ | ||
| import { expect } from '../../fixtures'; | ||
| import BasePage from '../base-page'; | ||
|
|
||
| export class RoutePage extends BasePage { | ||
| private readonly name = this.page.getByRole('textbox', { name: 'Name', exact: true }); | ||
| private readonly service = this.page.getByRole('combobox', { name: /Service/i }); | ||
| private readonly targetPort = this.page.getByRole('combobox', { name: /Target Port/i }); | ||
| private readonly hostname = this.page.getByRole('textbox', { name: 'Hostname' }); | ||
| private readonly createButton = this.page.getByRole('button', { name: 'Create', exact: true }); | ||
|
|
||
| async navigateToCreate(namespace: string): Promise<void> { | ||
| await this.goTo(`/k8s/ns/${namespace}/routes/~new/form`); | ||
| } | ||
|
|
||
| async navigateToEdit(namespace: string, name: string): Promise<void> { | ||
| await this.goTo(`/k8s/ns/${namespace}/routes/${name}`); | ||
| await this.robustClick(this.page.getByRole('button', { name: 'Actions' })); | ||
| await this.robustClick(this.page.getByRole('menuitem', { name: 'Edit Route' })); | ||
| } | ||
|
|
||
| isFormView(): Promise<boolean> { | ||
| const yamlEditor = this.page.getByRole('textbox', { name: /Editor content/ }); | ||
| return expect(this.name.or(yamlEditor).first()) | ||
| .toBeVisible({ timeout: 30_000 }) | ||
| .then(async () => this.name.isVisible()); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| async fillForm(name: string, service: string, port: string, host?: string): Promise<void> { | ||
| await this.name.fill(name); | ||
| await this.robustClick(this.service); | ||
| await this.robustClick(this.page.getByRole('option', { name: service, exact: true })); | ||
| await this.robustClick(this.targetPort); | ||
| await this.robustClick(this.page.getByRole('option', { name: port, exact: true })); | ||
| if (host) await this.hostname.fill(host); | ||
| } | ||
|
|
||
| async fillYaml(name: string, service: string, port: string, host?: string): Promise<void> { | ||
| await this.setEditorContent( | ||
| [ | ||
| 'apiVersion: route.openshift.io/v1', | ||
| 'kind: Route', | ||
| 'metadata:', | ||
| ` name: ${name}`, | ||
| 'spec:', | ||
| ` ${host ? `host: ${host}\n ` : ''}to:`, | ||
| ' kind: Service', | ||
| ` name: ${service}`, | ||
| ' port:', | ||
| ` targetPort: ${port}`, | ||
| ].join('\n'), | ||
| ); | ||
| } | ||
|
|
||
| async create(): Promise<void> { | ||
| await this.robustClick(this.createButton); | ||
| } | ||
|
|
||
| async save(): Promise<void> { | ||
| await this.robustClick(this.page.getByRole('button', { name: 'Save', exact: true })); | ||
| } | ||
|
|
||
| async setFormHostname(host: string): Promise<void> { | ||
| await expect(this.hostname).toBeVisible({ timeout: 30_000 }); | ||
| await this.hostname.fill(host); | ||
| } | ||
|
|
||
| async setYamlHostname(host: string): Promise<void> { | ||
| await expect(this.page.getByRole('textbox', { name: /Editor content/ })).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
| const content = await this.getEditorContent(); | ||
| if (!/^spec:\n/m.test(content)) { | ||
| throw new Error('Route YAML does not contain a top-level spec field'); | ||
| } | ||
| const updated = content.replace(/^(spec:\n)/m, `$1 host: ${host}\n`); | ||
| await this.setEditorContent(updated); | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.