2020-05-31 16:33:09 +02:00
|
|
|
var assert = require("assert");
|
|
|
|
var wd = require("../../wd-helper");
|
|
|
|
|
|
|
|
|
|
|
|
describe("keyboard", function() {
|
|
|
|
describe("shortcuts", function() {
|
2022-04-06 14:05:15 +02:00
|
|
|
it("ESC should unfocus", async function() {
|
|
|
|
const tmpTargetEl = await $(wd.$("nav:inspect") + " select");
|
|
|
|
await tmpTargetEl.click();
|
|
|
|
assert(await tmpTargetEl.isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
await browser.keys(["Escape"]);
|
|
|
|
assert(await (await $("body")).isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'?' should show shortcuts modal", async function() {
|
|
|
|
await browser.keys(["?"]);
|
|
|
|
assert(await (await $(wd.$("modal:shortcuts"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'o' should show open modal", async function() {
|
|
|
|
await browser.keys(["o"]);
|
|
|
|
assert(await (await $(wd.$("modal:open"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'e' should show export modal", async function() {
|
|
|
|
await browser.keys(["e"]);
|
|
|
|
assert(await (await $(wd.$("modal:export"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'d' should show sources modal", async function() {
|
|
|
|
await browser.keys(["d"]);
|
|
|
|
assert(await (await $(wd.$("modal:sources"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'s' should show settings modal", async function() {
|
|
|
|
await browser.keys(["s"]);
|
|
|
|
assert(await (await $(wd.$("modal:settings"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it.skip("'i' should change map to inspect mode", async function() {
|
|
|
|
// await browser.keys(["i"]);
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'m' should focus map", async function() {
|
|
|
|
await browser.keys(["m"]);
|
2023-08-29 04:17:49 +02:00
|
|
|
assert(await (await $(".maplibregl-canvas")).isFocused());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
|
2022-04-06 14:05:15 +02:00
|
|
|
it("'!' should show debug modal", async function() {
|
|
|
|
await browser.keys(["!"]);
|
|
|
|
assert(await (await $(wd.$("modal:debug"))).isDisplayed());
|
2020-05-31 16:33:09 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|