Skip to content

Commit

Permalink
wip: Refactor the layout using new KDK capabilities #154
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Apr 26, 2021
1 parent 148c4c2 commit dac6741
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ dist
# Generated config
config/client-config.json

# Screenshots generated by TestCafe
test/screenshots/run
# TestCafe page models
# TestCafe
test/reports
test/page-models/core
test/page-models/map

Expand Down
9 changes: 9 additions & 0 deletions .testcaferc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"browsers": ["chrome", "firefox"],
"screenshots": {
"path": "test/reports/screenshots",
"takeOnFails": true,
"pathPattern": "${BROWSER}/${FIXTURE}/${TEST_INDEX}/${FILE_INDEX}.png"
},
"debugMode": false
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"icons:cp": "shx cp -R node_modules/@kalisio/kdk/extras/icons src/assets",
"tours:cp": "shx cp -R node_modules/@kalisio/kdk/extras/tours/* src/tours",
"cafe:cp": "shx cp -R node_modules/@kalisio/kdk/extras/testcafe/page-models/* test/page-models",
"cafe:firefox": "npm run cafe:cp && testcafe firefox test/*.test.js -s path=test/screenshots,takeOnFails=true",
"cafe:chrome": "npm run cafe:cp && testcafe chrome test/*.test.js -s path=test/screenshots,takeOnFails=true",
"cafe:firefox": "npm run cafe:cp && testcafe firefox test/*.test.js",
"cafe:chrome": "npm run cafe:cp && testcafe chrome test/*.test.js",
"rec": "node ./tutorials/record.js",
"test:server": "cd api && npm run test",
"test:client": "cross-env NODE_ENV=production testcafe chrome:headless test/*.test.js --app \"npm run prod\" --app-init-delay 10000 -S -s screenshots",
Expand Down
13 changes: 7 additions & 6 deletions test/catalog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ fixture`catalog`// declare the fixture
})

test('Check base layers', async test => {
const category = 'KCatalogPanel.BASE_LAYERS'
const category = 'BASE_LAYERS'
const layers = [
'Layers.OSM_DARK',
'Layers.OSMT_BRIGHT',
'Layers.OSMT_DARK',
'Layers.OSM_BRIGHT'
]
// Close the top pane
await layout.clickTopOpener(test)
// Open the category
await layout.clickRightOpener(test)
await catalog.clickCategory(test, category, true)
Expand All @@ -51,9 +52,9 @@ test('Check base layers', async test => {
await layout.clickRightOpener(test)
await catalog.clickLayer(test, layer, true)
await layout.clickRightOpener(test)
// const runKey = `${category}-${layer}`
// await pages.assertScreenshotMatches(test, runKey)
// await pages.takeScreenshot(t, runKey)
const runKey = `${category}-${layer}`
await pages.assertScreenshotMatches(test, runKey)
await pages.takeScreenshot(test, runKey)
}
// Close the category
await layout.clickRightOpener(test)
Expand All @@ -62,7 +63,7 @@ test('Check base layers', async test => {
})

test('Check measure layers', async test => {
const category = 'KCatalogPanel.MEASURE_LAYERS'
const category = 'MEASURE_LAYERS'
const layers = [
'Layers.VIGICRUES',
'Layers.HUBEAU',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed test/screenshots/ref/BaseLayers-Layers.OSM_DARK.png
Binary file not shown.
Binary file removed test/screenshots/ref/BaseLayers-Layers.S2.png
Binary file not shown.

0 comments on commit dac6741

Please sign in to comment.