You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by su...@apache.org on 2021/03/24 20:29:43 UTC
[superset] branch behavior-driven-cypress updated (9f87846 ->
3f060fc)
This is an automated email from the ASF dual-hosted git repository.
suddjian pushed a change to branch behavior-driven-cypress
in repository https://gitbox.apache.org/repos/asf/superset.git.
from 9f87846 remove bootstrap usage from the filter test
new cae8116 fix race condition
new 3f060fc remove bootstrap from url params test
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../cypress/integration/dashboard/filter.test.ts | 2 +
.../integration/dashboard/url_params.test.ts | 57 ++++++++--------------
2 files changed, 22 insertions(+), 37 deletions(-)
[superset] 01/02: fix race condition
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
suddjian pushed a commit to branch behavior-driven-cypress
in repository https://gitbox.apache.org/repos/asf/superset.git
commit cae8116ce44ee5ffc8f989e2a894bfd039a331e6
Author: David Aaron Suddjian <aa...@gmail.com>
AuthorDate: Wed Mar 24 12:29:27 2021 -0700
fix race condition
---
.../cypress-base/cypress/integration/dashboard/filter.test.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
index b84d97d..739b6bc 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
@@ -21,6 +21,7 @@ import {
WORLD_HEALTH_CHARTS,
WORLD_HEALTH_DASHBOARD,
getChartAliases,
+ waitForChartLoad,
} from './dashboard.helper';
describe('Dashboard filter', () => {
@@ -30,6 +31,7 @@ describe('Dashboard filter', () => {
});
it('should apply filter', () => {
+ WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
getChartAliases(
WORLD_HEALTH_CHARTS.filter(({ viz }) => viz !== 'filter_box'),
).then(nonFilterChartAliases => {
[superset] 02/02: remove bootstrap from url params test
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
suddjian pushed a commit to branch behavior-driven-cypress
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 3f060fc563bc5652031e7b42d10bfccc9a12f9a3
Author: David Aaron Suddjian <aa...@gmail.com>
AuthorDate: Wed Mar 24 13:28:52 2021 -0700
remove bootstrap from url params test
---
.../integration/dashboard/url_params.test.ts | 57 ++++++++--------------
1 file changed, 20 insertions(+), 37 deletions(-)
diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts
index 72ce9b4..0f4b839 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.ts
@@ -16,52 +16,35 @@
* specific language governing permissions and limitations
* under the License.
*/
+import { parsePostForm, JsonObject } from 'cypress/utils';
import {
- isLegacyResponse,
- getChartAliases,
- parsePostForm,
- Dashboard,
- JsonObject,
-} from 'cypress/utils';
-import { WORLD_HEALTH_DASHBOARD } from './dashboard.helper';
+ WORLD_HEALTH_DASHBOARD,
+ WORLD_HEALTH_CHARTS,
+ waitForChartLoad,
+} from './dashboard.helper';
describe('Dashboard form data', () => {
const urlParams = { param1: '123', param2: 'abc' };
- let dashboard: Dashboard;
-
- beforeEach(() => {
+ before(() => {
cy.login();
cy.visit(WORLD_HEALTH_DASHBOARD, { qs: urlParams });
-
- cy.get('#app').then(data => {
- const bootstrapData = JSON.parse(data[0].dataset.bootstrap || '');
- dashboard = bootstrapData.dashboard_data;
- });
});
it('should apply url params to slice requests', () => {
- const aliases = getChartAliases(dashboard.slices);
- // wait and verify one-by-one
- cy.wait(aliases, { timeout: 18000 }).then(requests =>
- Promise.all(
- requests.map(async ({ response, request }) => {
- const responseBody = response?.body;
- if (isLegacyResponse(responseBody)) {
- const requestParams = JSON.parse(
- parsePostForm(request.body).form_data as string,
- );
- expect(requestParams.url_params).deep.eq(urlParams);
- } else {
- // TODO: export url params to chart data API
- request.body.queries.forEach(
- (query: { url_params: JsonObject }) => {
- expect(query.url_params).deep.eq(urlParams);
- },
- );
- }
- }),
- ),
- );
+ cy.intercept('/superset/explore_json/*', request => {
+ const requestParams = JSON.parse(
+ parsePostForm(request.body).form_data as string,
+ );
+ expect(requestParams.url_params).deep.eq(urlParams);
+ });
+ cy.intercept('/api/v1/chart/data?*', request => {
+ // TODO: export url params to chart data API
+ request.body.queries.forEach((query: { url_params: JsonObject }) => {
+ expect(query.url_params).deep.eq(urlParams);
+ });
+ });
+
+ WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
});
});