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

E2E test for query search #3633

Merged
merged 2 commits into from
Mar 24, 2019
Merged

E2E test for query search #3633

merged 2 commits into from
Mar 24, 2019

Conversation

arikfr
Copy link
Member

@arikfr arikfr commented Mar 24, 2019

What type of PR is this? (check all applicable)

  • E2E test

Description

This is a very basic search test to reproduce #3602.

Related Tickets & Documents

#3631 should have this test passing.

@@ -0,0 +1,24 @@
describe("Search Query", () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Once I see a failing build for this PR, I'm going to merge this so I can test #3631. But please do take a moment to review it and suggest improvements if needed.

});

cy.request("POST", "api/queries", {
name: "Dashboards Count",
Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to add a not contains assertion in my test, but didn't see how to do this. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I think the way to do it is to wrap the result table and:

cy.getByTestIdOrAth('QuerySearchResult').should(($resultTable) => {
  expect($resultTable).to.contain('Expected Result');
  expect($resultTable).not.to.contain('Anything else');
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly.
@arikfr your test will return ANY element in the page that contains that text. So if this query showed up in the "favorites" dropdown, this would always be true...

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Thanks.

I'll update the tests to do this form now.

@arikfr arikfr merged commit e712c19 into master Mar 24, 2019
@arikfr arikfr deleted the e2e-search-test branch March 24, 2019 13:20
@ranbena
Copy link
Contributor

ranbena commented Mar 24, 2019

arikfr merged commit

I was about to reject this!

@arikfr
Copy link
Member Author

arikfr commented Mar 24, 2019

@ranbena as I'm on schedule here, I wanted to see #3631 passing with this test and then to create #3634. Now they all green and in progress I can apply your reviews to this test.

harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
* Apply prettier to app-header.html.
* Add: E2E test for query search
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.

3 participants