Skip to content

Commit c535209

Browse files
authored
Migrate e2e testing from jest to playwright test (#680)
First pass at migrating away from jest. Tests to be migrated one by one, in a draft PR, just like the ants. Add package.json, package-lock.json, jest.config.js, jest-playwright.config.js to commit, which were missed in last commit for some reason Migrate announceMovement.test.js to playwright test Migrate axisInferring.test.js to playwright test Migrate drag.test.js to playwright test, restore e2e/data directory Migrate featureIndexOverlay.test.js to playwright test Migrate featureLinks.test.js to playwright test Migrate fullscreenControl.test.js to playwright test Migrate history.test.js to playwright test Migrate layerAttributes.test.js to playwright test. There was a flaky path that would not respond to hover. Migrate layerContextMenu.test.js to playwright test. Playwright no longer would automatically right click a disabled layer. Added { button: "right", force: true } option, seems to work now. Migrate linkTypes.test.js to playwright test. Migrate mapElement.test.js, mapContextMenu.test.js to playwright test. Migrate mapSpan.test.js to playwright test. Had to add a timeout Migrate metaDefault.test.js to playwright test. Had to add a timeout Migrate mismatchedLayerWithMap.test.js to playwright test. Unsure how to goto a blank page that is editable, so I had to create empty.html and go to that. Had to add a { button: "right", force: true } to get the right button click to work again. Migrate missingMetaParameters.test.js to playwright test. Work in progress on popupNavigation.test.js Migrate popupTabNavigation.test.js to playwright test Migrate projectionChange.test.js to playwright test Remove path from devDependencies (what was it for?) Migrate reticle.test.js to playwright test Migrate styleParsing.test.js to playwright test Migrate scroll.test.js to playwright test Migrate tabFeatureNavigation.test.js to playwright test Migrate tms.test.js to playwright test Migrate zoomChangeProjection.test.js to playwright test Migrate clientTemplatedTileLayer.test.js to playwright test Migrate mapMLLayerControl.test.js to playwright test Migrate multipleExtents.test.js to playwright test Migrate multipleQueryExtents.test.js to playwright test Migrate queryLink.test.js to playwright test Split multipleQueryExtents.test.js into multipleHeterogenousQueryExtents to improve parallelism Try to improve speed of drag.test.js without breaking it Migrate customTCRS.test.js to playwright test Migrate mapml-viewer.test.js to playwright test Migrate viewerContextMenu.test.js to playwright test Restore jest for unit tests, add jest execution to gh action Tweak multipleHeterogeneousQueryExtents.test.js, which is still a bit fragile Restore more of jest for unit tests, fix the ci-testing invocation of it. Migrate layers/mapMLFeatures.test.js, layers/mapMLStaticTileLayer.test.js, layers/mapMLTemplatedFeatures.test.js, layers/mapMLTemplatedFeaturesFilter.test.js, layers/mapMLTemplatedImageLayer.test.js, layers/mapMLTemplatedTileLayer.test.js to playwright test, along shared tests layers/general/*.js, which are imported into each of the above tests and executed as parameterized tests. Migrate step/*.test.js to playwright test Add package-lock.json in the vain hope it will quit changing
1 parent 0b800ba commit c535209

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6488
-5473
lines changed

.github/workflows/ci-testing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ jobs:
1818
- run: npm install -g grunt-cli
1919
- run: grunt default
2020
- run: xvfb-run --auto-servernum -- npm test
21+
- run: xvfb-run --auto-servernum -- npm run jest
2122
env:
2223
CI: true

jest.config.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ module.exports = {
55
displayName: "UNIT Testing",
66
testMatch: ["**/test/**/*.spec.js"],
77
setupFiles: ["./test/setup.js"]
8-
},
9-
{
10-
displayName: "E2E Testing",
11-
preset: "jest-playwright-preset",
12-
globals: {
13-
PATH: "http://localhost:30001/",
14-
},
15-
testMatch: ["**/test/e2e/**/*.test.js"]
16-
}
8+
}
179
]
1810
};

marker.mapml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
<map-meta charset="utf-8"></map-meta>
44
<map-meta http-equiv="Content-Type" content="text/mapml"></map-meta>
55
<map-title>A point in Map Markup Language</map-title>
6-
<map-meta name="projection" content="WGS84"></map-meta>
7-
<map-meta name="zoom" content="15"></map-meta>
6+
<map-meta name="projection" content="CBMTILE"></map-meta>
7+
<map-meta name="zoom" content="min=0,max=20,value=17"></map-meta>
8+
<map-meta name="extent" content="top-left-longitude=-75.708482,top-left-latitude=45.399184,bottom-right-longitude=-75.70522069931032,bottom-right-latitude=45.393552994546624"></map-meta>
89
<map-link rel="license" href="foo" title="Foo © Natural Resources Canada"></map-link>
910
</map-head>
1011
<map-body>
1112
<map-feature id="aPoint">
12-
<map-geometry>
13+
<map-featurecaption>A Thing</map-featurecaption>
14+
<map-properties></map-properties>
15+
<map-geometry cs="gcrs">
1316
<map-point>
1417
<map-coordinates>-75.706646 45.3972513</map-coordinates>
1518
</map-point>
16-
</geometry>
19+
</map-geometry>
1720
</map-feature>
1821
</map-body>
1922
</mapml->

0 commit comments

Comments
 (0)