Skip to content

E2E test for query search#3633

Merged
arikfr merged 2 commits into
masterfrom
e2e-search-test
Mar 24, 2019
Merged

E2E test for query search#3633
arikfr merged 2 commits into
masterfrom
e2e-search-test

Conversation

@arikfr

@arikfr arikfr commented Mar 24, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

ranbena commented Mar 24, 2019

Copy link
Copy Markdown
Contributor

arikfr merged commit

I was about to reject this!

@arikfr

arikfr commented Mar 24, 2019

Copy link
Copy Markdown
Member Author

@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