Fix test cases for UI

This commit is contained in:
Kazuhito Yokoi
2019-12-02 12:43:13 +09:00
parent c1dae95f71
commit a364d4950d
15 changed files with 149 additions and 139 deletions

View File

@@ -17,7 +17,7 @@
var idMap = {
// input
"inject": ".red-ui-palette-node[data-palette-type='inject']",
"httpin": ".red-ui-palette-node[data-palette-type='http in']",
"httpIn": ".red-ui-palette-node[data-palette-type='http in']",
"mqttIn": ".red-ui-palette-node[data-palette-type='mqtt in']",
// output
"debug": ".red-ui-palette-node[data-palette-type='debug']",
@@ -32,7 +32,7 @@ var idMap = {
"html": ".red-ui-palette-node[data-palette-type='html']",
"json": ".red-ui-palette-node[data-palette-type='json']",
// storage
"filein": ".red-ui-palette-node[data-palette-type='file in']",
"fileIn": ".red-ui-palette-node[data-palette-type='file in']",
};
function getId(type) {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
**/
var when = require("when");
var when = require("when");
var events = require("nr-test-utils").require("@node-red/runtime/lib/events.js");
@@ -44,6 +44,7 @@ function addNode(type, x, y) {
previousY = previousY + flowLayout.heightInterval;
}
}
browser.waitForVisible(palette.getId(type));
browser.moveToObject(palette.getId(type));
browser.buttonDown();
browser.moveToObject("#red-ui-palette-search", previousX + 300, previousY + 100); // adjust to the top-left corner of workspace.
@@ -56,7 +57,12 @@ function addNode(type, x, y) {
}
function deleteAllNodes() {
browser.click('.red-ui-workspace-chart-event-layer');
browser.waitForVisible('.red-ui-workspace-chart-event-layer');
try {
browser.click('.red-ui-workspace-chart-event-layer');
} catch (e) {
console.log(e);
}
browser.keys(['Control', 'a', 'a', 'Control']); // call twice to release the keys.
browser.keys(['Delete']);
}