maputnik/test/functional/screenshots/index.js

112 lines
3.4 KiB
JavaScript
Raw Normal View History

2018-01-10 14:19:34 +01:00
var config = require("../../config/specs");
var helper = require("../helper");
var wd = require("../../wd-helper");
2018-04-10 16:07:36 +02:00
// These will get used in the marketing material. They are also useful to do a quick manual check of the styling across browsers
// NOTE: These duplicate some of the tests, however this is indended becuase it's likely these will change for aesthetic reasons over time
2018-01-10 14:19:34 +01:00
describe('screenshots', function() {
beforeEach(async function() {
await browser.setWindowSize(1280, 800)
2018-01-10 14:19:34 +01:00
})
it("front_page", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link");
await elem.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/front_page.png")
2018-01-10 14:19:34 +01:00
})
it("open", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link");
await elem.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
const nav_open = await $(wd.$("nav:open"));
await nav_open.click();
await nav_open.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/open.png")
2018-01-10 14:19:34 +01:00
})
it("export", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link")
await elem.waitForExist()
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
const nav_export = await $(wd.$("nav:export"));
await nav_export.click();
await nav_export.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/export.png")
2018-01-10 14:19:34 +01:00
})
it("sources", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link")
await elem.waitForExist()
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
const nav_sources = await $(wd.$("nav:sources"));
await nav_sources.click();
await nav_sources.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/sources.png")
2018-01-10 14:19:34 +01:00
})
it("style settings", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link")
await elem.waitForExist()
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
const nav_settings = await $(wd.$("nav:settings"));
await nav_settings.click();
await nav_settings.waitForExist();
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/settings.png")
2018-01-10 14:19:34 +01:00
})
it("inspect", async function() {
await browser.url(config.baseUrl+"?debug&style="+helper.getStyleUrl([
2018-01-10 14:19:34 +01:00
"geojson:example"
]));
await browser.acceptAlert();
const elem = await $(".maputnik-toolbar-link")
await elem.waitForExist()
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
const selectBox = await $(wd.$("nav:inspect", "select"));
await selectBox.selectByAttribute('value', 'inspect');
2019-06-08 07:19:18 +02:00
await browser.flushReactUpdates();
2018-01-10 14:19:34 +01:00
await browser.takeScreenShot("/inspect.png")
2018-01-10 14:19:34 +01:00
})
})