E2E test for query search#3633
Conversation
| @@ -0,0 +1,24 @@ | |||
| describe("Search Query", () => { | |||
There was a problem hiding this comment.
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.
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.
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.
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.
👍 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.