mirror of
https://github.com/apache/superset.git
synced 2026-06-08 00:59:17 +00:00
try just waiting
This commit is contained in:
@@ -40,15 +40,9 @@ export default () =>
|
||||
filterId = dashboard.slices.find(
|
||||
slice => slice.form_data.viz_type === 'filter_box',
|
||||
).slice_id;
|
||||
aliases = sliceIds.map(id => {
|
||||
const alias = getAlias(id);
|
||||
const url = `/superset/explore_json/?*{"slice_id":${id}}*`;
|
||||
cy.route('POST', url).as(alias.slice(1));
|
||||
return alias;
|
||||
});
|
||||
|
||||
// wait the initial page load requests
|
||||
cy.wait(aliases);
|
||||
cy.wait(10000);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ import { WORLD_HEALTH_DASHBOARD } from './dashboard.helper';
|
||||
|
||||
export default () =>
|
||||
describe('load', () => {
|
||||
const aliases = [];
|
||||
|
||||
beforeEach(() => {
|
||||
cy.server();
|
||||
cy.login();
|
||||
@@ -33,18 +31,12 @@ export default () =>
|
||||
const bootstrapData = JSON.parse(data[0].dataset.bootstrap);
|
||||
const slices = bootstrapData.dashboard_data.slices;
|
||||
// then define routes and create alias for each requests
|
||||
slices.forEach(slice => {
|
||||
const alias = `getJson_${slice.slice_id}`;
|
||||
const formData = `{"slice_id":${slice.slice_id}}`;
|
||||
cy.route('POST', `/superset/explore_json/?*${formData}*`).as(alias);
|
||||
aliases.push(`@${alias}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should load dashboard', () => {
|
||||
// wait and verify one-by-one
|
||||
cy.wait(aliases).then(requests => {
|
||||
cy.wait(10000).then(requests => {
|
||||
return Promise.all(
|
||||
requests.map(async xhr => {
|
||||
expect(xhr.status).to.eq(200);
|
||||
|
||||
@@ -39,17 +39,7 @@ export default () =>
|
||||
});
|
||||
|
||||
it('should apply url params to slice requests', () => {
|
||||
const aliases = [];
|
||||
sliceIds.forEach(id => {
|
||||
const alias = `getJson_${id}`;
|
||||
aliases.push(`@${alias}`);
|
||||
cy.route(
|
||||
'POST',
|
||||
`/superset/explore_json/?form_data={"slice_id":${id}}&dashboard_id=${dashboardId}`,
|
||||
).as(alias);
|
||||
});
|
||||
|
||||
cy.wait(aliases).then(requests => {
|
||||
cy.wait(10000).then(requests => {
|
||||
requests.forEach(xhr => {
|
||||
const requestFormData = xhr.request.body;
|
||||
const requestParams = JSON.parse(requestFormData.get('form_data'));
|
||||
|
||||
Reference in New Issue
Block a user