Skip to content
Snippets Groups Projects
Unverified Commit 0eed1f2d authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Fix sending search snowplow events (#31762)

parent 68ba6788
No related merge requests found
import { restore } from "e2e/support/helpers";
import {
describeWithSnowplow,
enableTracking,
expectGoodSnowplowEvents,
expectNoBadSnowplowEvents,
resetSnowplow,
restore,
} from "e2e/support/helpers";
import { ORDERS_QUESTION_ID } from "e2e/support/cypress_sample_instance_data";
describe("scenarios > auth > search", () => {
describe("scenarios > search", () => {
beforeEach(restore);
describe("universal search", () => {
......@@ -63,6 +70,28 @@ describe("scenarios > auth > search", () => {
});
});
describeWithSnowplow("scenarios > search", () => {
const PAGE_VIEW_EVENT = 1;
beforeEach(() => {
restore();
resetSnowplow();
cy.signInAsAdmin();
enableTracking();
});
afterEach(() => {
expectNoBadSnowplowEvents();
});
it("should send snowplow events for global search queries", () => {
cy.visit("/");
expectGoodSnowplowEvents(PAGE_VIEW_EVENT);
cy.findByPlaceholderText("Search…").type("Orders").blur();
expectGoodSnowplowEvents(PAGE_VIEW_EVENT + 1); // new_search_query
});
});
function getProductsSearchResults() {
cy.findByText("Products");
// This part about the description reproduces metabase#20018
......
......@@ -17,11 +17,14 @@
},
"runtime_milliseconds": {
"description": "Number of milliseconds it took to successfully run the search query",
"type": "integer",
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 2147483647
}
},
"required": ["runtime"],
"required": ["event"],
"additionalProperties": true
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment