Last active
June 27, 2018 07:36
-
-
Save claustres/d59c8b9c02220fdfe3f81ae5a0b0f0d0 to your computer and use it in GitHub Desktop.
Print client user simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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