Skip to content

Instantly share code, notes, and snippets.

@claustres
Last active June 27, 2018 07:36
Show Gist options
  • Save claustres/d59c8b9c02220fdfe3f81ae5a0b0f0d0 to your computer and use it in GitHub Desktop.
Save claustres/d59c8b9c02220fdfe3f81ae5a0b0f0d0 to your computer and use it in GitHub Desktop.
Print client user simulation
import path from 'path'
import { PrintApp } from './page-model'
export const appUrl = process.env.APP_URL || 'http://kargo-www.s3-website.eu-central-1.amazonaws.com/'
let app = new PrintApp()
fixture`Print`// declare the fixture
.page`${appUrl}`
.afterEach(async test => {
// check for console error messages
await app.checkNoError(test)
})
test('Print', async test => {
await app.selectBaseLayer(test, process.env.BASE_LAYER || 'PlanetSat')
if (process.env.OVERLAY_LAYER) {
await app.selectOverlayLayer(test, process.env.OVERLAY_LAYER)
}
if (process.env.GEOJSON_FILE) {
await app.addGeoJson(test, path.join('/tmp', process.env.GEOJSON_FILE))
}
// Print size rely on Xvfb screen, controlled by SCREEN_WIDTH & SCREEN_HEIGHT, as we jump in fullscreen just before printing
await app.setFullscreen(test)
await app.print(test, process.env.PRINT_FORMAT || 'Current Size')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment