Skip to content

Commit 3f2ac93

Browse files
committed
Add Playwright configuration and end-to-end tests; update dependencies and ignore files
1 parent c26fde9 commit 3f2ac93

File tree

15 files changed

+257
-411
lines changed

15 files changed

+257
-411
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
/.externalToolBuilders/
1616
/package-lock.json
1717
/gulpfile.overrides.js
18+
src/test/end-to-end/test/snapshots/local

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@conterra/ct-mapapps-typings": "~4.18.3",
1313
"@conterra/mapapps-mocha-runner": "1.1.1",
1414
"@conterra/reactivity-core": "^0.4.0",
15+
"@playwright/test": "^1.52.0",
1516
"@types/chai": "4.3.10",
1617
"@types/license-checker": "^25.0.6",
1718
"@types/mocha": "10.0.4",

playwright.config.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (C) con terra GmbH
3+
*/
4+
import {
5+
defineConfig,
6+
devices,
7+
PlaywrightTestConfig
8+
} from "@playwright/test";
9+
import { env } from "process";
10+
11+
/**
12+
* See https://playwright.dev/docs/test-configuration.
13+
*/
14+
const baseURL = env.BASE_URL || "http://localhost:9090";
15+
const testDir = env.TESTS_DIR || "./src/test/end-to-end/test";
16+
const outputDir = env.TARGET_DIR || "./target/playwright/output";
17+
18+
const isCI = !!env.CI;
19+
20+
const snapshotsFolder = env.SNAPSHOTS_DIR || "./src/test/end-to-end/test/snapshots/local";
21+
22+
const config: PlaywrightTestConfig = {
23+
testDir,
24+
outputDir: `${outputDir}/results`,
25+
26+
snapshotPathTemplate: `${snapshotsFolder}/{testFileName}-snapshots/{arg}-{projectName}{ext}`,
27+
28+
/* Run tests in files in parallel */
29+
fullyParallel: true,
30+
/* Retry on CI only */
31+
retries: isCI ? 1 : 0,
32+
/* Fail the build on CI if you accidentally left test.only in the source code. */
33+
forbidOnly: isCI,
34+
/* Opt out of parallel tests on CI. */
35+
workers: isCI ? 1 : 2,
36+
37+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
38+
use: {
39+
/* Base URL to use in actions like `await page.goto('/')`. */
40+
baseURL,
41+
42+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
43+
trace: "on-first-retry"
44+
},
45+
46+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
47+
reporter: [
48+
[
49+
"html",
50+
{
51+
outputFolder: `${outputDir}/reports/html`,
52+
open: isCI ? "never" : "always"
53+
}
54+
],
55+
["junit", { outputFile: `${outputDir}/reports/junit/results.xml` }]
56+
],
57+
58+
expect: {
59+
toHaveScreenshot: {
60+
maxDiffPixelRatio: 0.1,
61+
threshold: 0.05
62+
},
63+
// increased timeout (default is 5000)
64+
// pro: less flaky tests, no need to wait for network state
65+
// con: longer test duration where assertions are failing
66+
timeout: 30000
67+
},
68+
69+
/* Configure projects for major browsers */
70+
projects: [
71+
{
72+
name: "Desktop Chrome",
73+
use: {
74+
...devices["Desktop Chrome"],
75+
launchOptions: {
76+
// enable WEBGL for headless tests
77+
args: isCI
78+
? ["--disable-gpu"]
79+
: []
80+
},
81+
viewport: { width: 1920, height: 1080 }
82+
}
83+
}
84+
],
85+
86+
timeout: isCI ? 120000 : 30000
87+
};
88+
export default defineConfig(config);

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@
544544
<skip.apps.upload>true</skip.apps.upload>
545545
<!-- enable this if "upload" profile should pre-optimize apps -->
546546
<triggerPreOptimization>false</triggerPreOptimization>
547+
<client.config.warnOnSlowGraphicsPerformance>false</client.config.warnOnSlowGraphicsPerformance>
547548
</properties>
548549
<profiles>
549550
<profile>

screenshot.JPG

-351 KB
Binary file not shown.

screenshot.png

333 KB
Loading

src/main/js/apps/sample/app.json

Lines changed: 2 additions & 306 deletions
Large diffs are not rendered by default.

