You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/25 11:56:13 UTC

[GitHub] [superset] geido commented on a diff in pull request #21184: chore: Add new e2e tests for Explore

geido commented on code in PR #21184:
URL: https://github.com/apache/superset/pull/21184#discussion_r954873346


##########
superset-frontend/cypress-base/cypress/integration/sqllab/query.test.ts:
##########
@@ -157,4 +147,52 @@ describe('SqlLab query panel', () => {
       assertSQLLabResultsAreEqual(initialResultsTable, savedQueryResultsTable);
     });
   });
+
+  it('Create a chart from a query', () => {
+    cy.intercept('/superset/sql_json/').as('queryFinished');
+    cy.intercept('**/api/v1/explore/**').as('explore');
+    cy.intercept('**/api/v1/chart/**').as('chart');
+
+    // cypress doesn't handle opening a new tab, override window.open to open in the same tab
+    cy.window().then(win => {
+      cy.stub(win, 'open', url => {
+        // eslint-disable-next-line no-param-reassign
+        win.location.href = url;
+      });
+    });
+
+    const query = 'SELECT gender, name FROM main.birth_names';
+
+    cy.get('.ace_text-input')
+      .focus()
+      .clear({ force: true })
+      .type(`{selectall}{backspace}${query}`, { force: true });
+    cy.get('.sql-toolbar button').contains('Run').click();
+    cy.wait('@queryFinished');
+
+    cy.get(
+      '.SouthPane .ant-tabs-content > .ant-tabs-tabpane-active > div button:first',
+      { timeout: 10000 },

Review Comment:
   Just out of curiosity, what's the reason of this high timeout?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org