mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Fixed unstable test (#11583)
This commit is contained in:
parent
ea0abbffb4
commit
24ba5301d1
@ -60,13 +60,23 @@ describe('Visualization > Bubble', () => {
|
|||||||
// Number of circles are pretty unstable when there are a lot of circles
|
// Number of circles are pretty unstable when there are a lot of circles
|
||||||
// Since main functionality is already covered in fitler test below,
|
// Since main functionality is already covered in fitler test below,
|
||||||
// skip this test untill we find a solution.
|
// skip this test untill we find a solution.
|
||||||
it.skip('should work', () => {
|
it('should work', () => {
|
||||||
verify(BUBBLE_FORM_DATA);
|
cy.visitChartByParams(JSON.stringify(BUBBLE_FORM_DATA)).then(() => {
|
||||||
// number of circles = 214 rows
|
cy.wait('@getJson').then(xhr => {
|
||||||
cy.get('.chart-container svg .nv-point-clips circle').should(
|
let expectedBubblesNumber = 0;
|
||||||
'have.length',
|
xhr.responseBody.data.forEach(element => {
|
||||||
214,
|
expectedBubblesNumber += element.values.length;
|
||||||
);
|
});
|
||||||
|
cy.get('[data-test="chart-container"]')
|
||||||
|
.should('be.visible', { timeout: 15000 })
|
||||||
|
.within(() => {
|
||||||
|
cy.get('svg')
|
||||||
|
.should('exist')
|
||||||
|
.find('.nv-point-clips circle')
|
||||||
|
.should('have.length', expectedBubblesNumber);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work with filter', () => {
|
it('should work with filter', () => {
|
||||||
@ -84,8 +94,11 @@ describe('Visualization > Bubble', () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
cy.get('.chart-container svg .nv-point-clips circle')
|
cy.get('[data-test="chart-container"]')
|
||||||
.should('have.length', 8)
|
.should('be.visible')
|
||||||
|
.within(() => {
|
||||||
|
cy.get('svg').find('.nv-point-clips circle').should('have.length', 8);
|
||||||
|
})
|
||||||
.then(nodeList => {
|
.then(nodeList => {
|
||||||
// Check that all circles have same color.
|
// Check that all circles have same color.
|
||||||
const color = nodeList[0].getAttribute('fill');
|
const color = nodeList[0].getAttribute('fill');
|
||||||
|
@ -61,9 +61,13 @@ Cypress.Commands.add('verifyResponseCodes', (xhr: XMLHttpRequest, callback) => {
|
|||||||
|
|
||||||
Cypress.Commands.add('verifySliceContainer', chartSelector => {
|
Cypress.Commands.add('verifySliceContainer', chartSelector => {
|
||||||
// After a wait response check for valid slice container
|
// After a wait response check for valid slice container
|
||||||
cy.get('.slice_container').within(() => {
|
cy.get('.slice_container')
|
||||||
|
.should('be.visible')
|
||||||
|
.within(() => {
|
||||||
if (chartSelector) {
|
if (chartSelector) {
|
||||||
cy.get(chartSelector).then(chart => {
|
cy.get(chartSelector)
|
||||||
|
.should('be.visible')
|
||||||
|
.then(chart => {
|
||||||
expect(chart[0].clientWidth).greaterThan(0);
|
expect(chart[0].clientWidth).greaterThan(0);
|
||||||
expect(chart[0].clientHeight).greaterThan(0);
|
expect(chart[0].clientHeight).greaterThan(0);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user