Files
editor/test/functional/accessibility/index.js
Harel M 18f45e932b Use driver pattern for e2e tests (#829)
I've moved all the logic relevant to WBIO into a single file in order to
be able to replace it.
I have tried to upgrade WDIO in order to use the latest version and it
got stuck on my computer.
Furthermore, I was not able to run it locally which made this whole
cycle very long.
After this will be merged I will replace WDIO with cypress.
This doesn't change anything, only moves some code in the tests to a
single file, removes unneeded files and uses the driver pattern, which
will later allow switching the underline WDIO with Cypress.

cc: @nyurik
2023-12-17 01:14:23 -05:00

44 lines
1.5 KiB
JavaScript

var assert = require("assert");
var driver = require("../driver");
describe("accessibility", function () {
describe("skip links", function() {
beforeEach(async function () {
await driver.setStyle("example-layer-style.json");
});
it("skip link to layer list", async function() {
const selector = driver.getDataAttribute("root:skip:layer-list")
assert(await driver.isExisting(selector));
await driver.typeKeys(['Tab']);
assert(await driver.isFocused(selector));
await driver.click(selector);
assert(await driver.isFocused("#skip-target-layer-list"));
});
it("skip link to layer editor", async function() {
const selector = driver.getDataAttribute("root:skip:layer-editor")
assert(await driver.isExisting(selector));
await driver.typeKeys(['Tab']);
await driver.typeKeys(['Tab']);
assert(await driver.isFocused(selector));
await driver.click(selector);
assert(await driver.isFocused("#skip-target-layer-editor"));
});
it("skip link to map view", async function() {
const selector = driver.getDataAttribute("root:skip:map-view")
assert(await driver.isExisting(selector));
await driver.typeKeys(['Tab']);
await driver.typeKeys(['Tab']);
await driver.typeKeys(['Tab']);
assert(await driver.isFocused(selector));
await driver.click(selector);
assert(await driver.isFocused(".maplibregl-canvas"));
});
});
})