The e2e test wizard.spec.ts is failing due to the fact that in case the cluster list is empty, two buttons named "Create Cluster" are shown, which leads the getByRole locator to resolve to two elements.
This PR aims to solve the disambiguation, by calling first() method on the locator before the click() operation takes place.
Furthermore, the actionTimeout parameter in Playwright config has been increased from 0 to 15s in order to avoid sporadic failures.
How Has This Been Tested?
Run npx playwright test locally targeting demo environment
Tested with an empty list
Tested with a list with 1 cluster
References
PR Quality Checklist
[ ] I added tests to new or existing code
[ ] I removed hardcoded strings and used our i18n solution instead (see here)
[ ] I made sure no sensitive info gets logged at any time in the codebase (see here) (e.g. no user info or details, no stacktraces, etc.)
[ ] I checked that infrastructure/update_infrastructure.sh runs without any error
[ ] I checked that npm run build builds without any error
[ ] I checked that clusters are listed correctly
[ ] I checked that a new cluster can be created (config is produced and dry run passes)
[ ] I checked that login and logout work as expected
Description
The e2e test
wizard.spec.ts
is failing due to the fact that in case the cluster list is empty, two buttons named "Create Cluster" are shown, which leads thegetByRole
locator to resolve to two elements.This PR aims to solve the disambiguation, by calling
first()
method on the locator before theclick()
operation takes place.Furthermore, the
actionTimeout
parameter in Playwright config has been increased from 0 to 15s in order to avoid sporadic failures.How Has This Been Tested?
npx playwright test
locally targeting demo environmentReferences
PR Quality Checklist
i18n
solution instead (see here)npm run build
builds without any errorIn order to increase the likelihood of your contribution being accepted, please make sure you have read both the Contributing Guidelines and the Project Guidelines
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.