Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions e2e/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const tableSchemas = {
"CREATE TABLE IF NOT EXISTS 'contains_magicword' (ts TIMESTAMP, magicword VARCHAR) timestamp (ts) PARTITION BY DAY;",
contains_simpleword:
"CREATE TABLE IF NOT EXISTS 'contains_simpleword' (timestamp TIMESTAMP, simpleword VARCHAR) timestamp (timestamp) PARTITION BY DAY;",
btc_trades_no_wal:
"CREATE TABLE IF NOT EXISTS 'btc_trades_no_wal' (symbol SYMBOL capacity 256 CACHE, side SYMBOL capacity 256 CACHE, price DOUBLE, amount DOUBLE, timestamp TIMESTAMP) timestamp (timestamp) PARTITION BY DAY BYPASS WAL;",
}

const materializedViewSchemas = {
Expand Down Expand Up @@ -521,6 +523,15 @@ Cypress.Commands.add("expandViews", () => {
})
})

Cypress.Commands.add("openDetailsDrawer", (name, kind = "table") => {
const titleHook =
kind === "matview" ? "schema-matview-title" : "schema-table-title"
cy.getByDataHook(titleHook).contains(name).click()
cy.realPress("Enter")
cy.getByDataHook("table-details-drawer").should("be.visible")
cy.getByDataHook("table-details-name").should("contain", name)
})

Cypress.Commands.add("getEditorTabs", () => {
return cy.get(".chrome-tab")
})
Expand Down
2 changes: 1 addition & 1 deletion e2e/questdb
Submodule questdb updated 116 files
99 changes: 5 additions & 94 deletions e2e/tests/console/aiAssistant.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

const {
PROVIDERS,
getOpenAIConfiguredSettings,
getAnthropicConfiguredSettings,
createToolCallFlow,
createMultiTurnFlow,
createResponse,
Expand Down Expand Up @@ -210,36 +212,6 @@ function interceptTokenValidation(provider, success) {
}
}

function getOpenAIConfiguredSettings() {
return {
"ai.assistant.settings": JSON.stringify({
selectedModel: "gpt-5-mini",
providers: {
openai: {
apiKey: "test-openai-key",
enabledModels: ["gpt-5-mini", "gpt-5"],
grantSchemaAccess: true,
},
},
}),
}
}

function getAnthropicConfiguredSettings() {
return {
"ai.assistant.settings": JSON.stringify({
selectedModel: "claude-sonnet-4-5",
providers: {
anthropic: {
apiKey: "test-anthropic-key",
enabledModels: ["claude-sonnet-4-5", "claude-opus-4-5"],
grantSchemaAccess: true,
},
},
}),
}
}

describe("ai assistant", () => {
beforeEach(() => {
cy.intercept("POST", PROVIDERS.openai.endpoint, (req) => {
Expand Down Expand Up @@ -951,8 +923,8 @@ describe("ai assistant", () => {
cy.getByDataHook("chat-history-item").should("have.length", 0)
cy.contains("No chats match your search").should("be.visible")

// When - Clear search with Escape key
cy.getByDataHook("chat-history-search").type("{esc}")
// When - Clear search with clear button
cy.getByDataHook("chat-history-search-clear").click()
cy.getByDataHook("chat-history-search").should("have.value", "")
cy.getByDataHook("chat-history-item").should("have.length", 3)
})
Expand Down Expand Up @@ -1412,28 +1384,6 @@ describe("ai assistant", () => {
const validSchemaResponse = createOpenAIExplainSchemaResponse({
explanation:
"The test_trades table stores trading data with symbol identification, price values, and timestamps.",
columns: [
{
name: "symbol",
description: "Stock ticker symbol identifier",
data_type: "SYMBOL",
},
{
name: "price",
description: "Trade execution price",
data_type: "DOUBLE",
},
{
name: "ts",
description: "Timestamp of the trade",
data_type: "TIMESTAMP",
},
],
storage_details: [
"WAL enabled for durability",
"Partitioned by DAY",
"Designated timestamp: ts",
],
})
interceptAIRequestWithResponse(
"openai",
Expand Down Expand Up @@ -1465,45 +1415,6 @@ describe("ai assistant", () => {
"contain",
"The test_trades table stores trading data",
)

// Verify Columns section header and table content
cy.getByDataHook("chat-message-assistant").should("contain", "Columns")
cy.getByDataHook("chat-message-assistant").should("contain", "symbol")
cy.getByDataHook("chat-message-assistant").should("contain", "SYMBOL")
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Stock ticker symbol identifier",
)
cy.getByDataHook("chat-message-assistant").should("contain", "price")
cy.getByDataHook("chat-message-assistant").should("contain", "DOUBLE")
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Trade execution price",
)
cy.getByDataHook("chat-message-assistant").should("contain", "ts")
cy.getByDataHook("chat-message-assistant").should("contain", "TIMESTAMP")
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Timestamp of the trade",
)

// Verify Storage Details section
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Storage Details",
)
cy.getByDataHook("chat-message-assistant").should(
"contain",
"WAL enabled for durability",
)
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Partitioned by DAY",
)
cy.getByDataHook("chat-message-assistant").should(
"contain",
"Designated timestamp: ts",
)
})

it("should show error when schema explanation fails to parse", () => {
Expand Down Expand Up @@ -1534,7 +1445,7 @@ describe("ai assistant", () => {
// Then - Should display error message
cy.getByDataHook("chat-message-error")
.should("be.visible")
.should("contain", "An unexpected error occurred. Please try again.")
.should("contain", "Failed to parse assistant response.")
})
})

Expand Down
13 changes: 7 additions & 6 deletions e2e/tests/console/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,14 @@ describe("questdb schema in read-only mode", () => {
cy.loadConsoleWithAuth()
})

it("should disable Create Table action in read-only mode", () => {
cy.getByDataHook("create-table-panel-button").trigger("mouseover")
it("should disable import CSV action in read-only mode", () => {
cy.getByDataHook("import-panel-button").realHover()
cy.wait(300)
cy.getByDataHook("tooltip").should(
"contain",
"To use this feature, turn off read-only mode in the configuration file",
)

cy.getByDataHook("create-table-panel-button").click()
cy.getByDataHook("create-table-panel").should("not.exist")
})
})
Expand Down Expand Up @@ -521,7 +521,8 @@ describe("views", () => {
cy.refreshSchema()
cy.expandViews()
cy.getByDataHook("schema-view-title").should("contain", "btc_trades_view")
cy.getByDataHook("schema-row-error-icon").trigger("mouseover")
cy.getByDataHook("schema-row-error-icon").realHover()
cy.wait(300)
cy.getByDataHook("tooltip")
.contains("View is invalid: table does not exist [table=btc_trades]")
.should("be.visible")
Expand Down Expand Up @@ -671,8 +672,8 @@ describe("materialized views", () => {
)
cy.refreshSchema()
cy.expandMatViews()
cy.getByDataHook("schema-row-error-icon").trigger("mouseover")

cy.getByDataHook("schema-row-error-icon").realHover()
cy.wait(300)
cy.getByDataHook("tooltip").should(
"contain",
"Materialized view is invalid: this is an invalidation reason",
Expand Down
Loading