2020-05-31 16:33:09 +02:00
|
|
|
var assert = require("assert");
|
|
|
|
var config = require("../../config/specs");
|
|
|
|
var helper = require("../helper");
|
|
|
|
var wd = require("../../wd-helper");
|
|
|
|
|
|
|
|
|
|
|
|
describe("skip links", function() {
|
2022-04-06 14:05:15 +02:00
|
|
|
beforeEach(async function () {
|
|
|
|
await browser.url(config.baseUrl+"?debug&style="+helper.getGeoServerUrl("example-layer-style.json"));
|
|
|
|
await browser.acceptAlert();
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("skip link to layer list", async function() {
|
2020-05-31 16:33:09 +02:00
|
|
|
const selector = wd.$("root:skip:layer-list")
|
2022-04-06 14:05:15 +02:00
|
|
|
const elem = await $(selector);
|
|
|
|
assert(await elem.isExisting());
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
assert(await elem.isFocused());
|
|
|
|
await elem.click();
|
|
|
|
|
|
|
|
const targetEl = await $("#skip-target-layer-list");
|
|
|
|
assert(await targetEl.isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("skip link to layer editor", async function() {
|
2020-05-31 16:33:09 +02:00
|
|
|
const selector = wd.$("root:skip:layer-editor")
|
2022-04-06 14:05:15 +02:00
|
|
|
const elem = await $(selector);
|
|
|
|
assert(await elem.isExisting());
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
assert(await elem.isFocused());
|
|
|
|
await elem.click();
|
|
|
|
|
|
|
|
const targetEl = await $("#skip-target-layer-editor");
|
|
|
|
assert(await targetEl.isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("skip link to map view", async function() {
|
2020-05-31 16:33:09 +02:00
|
|
|
const selector = wd.$("root:skip:map-view")
|
2022-04-06 14:05:15 +02:00
|
|
|
const elem = await $(selector);
|
|
|
|
assert(await elem.isExisting());
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
await browser.keys(['Tab']);
|
|
|
|
assert(await elem.isFocused());
|
|
|
|
await elem.click();
|
|
|
|
|
2023-08-29 04:17:49 +02:00
|
|
|
const targetEl = await $(".maplibregl-canvas");
|
2022-04-06 14:05:15 +02:00
|
|
|
assert(await targetEl.isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
});
|