[Test] Update E2E tests for the User Dashboard UI redesign#23774
[Test] Update E2E tests for the User Dashboard UI redesign#23774
Conversation
olkornii
left a comment
There was a problem hiding this comment.
PR is in WIP for now, waiting
| await this.driverHelper.type(CreateWorkspace.FACTORY_URL, factoryUrl, timeout); | ||
|
|
||
| const actualFactoryUrl: string = await this.getGitRepositoryUrl(timeout); | ||
| Logger.info(`[INFO] Git repository URL set to "${actualFactoryUrl}"`); |
There was a problem hiding this comment.
This logging looks like a leftover from debugging.
Could you please check whether it is still needed?
There was a problem hiding this comment.
Yes, in general, this can be deleted.
It was added, because the test CreateWorkspaceWithExistingNameFromGitUrl was failing, a part of text in the Url field was lost and it was difficult to define from the log in what moment it happened. So I decided to leave it. Now with the last image-dashboard the test passes.
20:58:32 AssertionError: expected '[https://github.com/crw-qe/python-hell…](https://github.com/crw-qe/python-hell%E2%80%A6)' to equal '[https://github.com/crw-qe/python-hell…](https://github.com/crw-qe/python-hell%E2%80%A6)'
20:58:32 + expected - actual
20:58:32
20:58:32 -https://github.com/crw-qe/python-hello-worl?new
20:58:32 +https://github.com/crw-qe/python-hello-world?new
|
|
||
| private static readonly GIT_SERVICES_TAB: By = By.xpath('//button[text()="Git Services"]'); | ||
| private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.xpath('//button[text()="Revoke"]'); | ||
| private static readonly GIT_SERVICES_TAB: By = By.css('button[id*="GitServices"]'); |
There was a problem hiding this comment.
It would be better to use exact By.id('pf-tab-GitServices-user-preferences-tabs') here.
Substring selectors are more permissive than needed and could match unintended elements.
| private static readonly GIT_SERVICES_TAB: By = By.css('button[id*="GitServices"]'); | |
| private static readonly GIT_SERVICES_TAB: By = By.id('pf-tab-GitServices-user-preferences-tabs'); |
| private static readonly GIT_SERVICES_TAB: By = By.xpath('//button[text()="Git Services"]'); | ||
| private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.xpath('//button[text()="Revoke"]'); | ||
| private static readonly GIT_SERVICES_TAB: By = By.css('button[id*="GitServices"]'); | ||
| private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.css('button[data-testid*="revoke-button"]'); |
There was a problem hiding this comment.
Worth switching to exact match data-testid="revoke-button" - DELETE_ITEM_BUTTON_ENABLED a few lines below already uses the exact value successfully. No need for substring match when the precise value is known.
There was a problem hiding this comment.
GIT_SERVICES_REVOKE_BUTTON and DELETE_ITEM_BUTTON_ENABLED are different objects, their locators do not match.
I'll fix GIT_SERVICES_REVOKE_BUTTON by using the full value of data-testid -> bulk-revoke-button.
dmytro-ndp
left a comment
There was a problem hiding this comment.
The PR looks good to merge, although there are a few non-critical notices.
Thank you for the test update, @artaleks9 !
What does this PR do?
This PR updates locators of UI Che Dashboard according redesign based on PatternFly 6.
These changes fix up the E2E tests, which use for testing Dev Spaces (including
functional-tests,ds-miscellaneous-tests,factorypipelines)Screenshot/screencast of this PR
What issues does this PR fix or reference?
#23736
How to test this PR?
Run the tests against Dev Spaces locally or using pipelines
functional-tests,ds-miscellaneous-tests,factorywith the specificdevspaces-dashboardimage and these PR changesPreliminary results of pipeline launch:
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or referenceandHow to test this PRcompletedReviewers
Reviewers, please comment how you tested the PR when approving it.