src/main/js/apps/sample/nls/bundle.js

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,6 @@ module.exports = {
1717
root: {
1818
apptitle: "Charting Sample",
1919
map: {
20-
koeln1: {
21-
title: "Basic Data",
22-
districts: {
23-
title: "City Districts",
24-
text: "Cologne's city district <b>{STV_NAME}</b>."
25-
},
26-
boroughs: {
27-
title: "Boroughs",
28-
text: "Boroughs <b>{NAME}</b> is located in Cologne's precints {STADTBEZIR}."
29-
},
30-
precints: {
31-
title: "Precints",
32-
text: "Cologne's precint {NAME}."
33-
}
34-
},
35-
koeln2: {
36-
title: "Education and Culture",
37-
description: "List of all libraries, museums and schools in Cologne.",
38-
libraries: {
39-
title: "Libraries"
40-
},
41-
museums: {
42-
title: "Museums",
43-
text: "Museum <b>{NAME}</b> is located in Cologne's boroughs {STADTTEIL}."
44-
},
45-
schools: {
46-
title: "Schools"
47-
}
48-
},
49-
koeln3: {
50-
title: "Recreation",
51-
sights: {
52-
title: "Tourist Attractions",
53-
titleSingle: "Tourist Attraction",
54-
text: "Tourist attraction <b>{NAME}</b> is located in Cologne's borough {STADTTEIL}."
55-
},
56-
playgrounds: {
57-
title: "Playgrounds- and Sports Areas",
58-
text: "<b>{Spielplatzname}</b> is located in Cologne's borough {Stadtteil}.",
59-
baskets: "Basketball Baskets",
60-
goals: "Soccer Goals",
61-
tables: "Ping-Pong Tables",
62-
walls: "Goal Wall",
63-
skate: "Skating",
64-
misc: "Miscellaneous"
65-
},
66-
places: {
67-
title: "Places of Event",
68-
titleSingle: "Place of Event",
69-
text: "<b>{NAME}</b> is a {expression/carrier} place of event."
70-
}
71-
},
7220
basemaps: {
7321
gray: "Street Map (gray)",
7422
streets: "Street Map",

src/main/js/apps/sample/nls/de/bundle.js

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,59 +16,6 @@
1616
module.exports = {
1717
apptitle: "Charting Sample",
1818
map: {
19-
koeln1: {
20-
title: "Basisdaten",
21-
districts: {
22-
title: "Stadtviertel",
23-
text: "Das K\xF6lner Stadtviertel <b>{STV_NAME}</b>."
24-
},
25-
boroughs: {
26-
title: "Stadtteile",
27-
text: "Der Stadtteil <b>{NAME}</b> liegt im K\xF6lner Stadtbezirk {STADTBEZIR}."
28-
},
29-
precints: {
30-
title: "Stadtbezirke",
31-
text: "Der K\xF6lner Stadtbezirk <b>{NAME}</b>."
32-
}
33-
},
34-
koeln2: {
35-
title: "Bildung und Kultur",
36-
description: "Liste aller Bibliotheken, Museen und Schulen in Köln.",
37-
libraries: {
38-
title: "Bibliotheken"
39-
},
40-
museums: {
41-
title: "Museen",
42-
text: "Das Museum <b>{NAME}</b> liegt im K\xF6lner Stadtteil {STADTTEIL}."
43-
},
44-
schools: {
45-
title: "Schulen",
46-
text: ""
47-
}
48-
},
49-
koeln3: {
50-
title: "Freizeit",
51-
sights: {
52-
title: "Sehensw\xFCrdigkeiten",
53-
titleSingle: "Sehensw\xFCrdigkeit",
54-
text: "Die Sehensw\xFCrdigkeit <b>{NAME}</b> liegt im K\xF6lner Stadtteil {STADTTEIL}."
55-
},
56-
playgrounds: {
57-
title: "Spiel- und Sportpl\xE4tze",
58-
text: "<b>{Spielplatzname}</b> liegt im K\xF6lner Stadtteil {Stadtteil}.",
59-
baskets: "Basketballk\xF6rbe",
60-
goals: "Fussballtore",
61-
tables: "Tischtennis Tische",
62-
walls: "Torwand",
63-
skate: "Skaten",
64-
misc: "Sonstiges"
65-
},
66-
places: {
67-
title: "Veranstaltungsorte",
68-
titleSingle: "Veranstaltungsort",
69-
text: "<b>{NAME}</b> ist ein {expression/carrier} Veranstaltungsort."
70-
}
71-
},
7219
basemaps: {
7320
gray: "Stra\xDFenkarte (grau)",
7421
streets: "Stra\xDFenkarte",

src/test/end-to-end/test/api.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (C) con terra GmbH
3+
*/
4+
5+
export interface Rectangle {
6+
top: number;
7+
left: number;
8+
width: number;
9+
height: number;
10+
}
11+
12+
export interface Point {
13+
x: number;
14+
y: number;
15+
}

0 commit comments

Comments
 (0)