Skip to content
Snippets Groups Projects
Unverified Commit 072c0f39 authored by Aleksandr Lesnenko's avatar Aleksandr Lesnenko Committed by GitHub
Browse files

fix native editor flakes (#30087)

parent fb4868b5
No related branches found
No related tags found
No related merge requests found
......@@ -296,9 +296,9 @@ describe("scenarios > question > native", () => {
).as("databasePrompt");
openNativeEditor();
cy.findByLabelText("Ask a question").click();
ensureDatabasePickerIsHidden();
cy.wait(100);
cy.findByLabelText("Ask a question").click();
cy.findByPlaceholderText("Ask anything...")
.focus()
......@@ -322,10 +322,9 @@ describe("scenarios > question > native", () => {
}).as("databasePrompt");
openNativeEditor();
cy.findByLabelText("Ask a question").click();
ensureDatabasePickerIsHidden();
// When the native query editor is being initialized it acquires focus
cy.wait(100);
cy.findByLabelText("Ask a question").click();
cy.findByPlaceholderText("Ask anything...")
.focus()
......@@ -343,6 +342,7 @@ describe("scenarios > question > native", () => {
).as("databasePrompt");
cy.findByDisplayValue(PROMPT).type(" fixed{enter}");
cy.wait("@databasePrompt");
runQuery();
cy.findByText("18,760");
......@@ -351,6 +351,12 @@ describe("scenarios > question > native", () => {
});
const runQuery = () => {
cy.get(".NativeQueryEditor .Icon-play").click();
cy.findByTestId("native-query-editor-container").within(() => {
cy.button("Get Answer").click();
});
cy.wait("@dataset");
};
function ensureDatabasePickerIsHidden() {
cy.get("#DatabasePicker").should("not.exist");
}
......@@ -577,7 +577,10 @@ class NativeQueryEditor extends Component {
);
return (
<NativeQueryEditorRoot className="NativeQueryEditor bg-light full">
<NativeQueryEditorRoot
className="NativeQueryEditor bg-light full"
data-testid="native-query-editor-container"
>
{hasTopBar && (
<div className="flex align-center" data-testid="native-query-top-bar">
{canChangeDatabase && (
......
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