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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]