-
Notifications
You must be signed in to change notification settings - Fork 361
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
test: [DI-20585] - Add ACLP Cypress Test Coverage for Linode Dashboard Widgets #10891
test: [DI-20585] - Add ACLP Cypress Test Coverage for Linode Dashboard Widgets #10891
Conversation
* @param {string} region - The name of the region to select. | ||
*/ | ||
export const selectRegion = (region: string) => { | ||
// ui.regionSelect.find().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.
These two steps are not working even for existing tests like create-linode and clone-linode
ui.regionSelect.find().click();
ui.autocompletePopper.findByTitle(region);
Since this is a common thing, Can we please check this?
*/ | ||
export const selectAndVerifyServiceName = (service: string) => { | ||
const resourceInput = ui.autocomplete.findByTitleCustom('Select Resources'); | ||
resourceInput.findByTitle('Open').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.
Aftert this (we opened the autocompletepopper now), the below step doesn't work
ui.autocompletePopper.findByTitle(service);
This resources is a multiselect component. Can you please point us if there are already places where we have test cases for autocomplete multi selections, so that we can follow the standards
For all other filters, this
ui.autocompletePopper.findByTitle(service);
works out of the box
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.
@venkymano-akamai Happy to take a closer look once this test is passing, but can't offer much advice for now since I can't reproduce.
In the meantime, here's an example in our OBJ access keys test where we have a multi select and select multiple options:
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.
@venkymano-akamai still having trouble with this? Does my other comment shed any light / help you solve your problem?
.findByTitleCustom('Select Dashboard') | ||
.findByTitle('Open') | ||
.click(); | ||
ui.autocompletePopper.findByTitle(serviceName).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.
Here it works out of the box, for single selection component
@agorthi-akamai Taking this out of draft status so that the tests can run. I'll take a look soon! Thanks for the PR! |
@agorthi-akamai Thanks for the PR! I'm seeing these fail to build in CI -- checking it out locally, it looks like there's a stray import in Aside from that, I'm unable to run any of the tests locally because they don't seem to be using any mocks. These tests run against our Production API so Cypress tests for upcoming features need to use mock API data. |
I've addressed to your code review comments; kindly review |
Hi Joe! |
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.
Thanks Ananth! A few things I suggested before that still need to be addressed:
- I think there may have been a misunderstanding: we should be preferring
forEach
overfor .. of
expressions, so we'll want to change all of these newfor .. of
expressions back toforEach
. I apologize for any confusion. - These two tests still need some clean up:
should allow users to select the desired aggregation and view the latest data from the API displayed in the graph
should allow users to select their desired granularity and see the most recent data from the API reflected in the graph
- Order of params in the mock utils in
intercepts/cloudpulse.ts
(I posted a new comment that goes into more detail about this, but feel free to reach out on Slack if you have any questions or if you're not sure what I'm asking for. It's a quick change.)
Beyond that, I noticed a couple small things that I failed to catch before (sorry!) and shared some suggestions to address them:
- Stray
cy.get()
aftercy.visitWithLogin()
-- double check that this isn't required, but I'm pretty sure it's unnecessary. It doesn't hurt anything, though, so not a huge deal. - Couple naming suggestions for the functions in
util/cloudpulse.ts
to make them consistent with the rest of our mock and intercept utils
There's good news though:
- The tests pass reliably: I ran them 25 times in a row, no failures. I'm very confident in their stability right now, and am very happy to see them running so smoothly (and quickly) without the need for
cy.wait
- Almost all of these remaining suggestions are about maintaining consistency with our codebase's conventions -- only the clean up for the 2 tests I mentioned above actually relate to test quality. In other words, we're pretty much there in terms of test quality.
- Once these suggestions are addressed, as long as there are no regressions and the tests continue passing reliably, I'm ready to approve.
Thanks Ananth! We're just about there. Don't hesitate to reach out if you have any questions or could use a hand wrapping up these last few things.
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
@@ -16,7 +16,7 @@ import type { | |||
} from '@linode/api-v4'; | |||
|
|||
/** | |||
* Intercepts GET requests for metric definitions. |
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.
Nice catch! 🦅👀
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.
Nice work, thanks for the effort you put into this @agorthi-akamai.
I posted a couple small suggestions that I'd like to see applied, and think there might be a stray inclusion in queries/cloudpulse/metrics.ts
that might not belong in this PR, but otherwise I'm quite happy with the state of this. Thanks again
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts
Outdated
Show resolved
Hide resolved
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.
Things look good to me, but there's a unit test failure for GlobalFilters.test.tsx
-- should be able to resolve it by updating
screen.getByRole('combobox', { name: 'Select Time Duration' }) |
to have name: 'Select a Time Duration'
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 echo both of the points above regarding the removal of the doc comments and using template string literals
All comments are addressed. |
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.
All checks pass now ✅
Thanks for all the changes and fixes!
Cloud Manager E2E Run #6631
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6631
|
Run duration | 26m 19s |
Commit |
f49d104f6c: test: [DI-20585] - Add ACLP Cypress Test Coverage for Linode Dashboard Widgets (...
|
Committer | agorthi-akamai |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
2
|
Pending |
2
|
Skipped |
0
|
Passing |
425
|
View all changes introduced in this branch ↗︎ |
…d Widgets (linode#10891) * upcoming:[DI-20585]- added aclp e2e test cases * upcoming:[DI-20585]- added aclp e2e test cases * upcoming:[DI-20585]- added missing message constants file * upcoming:[DI-20585]- added cloudpulse tsx file under ui/util files * upcoming:[DI-20585]- added findByPlaceholderCustom for selectServiceName * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming: [DI-20585] - Fix validation for feature flag test case * upcoming: [DI-20585] - Enable services call through mock * upcoming: [DI-20585] - Flow update for widget tests * upcoming:[DI-20585]- Added code review comments and fixing few mocking issues * upcoming:[DI-20585]- Added code review comments and fixing few mocking issues * upcoming:[DI-20585]- Added code review comments and fixing few mocking issues * upcoming:[DI-20585]- Added code factories to mock the data * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- renaming intercept methods to mocks * upcoming:[DI-20585]- renaming intercept methods to mocks * upcoming:[DI-20585]- renaming intercept methods to mocks * upcoming:[DI-20585]- renaming intercept methods to mocks * upcoming:[DI-20585]- fixing zoom-in/out canvas issue * upcoming:[DI-20585]- fixing code review coments * upcoming:[DI-20585]- fixing code review coments * upcoming:[DI-20585]- Added code review comments and adding placeholder values in CloudPulseCustomSelect.tsx * DI-20360: Added change set * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- fixing conflict * upcoming:[DI-20585]- fixing place holder values * tests: [DI-20585] - Use Icon button with aria label for svg icons and remove ui.cloudpulse * upcoming:[DI-20585]- Added code review comments * tests: [DI-20585] - Factories implementation instead of functions * upcoming: [DI-20800] - cypress changes * tests: [DI-20585] - Enabling auto highlight for selections * tests: [DI-20585] - Revert not needed changes * tests: [DI-20585] - Selection update for custom select component * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review commennts * tests: [DI-20585] - PR comments for aria label * upcoming:[DI-20585]- Added code review commennts * upcoming:[DI-20585]- Added code review commennts * tests: [DI-20585] - Code clean ups and refactoring * upcoming:[DI-20585]- Added code review commennts * tests: [DI-20585] - CamelCase for variables * tests: [DI-20585] - Title validations * upcoming:[DI-20585]- Added code review commennts * upcoming:[DI-20585]- Added code review commennts * tests: [DI-20585] - Code clean up and refactoring work * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * tests: [DI-20585] - Removed widget header title * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * yarn file reverting * Syncing file processesLanding.tsx with develop * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments * upcoming:[DI-20585]- Added code review comments --------- Co-authored-by: vmangalr <vmangalr@akamai.com> Co-authored-by: venkatmano-akamai <chk-Venkatesh@outlook.com>
Description 📝
Added aclp e2e test cases
Changes 🔄
List any change relevant to the reviewer.
How to test 🧪
As an Author I have considered 🤔
Check all that apply