-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Conversation
@@ -0,0 +1,24 @@ | |||
describe("Search Query", () => { |
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.
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", |
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 wanted to add a not contains
assertion in my test, but didn't see how to do this. 🤔
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 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');
});
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.
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...
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.
👍 Thanks.
I'll update the tests to do this form now.
I was about to reject this! |
* Apply prettier to app-header.html. * Add: E2E test for query search
What type of PR is this? (check all applicable)
Description
This is a very basic search test to reproduce #3602.
Related Tickets & Documents
#3631 should have this test passing.