-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: fix flaky explorer tests #16392
Conversation
3a9ade4
to
90cbfd2
Compare
@@ -12,7 +12,8 @@ describe('Onboarding.Components.DataListening', () => { | |||
describe('if button is clicked', () => { | |||
it('displays connection information', () => { | |||
const {getByTitle, getByText} = renderWithRedux( | |||
<DataListening bucket="bucket" />) | |||
<DataListening bucket="bucket" /> |
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.
prettier /shrug
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 discovery on that! Might I suggest running these like 50 times in a loop on circle?
90cbfd2
to
463c51c
Compare
@121watts been rerunning the tests in circle with no issue, can you show me how you make a loop? where do you put the loop? |
@@ -359,16 +358,16 @@ describe('DataExplorer', () => { | |||
cy.getByTestID('time-machine-submit-button').should('be.disabled') | |||
|
|||
cy.getByTestID('flux-editor').within(() => { | |||
cy.get('textarea').type('yo', {force: true}) | |||
cy.get('.CodeMirror').type('yo') | |||
cy.getByTestID('time-machine-submit-button').should('not.be.disabled') | |||
}) | |||
}) | |||
|
|||
it('disables submit when a query is deleted', () => { |
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('disables submit when a query is deleted', () => { | |
for (let i = 0; i < 50; i++) { | |
it('disables submit when a query is deleted', () => { |
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.
@hoorayimhelping here's an example of how to loop one test.
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.
sweet, thanks
223af9a
to
463c51c
Compare
Closes #16330
CodeMirror wraps the code textarea so it can apply eye candy to the text. Our tests were targeting the wrapped textarea and using the
force: true
flag to force cypress to type into it. This change instead targets the CodeMirror div that wraps the text area and doesn't force the typing. This seems to work as cypress waits for the text area to be typeable, which CodeMirror seems to handle.