Skip to content
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

Merged
merged 1 commit into from
Jan 3, 2020
Merged

test: fix flaky explorer tests #16392

merged 1 commit into from
Jan 3, 2020

Conversation

hoorayimhelping
Copy link
Contributor

@hoorayimhelping hoorayimhelping commented Jan 2, 2020

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.

@hoorayimhelping hoorayimhelping force-pushed the bs_e2e_work branch 4 times, most recently from 3a9ade4 to 90cbfd2 Compare January 3, 2020 19:36
@hoorayimhelping hoorayimhelping changed the title Bs e2e work test: fix flaky explorer tests Jan 3, 2020
ui/package.json Outdated Show resolved Hide resolved
@@ -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" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier /shrug

Copy link
Contributor

@121watts 121watts left a 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?

@hoorayimhelping
Copy link
Contributor Author

@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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('disables submit when a query is deleted', () => {
for (let i = 0; i < 50; i++) {
it('disables submit when a query is deleted', () => {

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate Flaky Exlporer Tests
2 participants