mirror of
https://github.com/maputnik/editor.git
synced 2026-04-22 17:30:02 +00:00
* Initial commit * Fix spec * Move driver * Fix config location * Fix helper location * More usage of driver * Add click * Fix click * Migrate more tests * Add setValue to driver * Move more code to driver * add isExisting to driver * Change modal tests to use driver * Fix tests * Fix test * Fix invalid alert wait * Fix missing wd * Fix tests * Fix missing fs * Fix test * Fix path * Move screenshort to driver * Migrate keyboard * Migrate skiplinks to driver * Fix tests * Try fix skip-links * add config * Add helper * Fix driver? * remove helper * remove wd-helper * Remove redundant file * Remove webdriver extsions
104 lines
2.3 KiB
JavaScript
104 lines
2.3 KiB
JavaScript
var assert = require("assert");
|
|
var driver = require("../driver");
|
|
|
|
describe("history", function() {
|
|
let undoKeyCombo;
|
|
let undoKeyComboReset;
|
|
let redoKeyCombo;
|
|
let redoKeyComboReset;
|
|
|
|
before(async function() {
|
|
const isMac = await driver.isMac();
|
|
undoKeyCombo = ['Meta', 'z'];
|
|
undoKeyComboReset = ['Meta'];
|
|
redoKeyCombo = isMac ? ['Meta', 'Shift', 'z'] : ['Meta', 'y'];
|
|
redoKeyComboReset = isMac ? ['Meta', 'Shift'] : ['Meta'];
|
|
});
|
|
|
|
/**
|
|
* See <https://github.com/webdriverio/webdriverio/issues/1126>
|
|
*/
|
|
it.skip("undo/redo", async function() {
|
|
var styleObj;
|
|
|
|
await driver.setStyle(["geojson:example"])
|
|
await driver.openLayersModal();
|
|
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, []);
|
|
|
|
await driver.fillLayersModal({
|
|
id: "step 1",
|
|
type: "background"
|
|
})
|
|
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
{
|
|
"id": "step 1",
|
|
"type": 'background'
|
|
}
|
|
]);
|
|
|
|
await driver.openLayersModal();
|
|
await driver.fillLayersModal({
|
|
id: "step 2",
|
|
type: "background"
|
|
})
|
|
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
{
|
|
"id": "step 1",
|
|
"type": 'background'
|
|
},
|
|
{
|
|
"id": "step 2",
|
|
"type": 'background'
|
|
}
|
|
]);
|
|
|
|
await driver.typeKeys(undoKeyCombo);
|
|
await driver.typeKeys(undoKeyComboReset);
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
{
|
|
"id": "step 1",
|
|
"type": 'background'
|
|
}
|
|
]);
|
|
|
|
await driver.typeKeys(undoKeyCombo)
|
|
await driver.typeKeys(undoKeyComboReset);
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
]);
|
|
|
|
await driver.typeKeys(redoKeyCombo)
|
|
await driver.typeKeys(redoKeyComboReset);
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
{
|
|
"id": "step 1",
|
|
"type": 'background'
|
|
}
|
|
]);
|
|
|
|
await driver.typeKeys(redoKeyCombo)
|
|
await driver.typeKeys(redoKeyComboReset);
|
|
styleObj = await driver.getStyleStore();
|
|
assert.deepEqual(styleObj.layers, [
|
|
{
|
|
"id": "step 1",
|
|
"type": 'background'
|
|
},
|
|
{
|
|
"id": "step 2",
|
|
"type": 'background'
|
|
}
|
|
]);
|
|
|
|
});
|
|
|
|
})
|