Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding line and big number total integration tests #5846

Merged

Conversation

michellethomas
Copy link
Contributor

Created tests for different configurations of line chart and big number total.

Adding a check for svg height and width > 0 where appropriate. Also adding a check if the query contains a substring (to make sure the metric exists in the query for example).

@graceguo-supercat @kristw

@@ -4,7 +4,6 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps break this file into multiple files, one per chart, to avoid this becoming viz.py

});
});

Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate commands?

Copy link
Contributor

@kristw kristw Sep 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps change getSvg:boolean to chartSelector:String will make this more flexible and support non-svg charts as well.

Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => {
cy.wait([waitAlias]).then((data) => {
expect(data.status).to.eq(200);
expect(data.response.body).to.have.property('error', null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work if error is undefined?

}
cy.get('.slice_container').within(() => {
if (getSvg) {
cy.get('svg').should('have.attr', 'height').then((height) => {
Copy link
Contributor

@kristw kristw Sep 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// change 'svg' to the chartSelector parameter to support 'div', 'table', etc.
if(chartSelector) {
cy.get(chartSelector).then(chart => {
  // This should work for getting DOM element dimension in general
  // to support div that has no 'width', 'height' attributes.
  expect(chart.clientWidth).greaterThan(0);
  expect(chart.clientHeight).greaterThan(0);
});
}

});

Cypress.Commands.add('verifySliceSuccess', ({ waitAlias, querySubstring, getSvg = true }) => {
cy.wait([waitAlias]).then((data) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can cy.wait() take the alias string directly without wrapping it into an array?

cy.wait(waitAlias)

@codecov-io
Copy link

codecov-io commented Sep 10, 2018

Codecov Report

Merging #5846 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5846      +/-   ##
==========================================
+ Coverage   63.73%   63.75%   +0.01%     
==========================================
  Files         368      374       +6     
  Lines       23221    23320      +99     
  Branches     2600     2608       +8     
==========================================
+ Hits        14801    14867      +66     
- Misses       8405     8440      +35     
+ Partials       15       13       -2
Impacted Files Coverage Δ
superset/assets/src/welcome/App.jsx 0% <0%> (-94.45%) ⬇️
superset/assets/src/common.js 0% <0%> (-40%) ⬇️
.../explore/components/controls/DateFilterControl.jsx 56.64% <0%> (-3.91%) ⬇️
superset/stats_logger.py 62.22% <0%> (-1.89%) ⬇️
...rset/assets/src/SqlLab/components/TableElement.jsx 94.04% <0%> (-1.2%) ⬇️
...src/explore/components/controls/SpatialControl.jsx 32.94% <0%> (-0.78%) ⬇️
superset/assets/src/SqlLab/actions.js 71.25% <0%> (ø) ⬆️
superset/assets/src/profile/index.jsx 0% <0%> (ø) ⬆️
...isualizations/deckgl/AnimatableDeckGLContainer.jsx 0% <0%> (ø) ⬆️
superset/assets/src/addSlice/index.jsx 0% <0%> (ø) ⬆️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 517fea3...c751ab4. Read the comment docs.

@michellethomas
Copy link
Contributor Author

Thanks for all the good comments Krist!

@graceguo-supercat graceguo-supercat merged commit 6ae285b into apache:master Sep 11, 2018
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* Adding line and big number total integration tests

* Breakout visualization tests into multiple files
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Adding line and big number total integration tests

* Breakout visualization tests into multiple files
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants