From c3d521fb9cc6a787d4d7791fe696204daacb2bb6 Mon Sep 17 00:00:00 2001 From: Gabriel Dutra Date: Tue, 30 Apr 2019 13:12:55 -0300 Subject: [PATCH 1/2] Fix Cypress create query spec --- client/cypress/integration/query/create_query_spec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/cypress/integration/query/create_query_spec.js b/client/cypress/integration/query/create_query_spec.js index ca91db921d..a151492b24 100644 --- a/client/cypress/integration/query/create_query_spec.js +++ b/client/cypress/integration/query/create_query_spec.js @@ -4,8 +4,7 @@ describe('Create Query', () => { cy.visit('/queries/new'); }); - // https://github.com/getredash/redash/issues/3688 - it.skip('executes the query', () => { + it('executes the query', () => { cy.getByTestId('SelectDataSource') .click() .contains('Test PostgreSQL').click(); @@ -18,5 +17,10 @@ describe('Create Query', () => { cy.getByTestId('DynamicTable').should('exist'); cy.percySnapshot('Edit Query'); + + // https://github.com/cypress-io/cypress/issues/2118 + cy.window().then((win) => { + win.onbeforeunload = null; + }); }); }); From 46892b0272cd7ebb5534c3e2d471704d38664954 Mon Sep 17 00:00:00 2001 From: Gabriel Dutra Date: Tue, 30 Apr 2019 13:50:27 -0300 Subject: [PATCH 2/2] Save query instead of using workaround --- client/cypress/integration/query/create_query_spec.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/cypress/integration/query/create_query_spec.js b/client/cypress/integration/query/create_query_spec.js index a151492b24..3b70bdf58f 100644 --- a/client/cypress/integration/query/create_query_spec.js +++ b/client/cypress/integration/query/create_query_spec.js @@ -4,7 +4,7 @@ describe('Create Query', () => { cy.visit('/queries/new'); }); - it('executes the query', () => { + it('executes and saves a query', () => { cy.getByTestId('SelectDataSource') .click() .contains('Test PostgreSQL').click(); @@ -18,9 +18,7 @@ describe('Create Query', () => { cy.getByTestId('DynamicTable').should('exist'); cy.percySnapshot('Edit Query'); - // https://github.com/cypress-io/cypress/issues/2118 - cy.window().then((win) => { - win.onbeforeunload = null; - }); + cy.getByTestId('SaveButton').click(); + cy.url().should('match', /\/queries\/\d+\/source/); }); });