-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe("Search Query", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
|
||
cy.request("POST", "api/queries", { | ||
name: "Users Count", | ||
data_source_id: 1, | ||
query: "SELECT 1" | ||
}); | ||
|
||
cy.request("POST", "api/queries", { | ||
name: "Dashboards Count", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to add a There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Thanks. I'll update the tests to do this form now. |
||
data_source_id: 1, | ||
query: "SELECT 1" | ||
}); | ||
|
||
cy.visit("/"); | ||
}); | ||
|
||
it("finds queries by name", () => { | ||
cy.getByTestId("AppHeaderSearch").type("Users{enter}"); | ||
cy.contains("Users 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.
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.