1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Click tab instead of workspace

This commit is contained in:
Kazuhito Yokoi 2020-01-15 10:42:59 +09:00
parent 0f8af4ba1c
commit 44a07c74fd

View File

@ -15,18 +15,15 @@
**/ **/
var when = require("when"); var when = require("when");
var events = require("nr-test-utils").require("@node-red/runtime/lib/events.js"); var events = require("nr-test-utils").require("@node-red/runtime/lib/events.js");
var palette = require("./palette_page"); var palette = require("./palette_page");
var nodeFactory = require("../nodes/nodefactory_page"); var nodeFactory = require("../nodes/nodefactory_page");
var keyPage = require("../util/key_page");
var flowLayout = { var flowLayout = {
flowRightEnd : 600, flowRightEnd : 600,
widthInterval : 300, widthInterval : 300,
heightInterval : 80 heightInterval : 80
}; };
var previousX = -flowLayout.widthInterval; var previousX = -flowLayout.widthInterval;
var previousY = 0; var previousY = 0;
@ -60,13 +57,10 @@ function addNode(type, x, y) {
} }
function deleteAllNodes() { function deleteAllNodes() {
browser.waitForVisible('.red-ui-workspace-chart-event-layer'); browser.waitForVisible('//*[contains(@class, "active")]/a[@class="red-ui-tab-label"]');
try { browser.click('//*[contains(@class, "active")]/a[@class="red-ui-tab-label"]');
browser.click('.red-ui-workspace-chart-event-layer'); browser.pause(1000);
} catch (e) { browser.keys(keyPage.selectAll());
console.log(e);
}
browser.keys(['Control', 'a', 'a', 'Control']); // call twice to release the keys.
browser.keys(['Delete']); browser.keys(['Delete']);
} }
@ -81,7 +75,7 @@ function deploy() {
browser.clickWithWait('#red-ui-header-button-deploy'); browser.clickWithWait('#red-ui-header-button-deploy');
}); });
}); });
browser.waitForText('#red-ui-header-button-deploy', 2000); browser.waitForText('#red-ui-header-button-deploy', 10000);
// Need additional wait until buttons becomes clickable. // Need additional wait until buttons becomes clickable.
browser.pause(50); browser.pause(50);
} }