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

Update UI tests for new editor css

This commit is contained in:
Nick O'Leary 2019-06-11 17:11:52 +01:00
parent ea0526f29a
commit 8cf5ec9e5a
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 17 additions and 18 deletions

View File

@ -77,7 +77,6 @@ module.exports = {
browser.call(function () { browser.call(function () {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
cleanup(flowFilename); cleanup(flowFilename);
app.use("/",express.static("public"));
server = http.createServer(app); server = http.createServer(app);
var settings = { var settings = {
httpAdminRoot: "/", httpAdminRoot: "/",
@ -102,7 +101,7 @@ module.exports = {
}); });
}); });
browser.url(url); browser.url(url);
browser.waitForExist('#red-ui-palette-node_inject'); browser.waitForExist(".red-ui-palette-node[data-palette-type='inject']")
} catch (err) { } catch (err) {
console.log(err); console.log(err);
throw err; throw err;

View File

@ -16,23 +16,23 @@
var idMap = { var idMap = {
// input // input
"inject": "#red-ui-palette-node_inject", "inject": ".red-ui-palette-node[data-palette-type='inject']",
"httpin": "#red-ui-palette-node_http_in", "httpin": ".red-ui-palette-node[data-palette-type='http in']",
"mqttIn": "#red-ui-palette-node_mqtt_in", "mqttIn": ".red-ui-palette-node[data-palette-type='mqtt in']",
// output // output
"debug": "#red-ui-palette-node_debug", "debug": ".red-ui-palette-node[data-palette-type='debug']",
"httpResponse": "#red-ui-palette-node_http_response", "httpResponse": ".red-ui-palette-node[data-palette-type='http response']",
"mqttOut": "#red-ui-palette-node_mqtt_out", "mqttOut": ".red-ui-palette-node[data-palette-type='mqtt out']",
// function // function
"function": "#red-ui-palette-node_function", "function": ".red-ui-palette-node[data-palette-type='function']",
"template": "#red-ui-palette-node_template", "template": ".red-ui-palette-node[data-palette-type='template']",
"change": "#red-ui-palette-node_change", "change": ".red-ui-palette-node[data-palette-type='change']",
"range": "#red-ui-palette-node_range", "range": ".red-ui-palette-node[data-palette-type='range']",
"httpRequest": "#red-ui-palette-node_http_request", "httpRequest": ".red-ui-palette-node[data-palette-type='http request']",
"html": "#red-ui-palette-node_html", "html": ".red-ui-palette-node[data-palette-type='html']",
"json": "#red-ui-palette-node_json", "json": ".red-ui-palette-node[data-palette-type='json']",
// storage // storage
"filein": "#red-ui-palette-node_file_in", "filein": ".red-ui-palette-node[data-palette-type='file in']",
}; };
function getId(type) { function getId(type) {

View File

@ -49,14 +49,14 @@ function addNode(type, x, y) {
browser.moveToObject("#red-ui-palette-search", previousX + 300, previousY + 100); // adjust to the top-left corner of workspace. browser.moveToObject("#red-ui-palette-search", previousX + 300, previousY + 100); // adjust to the top-left corner of workspace.
browser.buttonUp(); browser.buttonUp();
// Last node is the one that has been created right now. // Last node is the one that has been created right now.
var nodeElement = browser.elements('//*[@class="red-ui-flow-node red-ui-flow-node-group"][last()]'); var nodeElement = browser.elements('//*[contains(concat(" ", normalize-space(@class), " "), " red-ui-flow-node-group ")][last()]');
var nodeId = nodeElement.getAttribute('id'); var nodeId = nodeElement.getAttribute('id');
var node = nodeFactory.create(type, nodeId); var node = nodeFactory.create(type, nodeId);
return node; return node;
} }
function deleteAllNodes() { function deleteAllNodes() {
browser.click('.innerCanvas'); browser.click('.red-ui-workspace-chart-event-layer');
browser.keys(['Control', 'a', 'a', 'Control']); // call twice to release the keys. browser.keys(['Control', 'a', 'a', 'Control']); // call twice to release the keys.
browser.keys(['Delete']); browser.keys(['Delete']);
} }