This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new cb6abe3  fix: attempt to fix the flaky SQL Lab test (#8212)
cb6abe3 is described below

commit cb6abe343b2d26d0973f7b06177a4d6118cbd9ea
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Tue Sep 10 22:16:26 2019 -0700

    fix: attempt to fix the flaky SQL Lab test (#8212)
    
    * fix: attempt to fix the flaky SQL Lab test
    
    https://docs.cypress.io/api/commands/clear.html#Syntax
    
    doubling our chances to selectall and clear the text box
    
    * Add {force: true}
    
    * fix typo
    
    * more clears
---
 superset/assets/cypress/integration/dashboard/controls.js | 2 +-
 superset/assets/cypress/integration/sqllab/query.js       | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/superset/assets/cypress/integration/dashboard/controls.js 
b/superset/assets/cypress/integration/dashboard/controls.js
index c569aad..306edb6 100644
--- a/superset/assets/cypress/integration/dashboard/controls.js
+++ b/superset/assets/cypress/integration/dashboard/controls.js
@@ -60,7 +60,7 @@ export default () => describe('top-level controls', () => {
       .find('.refresh-tooltip').trigger('click', { force: true });
 
     // not allow dashboard level force refresh when any chart is loading
-    cy.get('#save-dash-split-button').trigger('click', { forece: true });
+    cy.get('#save-dash-split-button').trigger('click', { force: true });
     cy.contains('Force refresh dashboard').parent().should('have.class', 
'disabled');
     // not allow chart level force refresh when it is loading
     cy.get(`#slice_${mapId}-controls`).next()
diff --git a/superset/assets/cypress/integration/sqllab/query.js 
b/superset/assets/cypress/integration/sqllab/query.js
index 0dc5fe8..1f373f4 100644
--- a/superset/assets/cypress/integration/sqllab/query.js
+++ b/superset/assets/cypress/integration/sqllab/query.js
@@ -34,7 +34,9 @@ export default () => {
       // are fetched below (because React _Virtualized_ does not render all 
rows)
       const rowLimit = 3;
 
-      cy.get('#brace-editor textarea').type(
+      cy.get('#brace-editor textarea')
+        .clear({ force: true })
+        .type(
         `{selectall}{backspace}SELECT ds, gender, name, num FROM 
main.birth_names LIMIT ${rowLimit}`,
         { force: true },
       );
@@ -68,6 +70,7 @@ export default () => {
       let savedQueryResultsTable = null;
 
       cy.get('#brace-editor textarea')
+        .clear({ force: true })
         .type(`{selectall}{backspace}${query}`, { force: true })
         .focus() // focus => blur is required for updating the query that is 
to be saved
         .blur();
@@ -87,7 +90,9 @@ export default () => {
         .click();
 
       // Enter name + save into modal
-      cy.get('.modal-sm 
input').type(`{selectall}{backspace}${savedQueryTitle}`, {
+      cy.get('.modal-sm input')
+        .clear({ force: true })
+        .type(`{selectall}{backspace}${savedQueryTitle}`, {
         force: true,
       });
 

Reply via email to