Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Creating commands to verify codes and slices * Creating tests for table and dist bar
- Loading branch information
1 parent
42ab175
commit 8cb734d
Showing
6 changed files
with
237 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
superset/assets/cypress/integration/explore/visualizations/dist_bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { FORM_DATA_DEFAULTS, NUM_METRIC } from './shared.helper'; | ||
|
||
// Dist bar | ||
|
||
describe('Distribution bar chart', () => { | ||
const VIZ_DEFAULTS = { ...FORM_DATA_DEFAULTS, viz_type: 'dist_bar' }; | ||
|
||
beforeEach(() => { | ||
cy.login(); | ||
cy.server(); | ||
cy.route('POST', '/superset/explore_json/**').as('getJson'); | ||
}); | ||
|
||
it('Test dist bar with adhoc metric', () => { | ||
const formData = { ...VIZ_DEFAULTS, metrics: NUM_METRIC, groupby: ['state'] }; | ||
|
||
cy.visitChartByParams(JSON.stringify(formData)); | ||
cy.verifySliceSuccess({ | ||
waitAlias: '@getJson', | ||
querySubstring: NUM_METRIC.label, | ||
chartSelector: 'svg', | ||
}); | ||
}); | ||
|
||
it('Test dist bar with series', () => { | ||
const formData = { | ||
...VIZ_DEFAULTS, | ||
metrics: NUM_METRIC, | ||
groupby: ['state'], | ||
columns: ['gender'], | ||
}; | ||
|
||
cy.visitChartByParams(JSON.stringify(formData)); | ||
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' }); | ||
}); | ||
|
||
it('Test dist bar with row limit', () => { | ||
const formData = { | ||
...VIZ_DEFAULTS, | ||
metrics: NUM_METRIC, | ||
groupby: ['state'], | ||
row_limit: 10, | ||
}; | ||
|
||
cy.visitChartByParams(JSON.stringify(formData)); | ||
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' }); | ||
}); | ||
|
||
it('Test dist bar with contribution', () => { | ||
const formData = { | ||
...VIZ_DEFAULTS, | ||
metrics: NUM_METRIC, | ||
groupby: ['state'], | ||
columns: ['gender'], | ||
contribution: true, | ||
}; | ||
|
||
cy.visitChartByParams(JSON.stringify(formData)); | ||
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.