Skip to content

Commit

Permalink
feat: Abbreviations spec test run with har replays now
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Jun 7, 2024
1 parent 68ea8d3 commit baa357c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion e2e/abbreviations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import { setup, sleep } from "./common";
import { harReplayGraphqlEndpointQueryParam } from "./har-utils";

const { test, expect } = setup();

test("it should be possible to enable abbreviations for colors & x field (column)", async ({
actions,
selectors,
page,
}) => {
if (process.env.E2E_HAR !== "false") {
await page.routeFromHAR(`./e2e/har/abbreviations/1.zip`, {
notFound: "fallback",
});
}

test.slow();

await actions.chart.createFrom({
iri: "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/6",
dataSource: "Prod",
createURLParams: harReplayGraphqlEndpointQueryParam,
});

await selectors.edition.drawerLoaded();
Expand Down Expand Up @@ -73,10 +82,18 @@ test("it should be possible to enable abbreviations for colors & x field (column
test("hierarchies: it should be possible to enable abbreviations for colors", async ({
actions,
selectors,
page,
}) => {
if (process.env.E2E_HAR !== "false") {
await page.routeFromHAR(`./e2e/har/abbreviations/2.zip`, {
notFound: "fallback",
});
}

await actions.chart.createFrom({
iri: "https://environment.ld.admin.ch/foen/ubd000502/4",
dataSource: "Prod",
createURLParams: harReplayGraphqlEndpointQueryParam,
});

await selectors.edition.drawerLoaded();
Expand Down Expand Up @@ -111,10 +128,17 @@ test("hierarchies: it should be possible to enable abbreviations for colors", as
]);
});

test("localized abbreviations", async ({ actions, selectors }) => {
test("localized abbreviations", async ({ actions, selectors, page }) => {
if (process.env.E2E_HAR !== "false") {
await page.routeFromHAR(`./e2e/har/abbreviations/3.zip`, {
notFound: "fallback",
});
}

await actions.chart.createFrom({
iri: "https://environment.ld.admin.ch/foen/gefahren-waldbrand-praeventionsmassnahmen-kantone/1",
dataSource: "Prod",
createURLParams: harReplayGraphqlEndpointQueryParam,
});

await selectors.edition.drawerLoaded();
Expand Down
Binary file added e2e/har/abbreviations/1.zip
Binary file not shown.
Binary file added e2e/har/abbreviations/2.zip
Binary file not shown.
Binary file added e2e/har/abbreviations/3.zip
Binary file not shown.

0 comments on commit baa357c

Please sign in to comment.