mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -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
|
||||
// Since main functionality is already covered in fitler test below,
|
||||
// skip this test untill we find a solution.
|
||||
it.skip('should work', () => {
|
||||
verify(BUBBLE_FORM_DATA);
|
||||
// number of circles = 214 rows
|
||||
cy.get('.chart-container svg .nv-point-clips circle').should(
|
||||
'have.length',
|
||||
214,
|
||||
);
|
||||
it('should work', () => {
|
||||
cy.visitChartByParams(JSON.stringify(BUBBLE_FORM_DATA)).then(() => {
|
||||
cy.wait('@getJson').then(xhr => {
|
||||
let expectedBubblesNumber = 0;
|
||||
xhr.responseBody.data.forEach(element => {
|
||||
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', () => {
|
||||
@ -84,8 +94,11 @@ describe('Visualization > Bubble', () => {
|
||||
},
|
||||
],
|
||||
});
|
||||
cy.get('.chart-container svg .nv-point-clips circle')
|
||||
.should('have.length', 8)
|
||||
cy.get('[data-test="chart-container"]')
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
cy.get('svg').find('.nv-point-clips circle').should('have.length', 8);
|
||||
})
|
||||
.then(nodeList => {
|
||||
// Check that all circles have same color.
|
||||
const color = nodeList[0].getAttribute('fill');
|
||||
|
@ -61,14 +61,18 @@ Cypress.Commands.add('verifyResponseCodes', (xhr: XMLHttpRequest, callback) => {
|
||||
|
||||
Cypress.Commands.add('verifySliceContainer', chartSelector => {
|
||||
// After a wait response check for valid slice container
|
||||
cy.get('.slice_container').within(() => {
|
||||
if (chartSelector) {
|
||||
cy.get(chartSelector).then(chart => {
|
||||
expect(chart[0].clientWidth).greaterThan(0);
|
||||
expect(chart[0].clientHeight).greaterThan(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
cy.get('.slice_container')
|
||||
.should('be.visible')
|
||||
.within(() => {
|
||||
if (chartSelector) {
|
||||
cy.get(chartSelector)
|
||||
.should('be.visible')
|
||||
.then(chart => {
|
||||
expect(chart[0].clientWidth).greaterThan(0);
|
||||
expect(chart[0].clientHeight).greaterThan(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
return cy;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user