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
ODC-5577:Topology chart view automation #9399
ODC-5577:Topology chart view automation #9399
Conversation
4bf8175
to
4312fa3
Compare
All the tests are running fine but I am getting this error and @sanketpathak is not. Adding /lgtm for running tests successfully. |
/lgtm |
case 'deployment config': | ||
case 'Deployment Config': | ||
case 'deployment-config': | ||
case 'Deployment-Config': | ||
case 'DeploymentConfig': |
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.
Can we try "||" operator, instead of adding multiple lines
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.
It's not working
frontend/packages/topology/integration-tests/support/page-objects/topology-po.ts
Show resolved
Hide resolved
export function typeOfResource(type: string) { | ||
return `[data-test="${type}"]`; | ||
} | ||
|
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.
we can use cy.byTestID("attribute-name"). Please remove this function
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.
you are trying to return data-test attribute using this function and passing it to cy.get() function right, if that is the case. we can directly pass it to cy.byTestID()
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.
Updated
export function typeOfWorkload(workload: string) { | ||
return `[data-test~="icon"][data-test~="${workload | ||
.toLowerCase() | ||
.replace(' ', '') | ||
.trim()}"]`; | ||
} |
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.
Please use Arrow functions where ever applicable instead this functions
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.
Updated
Then('user sees Topology page with message "No resources found"', () => { | ||
cy.get(topologyPO.emptyText).should('be.visible'); | ||
}); |
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.
Then('user sees Topology page with message "No resources found"', () => { | |
cy.get(topologyPO.emptyText).should('be.visible'); | |
}); | |
Then('user sees Topology page with message {string}', (text:string) => { | |
cy.get(topologyPO.emptyText).should('be.visible'); | |
}); |
or
Modify the step in feature file as Then user sees Topology page with message No resources found
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.
Updated
navigateTo(devNavigationMenu.Topology); | ||
}); | ||
|
||
When('user clicks on "Add page" link in the topology page', () => { |
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.
same comment as mentioned above
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.
Updated
4312fa3
to
79e9b76
Compare
/assign @makambalaji |
79e9b76
to
50dffdc
Compare
Tested on my localhost, worked fine |
/approve |
/lgtm |
/lgtm |
@jerolimov Can you please review this PR? QE Review is already done. If there is nothing, please add |
/retest |
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.
Added some findings. Please take a look and let me know what you think.
or visit the{' '} | ||
<Link to="/add" data-test="add-page"> | ||
Add page | ||
</Link>{' '} | ||
for more details. |
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.
The {' '}
ensures that the output is the same, but changes the i18n string in the translation files. I recommend that we concat these space strings into one string, like this:
<Trans t={t} ns="topology">
<Button
isInline
variant="link"
data-test="start-building-your-application"
onClick={(e) => {
e.stopPropagation();
setIsQuickSearchOpen(true);
}}
>
Start building your application
</Button>
{' or visit the '}
<Link to="/add" data-test="add-page">
Add page
</Link>
{' for more details.'}
</Trans>
Your code (and my example as well) changed the translation file! Please run yarn i18n
after changing this.
You can also change the <3>
to <2>
manually in the other translation files, so that they still match? Thanks.
Alternative:
<Trans t={t} ns="topology">
<Button
isInline
variant="link"
data-test="start-building-your-application"
onClick={(e) => {
e.stopPropagation();
setIsQuickSearchOpen(true);
}}
>
Start building your application
</Button>{' '}
{'or visit the '}
<Link to="/add" data-test="add-page">
Add page
</Link>{' '}
for more details.
</Trans>
Then you don't need to change the translation files.
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.
Updated with the first change
@@ -36,6 +36,7 @@ const QuickSearchBar: React.FC<QuickSearchBarProps> = ({ | |||
onChange={onSearch} | |||
autoFocus={autoFocus} | |||
value={searchTerm} | |||
data-test="quick-search-input" |
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.
We don't want repeat the prefixes. In this case please just use input
or drop it as it is not used yet.
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.
Changed to input, It can be used for automation in future
); | ||
}); | ||
|
||
Given('user has created deployment config workload {string}', (componentName: string) => { |
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.
Given('user has created deployment config workload {string}', (componentName: string) => { | |
Given('user has created a deployment config workload {string}', (componentName: string) => { |
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.
Updated
cy.get(topologyPO.graph.startBuildingNewApp) | ||
.should('be.visible') | ||
.click(); |
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.
Little bit confusing that you don't use build: string
here.
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.
Updated
When('user navigates to Topology page', () => { | ||
navigateTo(devNavigationMenu.Topology); | ||
}); | ||
|
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.
This is already defined above.
When('user navigates to Topology page', () => { | |
navigateTo(devNavigationMenu.Topology); | |
}); |
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.
Sorry I missed that, removed
When('user is at Topology page chart view', () => { | ||
navigateTo(devNavigationMenu.Topology); | ||
}); | ||
|
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.
Same as When('user navigates to Topology page', ...
And we call the both topology variants "graph" and "list". If this should ensure that this should show the graph (chart), I would expect some additional code to do that.
So can you reuse When('user navigates to Topology page',
here as well or add an check for the topology switch button on the top right corner?
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.
Updated with checking the switch button
cy.byTestID('DeploymentConfig').click(); | ||
cy.get(typeOfWorkload(workload)).should('be.visible'); | ||
cy.byTestID('DeploymentConfig').click(); |
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.
Is this back and forward clicks really required?
cy.byTestID('DeploymentConfig').click(); | |
cy.get(typeOfWorkload(workload)).should('be.visible'); | |
cy.byTestID('DeploymentConfig').click(); | |
cy.get(typeOfWorkload(workload)).should('be.visible'); |
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.
It's not required but I did to make it consistent with the previous then statement and if in future further test scenarios are added in the file, then we do not have to worry about the checks being disabled
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.
Sorry don't get the edge case where it is needed to click items twice.
Also, this is an Then(...
condition. I would suggest not to click an items here anymore. If a click before that is needed this should be part of a When
statement, or?
I would suggest to remove all clicks from
Then(
'user can see only the {string} workload when Deployment option is selected',
and
Then(
'user can see only the {string} workload when Deployment-Config option is selected',
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.
Updated
@@ -21,22 +21,27 @@ const TopologyEmptyState: React.FC<TopologyEmptyStateProps> = ({ setIsQuickSearc | |||
return ( | |||
<EmptyState className="odc-topology__empty-state" variant={EmptyStateVariant.full}> | |||
<EmptyStateIcon variant="container" component={TopologyIcon} /> | |||
<Title headingLevel="h3" size="lg"> | |||
<Title headingLevel="h3" size="lg" data-test="no-resources-found"> |
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.
If possible, please move this 2 lines up to the EmptyState as the complete component define this.
<EmptyState
className="odc-topology__empty-state"
variant={EmptyStateVariant.full}
data-test="empty-state"
>
<EmptyStateIcon variant="container" component={TopologyIcon} />
<Title headingLevel="h3" size="lg">
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.
Updated
key={filter.id} | ||
value={filter.id} | ||
isChecked={filter.value} | ||
data-test={filter.labelKey ? t(filter.labelKey) : filter.label} |
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.
I think we don't want and need to translate data-test
attributes.
data-test={filter.labelKey ? t(filter.labelKey) : filter.label} | |
data-test={filter.label} |
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.
Updated
@@ -154,6 +154,7 @@ const BaseNode: React.FC<BaseNodeProps> = ({ | |||
paddingX={8} | |||
paddingY={4} | |||
kind={kind} | |||
data-test={`name-${element.getLabel()}`} |
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.
I don't find any code which is looking for this name-
data-test attribute?
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.
I was trying out something so this attribute was required but it didn't work out. I've not removed it because it can be used for future automation
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.
But then I would recommend another data-test
. Please remove it from this PR when it is not used and then you can add it with a test scenario where it is used.
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.
Sure Christoph, will update it
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.
Updated
50dffdc
to
7f90ff3
Compare
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.
Looks good so far. But please address also this two comments:
7f90ff3
to
056c82b
Compare
cy.get(gitPO.gitSection.validatedMessage).should('not.have.text', 'Validating...'); | ||
cy.get(gitPO.gitSection.validatedMessage) | ||
.should('not.include.text', 'Validating...') | ||
.and('not.include.text', 'Repository URL to build and deploy your code from source'); |
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.
Can you please add this text to static-text folder
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.
Added
056c82b
to
f73a751
Compare
@@ -92,7 +92,7 @@ const TopologyFilterBar: React.FC<TopologyFilterBarProps> = ({ | |||
</ToolbarItem> | |||
</ToolbarGroup> | |||
<ToolbarGroup variant={ToolbarGroupVariant['filter-group']}> | |||
<ToolbarItem> | |||
<ToolbarItem data-test={'filter-by-resource'}> |
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.
Mini nit:
<ToolbarItem data-test={'filter-by-resource'}> | |
<ToolbarItem data-test="filter-by-resource"> |
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.
@sanketpathak @makambalaji I run all topology tests with yarn run test-cypress-topology
, feature which is touched in this PR is green, but all others are red. Sanket says that you Balaji will check these later / in another PR.
The frontend changes are fine for me! Approving them. Balaji, please add lgtm if the rest is fine for you.
/approve
/lgtm |
f73a751
to
d79b408
Compare
Readd Balajis lgtm as the latest changes are requested by myself and looks fine. 👍 /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gajanan-more, jerolimov, makambalaji, sanketpathak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
Fix: https://issues.redhat.com/browse/ODC-6006
Problem: Automation of empty state of topology chart view, topology chart view with workloads and filters in topology chart view
Solution: This script will automate the topology chart view page.
Test Setup:
Cluster should be running on local
Check the TAGS in frontend/packages/topology/integration-tests/cypress.json file be: "@Topology and (@smoke or @regression) and not (@Manual or @to-do or @un-verified)",
Command to execute:
yarn run dev
yarn run test-cypress-topology
Execute the topology-chart-area-visual.feature file
Checks for approving Epic scenarios Automation PR:
Browser
Chrome 89
Test Execution Screenshot: