-
Notifications
You must be signed in to change notification settings - Fork 917
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
refactor some query-enhancement utility functions, add some missing typings #9074
refactor some query-enhancement utility functions, add some missing typings #9074
Conversation
…ypings Signed-off-by: Justin Kim <[email protected]>
❌ Entry Too LongEntry is 139 characters long, which is 39 characters longer than the maximum allowed length of 100 characters. Please revise your entry to be within the maximum length. |
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
declare namespace Cypress { |
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 like this. We should add ts support to all the utilities, which can allow proper autocomplete and type check. I think we used to have in ftr repo.
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.
yeah i saw them more frequently in the ftr repo. I didn't add every single one here, i was mainly adding the ones that I was using just for my development benefit (IDE auto-complete) and decided to commit it to this PR. it would be great if later we can have full TS support for all of our utilities
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9074 +/- ##
=======================================
Coverage 60.86% 60.86%
=======================================
Files 3808 3808
Lines 91209 91209
Branches 14410 14410
=======================================
Hits 55516 55516
Misses 32153 32153
Partials 3540 3540
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM
Description
Refactors/additions for Cypress Query Enhancements
waitForLoader
to take optional argisEnhancement: boolean
cy.wait()
withinwaitForLoader
to speed up the commandwaitForLoaderNewHeader
command and refactor its' usage to bewaitForLoader(true)
cy.get('[type="data-source"]').contains(dataSource).click();
ifdataSource
prop is provided. This is because if your ws only has one data source, then this step is not visible in the UI, and this utility will failindexPatternHasTimefield: boolean
. This is needed because if the index pattern you select does not have a timefield, then the option of choosing a timestamp field does not appear, causing the test to failisEnhancement: boolean
propdeleteWorkspaceIndexPatterns
utilitynavigateToWorkSpaceSpecificPage
to be less flakyopen
state persists through navigation and refreshes. Therefore, in order to maintain consistent state before & after a function is run, if a function opens the bar, we should also add a step that closes it. This way we do not have to keep track of it'sopen
state.Issues Resolved
-n/a
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration