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 2018/09/10 17:35:32 UTC

[GitHub] kristw commented on a change in pull request #5846: Adding line and big number total integration tests

kristw commented on a change in pull request #5846: Adding line and big number total integration tests
URL: https://github.com/apache/incubator-superset/pull/5846#discussion_r216406326
 
 

 ##########
 File path: superset/assets/cypress/support/commands.js
 ##########
 @@ -50,10 +50,40 @@ Cypress.Commands.add('visitChartByParams', (params) => {
   cy.visit(`${BASE_EXPLORE_URL}${params}`);
 });
 
-Cypress.Commands.add('verifySliceSuccess', (waitAlias) => {
+Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg }) => {
   cy.wait([waitAlias]).then((data) => {
     expect(data.status).to.eq(200);
     expect(data.response.body).to.have.property('error', null);
-    cy.get('.slice_container');
+    expect(data.response.query).contains(querySubstring);
+    cy.get('.slice_container').within(() => {
+      if (getSvg !== false) {
+        cy.get('svg').should('have.attr', 'height').then((height) => {
+          expect(height).greaterThan(0);
+        });
+        cy.get('svg').should('have.attr', 'width').then((width) => {
+          expect(width).greaterThan(0);
+        });
+      }
+    });
+  });
+});
+
+Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => {
 
 Review comment:
   Perhaps change `getSvg` to `chartSelector='svg'` will make this more flexible and support non-svg charts as well. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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