-
Notifications
You must be signed in to change notification settings - Fork 55
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
Cypress v12.8.1 - Fixes for apps #604
Conversation
Signed-off-by: TackAdam <navytackett@hotmail.com>
Codecov Report
@@ Coverage Diff @@
## main #604 +/- ##
==========================================
+ Coverage 43.12% 43.59% +0.47%
==========================================
Files 303 312 +9
Lines 18008 18581 +573
Branches 4434 4479 +45
==========================================
+ Hits 7766 8101 +335
- Misses 9709 10438 +729
+ Partials 533 42 -491
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: TackAdam <navytackett@hotmail.com>
@@ -85,15 +87,15 @@ describe('Creating application', () => { | |||
cy.get('[data-test-subj="createButton"]').should('not.be.disabled'); | |||
cy.get('[data-test-subj="createAndSetButton"]').should('be.disabled'); | |||
expectMessageOnHover('createAndSetButton', 'Log source is required to set availability.'); | |||
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus().type(baseQuery, {delay: TYPING_DELAY}); | |||
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus().type(' ' + baseQuery); |
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.
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.
Good to know this hack 😄 Also, did you try looking deeper on why it fails to type correctly?
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 wasn't able to find any specific cause for the mis-typing just that it is a known issue and most people add very long delays to attempt to fix it. This field specifically was only encountering the error at the start after testing a lot of possible fixes / ideas I had this seemed to be the only 100% reliable one.
@@ -85,15 +87,15 @@ describe('Creating application', () => { | |||
cy.get('[data-test-subj="createButton"]').should('not.be.disabled'); | |||
cy.get('[data-test-subj="createAndSetButton"]').should('be.disabled'); | |||
expectMessageOnHover('createAndSetButton', 'Log source is required to set availability.'); | |||
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus().type(baseQuery, {delay: TYPING_DELAY}); | |||
cy.get('[data-test-subj="searchAutocompleteTextArea"]').focus().type(' ' + baseQuery); |
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.
Good to know this hack 😄 Also, did you try looking deeper on why it fails to type correctly?
Signed-off-by: TackAdam <navytackett@hotmail.com>
cy.get(`[data-test-subj="${name}ApplicationLink"]`).click(); | ||
cy.wait(delay); | ||
cy.get('.euiTableRow').should('have.length.lessThan', 1);//Replaces Wait |
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.
what does less than 1 mean? You are looking for an empty table? Can we replace this to make it more clear?
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 is checking to see that that the clicking on the Application Link has fully loaded before searching for the name of the application. The table no longer exist on the new page so this ensures the loading completes and delays the next command "find applicationTitle" from occurring till it is on the page and able to be found.
cy.get('[title="Bar"]').click(); | ||
cy.wait(delay); | ||
cy.get('[data-test-subj="comboBoxInput"]').click(); | ||
cy.focused().type('{downArrow}'); |
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.
duplicate to line below?
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.
Was used to select TimeSeries as the third option by going down twice, adding a commit to make this more clear and select it in a better way. It previously selected Horizontal Bar which did not have the availability function.
@@ -372,11 +376,12 @@ describe('Viewing application', () => { | |||
cy.get('[data-test-subj="visualizeEditorRenderButton"]').click(); | |||
cy.get('[data-test-subj="eventExplorer__saveManagementPopover"]').click(); | |||
cy.get('[data-test-subj="eventExplorer__querySaveConfirm"]').click(); | |||
cy.wait(delay*5); |
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.
necessary?
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.
Think its safe to remove, was a problem originally but seems to be working without.
|
||
cy.wait(delay); | ||
cy.get('[data-test-subj="comboBoxInput"]').click(); | ||
cy.focused().type('{downArrow}'); |
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.
duplicate to below?
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.
Was used to select TimeSeries as the third option by going down twice, adding a commit to make this more clear and select it in a better way. It previously selected Horizontal Bar which did not have the availability function.
cy.get('[data-test-subj="superDatePickerShowDatesButton"]').should('contain', 'Last 24 months'); | ||
cy.get('.euiTab[id="availability-panel"]').click(); | ||
cy.get('[title="Bar"]').click(); | ||
|
||
cy.wait(delay); |
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.
necessary?
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.
Yes, I believe a button use to be required to be hit before adding availability that no longer exist.
@@ -325,19 +330,15 @@ describe('Viewing application', () => { | |||
|
|||
it('Saves visualization #1 to panel', () => { | |||
cy.get('[data-test-subj="app-analytics-panelTab"]').click(); | |||
cy.get('[data-test-subj="addVisualizationButton"]').first().click(); | |||
cy.wait(delay); | |||
cy.get('[data-test-subj="addVisualizationButton"]').last().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.
why changing from first to last?
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.
Both options perform the same, not sure why i switched it, replacing it with first as it was originally
cy.get(`[data-test-subj="${nameTwo}ApplicationLink"]`).click(); | ||
cy.get('.euiTableRow').should('have.length.lessThan', 1); |
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.
replace with 0 or something more clear?
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.
Signed-off-by: TackAdam <navytackett@hotmail.com>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-604-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4e33b99660a0250448cad1d8aede10429df8a313
# Push it to GitHub
git push --set-upstream origin backport/backport-604-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
Cypress v12.8.1 - Fixes for apps (cherry picked from commit 4e33b99) Signed-off-by: TackAdam <navytackett@hotmail.com>
Description
[Describe what this change achieves]
Fixes for cypress testing of apps.
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.