node-red
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function injectNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(injectNode, nodePage);
|
||||
|
||||
var payloadTypeList = {
|
||||
"msg": 1,
|
||||
"flow": 2,
|
||||
"global": 3,
|
||||
"str": 4,
|
||||
"num": 5,
|
||||
"bool": 6,
|
||||
"json": 7,
|
||||
"bin": 8,
|
||||
"date": 9,
|
||||
"jsonata": 10,
|
||||
"env": 11,
|
||||
};
|
||||
|
||||
var repeatTypeList = {
|
||||
"none": 1,
|
||||
"interval": 2,
|
||||
"intervalBetweenTimes": 3,
|
||||
"atASpecificTime": 4,
|
||||
};
|
||||
|
||||
injectNode.prototype.setPayload = function(payloadType, payload) {
|
||||
// Open a payload type list.
|
||||
browser.clickWithWait('//*[@id="node-input-property-container"]/li[1]/div/div/div[3]');
|
||||
// Select a payload type.
|
||||
var payloadTypeXPath = '//*[contains(@class, "red-ui-typedInput-options")]/a[' + payloadTypeList[payloadType] + ']';
|
||||
browser.clickWithWait(payloadTypeXPath);
|
||||
if (payload) {
|
||||
// Input a value.
|
||||
browser.setValue('//*[@id="node-input-property-container"]/li[1]/div/div/div[3]/div[1]/input', payload);
|
||||
}
|
||||
}
|
||||
|
||||
injectNode.prototype.setTopic = function(topic) {
|
||||
browser.setValue('//*[@id="node-input-property-container"]/li[2]/div/div/div[3]/div[1]/input', topic);
|
||||
}
|
||||
|
||||
injectNode.prototype.setOnce = function(once) {
|
||||
var isChecked = browser.isSelected('#node-input-once');
|
||||
if (isChecked !== once) {
|
||||
browser.clickWithWait('#node-input-once');
|
||||
}
|
||||
}
|
||||
|
||||
injectNode.prototype.setRepeat = function(repeatType) {
|
||||
var repeatTypeXPath = '//*[@id="inject-time-type-select"]/option[' + repeatTypeList[repeatType] + ']';
|
||||
browser.clickWithWait(repeatTypeXPath);
|
||||
}
|
||||
|
||||
injectNode.prototype.setRepeatInterval = function(repeat) {
|
||||
browser.setValue('#inject-time-interval-count', repeat);
|
||||
}
|
||||
|
||||
module.exports = injectNode;
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function debugNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(debugNode, nodePage);
|
||||
|
||||
debugNode.prototype.setOutput = function (complete) {
|
||||
// Open a payload type list.
|
||||
browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-container")]/button');
|
||||
if (complete !== 'true') {
|
||||
// Select the "msg" type.
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options")][2]/a[1]');
|
||||
// Input the path in msg.
|
||||
browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-input")]/input');
|
||||
browser.keys(Array('payload'.length).fill('Backspace'));
|
||||
browser.setValue('//*[@id="dialog-form"]/div[1]/div/div[1]/input', complete);
|
||||
} else {
|
||||
// Select the "complete msg object" type.
|
||||
browser.clickWithWait('/html/body/div[11]/a[2]');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = debugNode;
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function completeNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(completeNode, nodePage);
|
||||
|
||||
completeNode.prototype.setScope = function (scope) {
|
||||
if (scope) {
|
||||
browser.clickWithWait('//*[@id="node-input-complete-target-select"]');
|
||||
browser.pause(1000);
|
||||
if (Array.isArray(scope)) {
|
||||
for (var i = 0; i < scope.length; i++) {
|
||||
browser.moveToObject(scope[i].id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
} else {
|
||||
browser.moveToObject(scope.id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]');
|
||||
browser.pause(1000);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = completeNode;
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function catchNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(catchNode, nodePage);
|
||||
|
||||
catchNode.prototype.setScope = function (scope) {
|
||||
if (scope) {
|
||||
browser.selectWithWait('#node-input-scope-select', 'target');
|
||||
browser.clickWithWait('//*[@id="node-input-catch-target-select"]');
|
||||
browser.pause(1000);
|
||||
if (Array.isArray(scope)) {
|
||||
for (var i = 0; i < scope.length; i++) {
|
||||
browser.moveToObject(scope[i].id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
} else {
|
||||
browser.moveToObject(scope.id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]');
|
||||
browser.pause(1000);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = catchNode;
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function statusNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(statusNode, nodePage);
|
||||
|
||||
statusNode.prototype.setScope = function (scope) {
|
||||
if (scope) {
|
||||
browser.selectWithWait('#node-input-scope-select', 'target');
|
||||
browser.clickWithWait('//*[@id="node-input-status-target-select"]');
|
||||
browser.pause(1000);
|
||||
if (Array.isArray(scope)) {
|
||||
for (var i = 0; i < scope.length; i++) {
|
||||
browser.moveToObject(scope[i].id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
} else {
|
||||
browser.moveToObject(scope.id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]');
|
||||
browser.pause(1000);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = statusNode;
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function commentNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(commentNode, nodePage);
|
||||
|
||||
module.exports = commentNode;
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
var keyPage = require("../../../util/key_page");
|
||||
|
||||
function functionNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(functionNode, nodePage);
|
||||
|
||||
functionNode.prototype.setFunction = function (func) {
|
||||
browser.clickWithWait('#node-input-func-editor');
|
||||
browser.keys(keyPage.selectAll());
|
||||
browser.keys(['Delete']);
|
||||
browser.keys(func);
|
||||
// Delete the unnecessary code that ace editor does the autocompletion.
|
||||
browser.keys(keyPage.selectToEnd());
|
||||
browser.keys(['Delete']);
|
||||
// Need to wait until ace editor correctly checks the syntax.
|
||||
browser.pause(300);
|
||||
}
|
||||
|
||||
module.exports = functionNode;
|
||||
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function switchNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(switchNode, nodePage);
|
||||
|
||||
var vtType = {
|
||||
"msg": 1,
|
||||
"flow": 2,
|
||||
"global": 3,
|
||||
"str": 4,
|
||||
"num": 5,
|
||||
"jsonata": 6,
|
||||
"env": 7,
|
||||
"prev": 8
|
||||
};
|
||||
|
||||
function setT(t, index) {
|
||||
browser.selectWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/select', t);
|
||||
}
|
||||
|
||||
function setV(v, vt, index) {
|
||||
if (vt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + vtType[vt] + ']');
|
||||
}
|
||||
if (v) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', v);
|
||||
}
|
||||
}
|
||||
|
||||
function setBetweenV(v, vt, v2, v2t, index) {
|
||||
if (vt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + vtType[vt] + ']');
|
||||
}
|
||||
if (v) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/div[1]/input', v);
|
||||
}
|
||||
if (v2t) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + vtType[v2t] + ']');
|
||||
}
|
||||
if (v2) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div/div[1]/input', v2);
|
||||
}
|
||||
}
|
||||
|
||||
function setSequenceV(v, vt, index) {
|
||||
var sType = {
|
||||
"flow": 1,
|
||||
"global": 2,
|
||||
"num": 3,
|
||||
"jsonata": 4,
|
||||
"env": 5,
|
||||
};
|
||||
|
||||
if (vt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + sType[vt] + ']');
|
||||
}
|
||||
if (v) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/div[1]/input', v);
|
||||
}
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleEqual = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('eq', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleNotEqual = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('neq', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleLessThan = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('lt', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleLessThanOrEqual = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('lte', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleGreaterThan = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('gt', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleGreaterThanOrEqual = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('gte', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleHasKey = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('hask', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsBetween = function (v, vt, v2, v2t, index) {
|
||||
index = index || 1;
|
||||
setT('btwn', index);
|
||||
setBetweenV(v, vt, v2, v2t, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleContains = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('cont', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleMatchesRegex = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('regex', index);
|
||||
setV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsTrue = function (index) {
|
||||
index = index || 1;
|
||||
setT('true', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsFalse = function (index) {
|
||||
index = index || 1;
|
||||
setT('false', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsNull = function (index) {
|
||||
index = index || 1;
|
||||
setT('null', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsNotNull = function (index) {
|
||||
index = index || 1;
|
||||
setT('nnull', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsOfType = function (t, index) {
|
||||
index = index || 1;
|
||||
setT('istype', index);
|
||||
|
||||
var tType = {
|
||||
"str": 1,
|
||||
"num": 2,
|
||||
"boolean": 3,
|
||||
"array": 4,
|
||||
"buffer": 5,
|
||||
"object": 6,
|
||||
"json": 7,
|
||||
"undefined": 8,
|
||||
"null": 9
|
||||
};
|
||||
|
||||
if (t) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + tType[t] + ']');
|
||||
}
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsEmpty = function (index) {
|
||||
index = index || 1;
|
||||
setT('empty', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIsNotEmpty = function (index) {
|
||||
index = index || 1;
|
||||
setT('nempty', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleHead = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('head', index);
|
||||
setSequenceV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleIndexBetween = function (v, vt, v2, v2t, index) {
|
||||
index = index || 1;
|
||||
setT('index', index);
|
||||
setBetweenV(v, vt, v2, v2t, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleTail = function (v, vt, index) {
|
||||
index = index || 1;
|
||||
setT('tail', index);
|
||||
setSequenceV(v, vt, index);
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleJSONataExp = function (v, index) {
|
||||
index = index || 1;
|
||||
setT('jsonata_exp', index);
|
||||
if (v) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div[2]/div[1]/input', v);
|
||||
}
|
||||
}
|
||||
|
||||
switchNode.prototype.ruleOtherwise = function (index) {
|
||||
index = index || 1;
|
||||
setT('else', index);
|
||||
}
|
||||
|
||||
switchNode.prototype.addRule = function () {
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-editableList")]/a');
|
||||
}
|
||||
|
||||
module.exports = switchNode;
|
||||
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function changeNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(changeNode, nodePage);
|
||||
|
||||
var totType = {
|
||||
"msg": 1,
|
||||
"flow": 2,
|
||||
"global": 3,
|
||||
"str": 4,
|
||||
"num": 5,
|
||||
"bool": 6,
|
||||
"json": 7,
|
||||
"bin": 8,
|
||||
"date": 9,
|
||||
"jsonata": 10,
|
||||
"env": 11,
|
||||
};
|
||||
|
||||
var ptType = {
|
||||
"msg": 1,
|
||||
"flow": 2,
|
||||
"global": 3,
|
||||
};
|
||||
|
||||
function setT(t, index) {
|
||||
browser.selectWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/select', t);
|
||||
}
|
||||
|
||||
// It is better to create a function whose input value is the object type in the future,
|
||||
changeNode.prototype.ruleSet = function (p, pt, to, tot, index) {
|
||||
index = index || 1;
|
||||
setT('set', index);
|
||||
if (pt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + ptType[pt] + ']');
|
||||
}
|
||||
if (p) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', p);
|
||||
}
|
||||
if (tot) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[2]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + totType[tot] + ']');
|
||||
}
|
||||
if (to) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[2]/div[2]/div/input', to);
|
||||
}
|
||||
}
|
||||
|
||||
changeNode.prototype.ruleChange = function (p, pt, from, fromt, to, tot, index) {
|
||||
index = index || 1;
|
||||
setT('change', index);
|
||||
if (pt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + ptType[pt] + ']');
|
||||
}
|
||||
if (p) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', p);
|
||||
}
|
||||
if (fromt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div[1]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + totType[pt] + ']');
|
||||
}
|
||||
if (from) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div[1]/div[2]/div[1]/input', from);
|
||||
}
|
||||
if (tot) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div[2]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + totType[pt] + ']');
|
||||
}
|
||||
if (to) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[3]/div[2]/div[2]/div[1]/input', to);
|
||||
}
|
||||
}
|
||||
|
||||
changeNode.prototype.ruleDelete = function (p, pt, index) {
|
||||
index = index || 1;
|
||||
setT('delete', index);
|
||||
if (pt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + ptType[pt] + ']');
|
||||
}
|
||||
if (p) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', p);
|
||||
}
|
||||
}
|
||||
|
||||
changeNode.prototype.ruleMove = function (p, pt, to, tot, index) {
|
||||
index = index || 1;
|
||||
setT('move', index);
|
||||
if (pt) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + ptType[pt] + ']');
|
||||
}
|
||||
if (p) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', p);
|
||||
}
|
||||
if (tot) {
|
||||
browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[4]/div[2]/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + totType[pt] + ']');
|
||||
}
|
||||
if (to) {
|
||||
browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[4]/div[2]/div/input', to);
|
||||
}
|
||||
}
|
||||
|
||||
changeNode.prototype.addRule = function () {
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-editableList")]/a');
|
||||
}
|
||||
|
||||
module.exports = changeNode;
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function rangeNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(rangeNode, nodePage);
|
||||
|
||||
rangeNode.prototype.setAction = function(action) {
|
||||
browser.selectWithWait('#node-input-action', action);
|
||||
}
|
||||
|
||||
rangeNode.prototype.setRange = function(minin, maxin, minout, maxout) {
|
||||
browser.setValue('#node-input-minin', minin);
|
||||
browser.setValue('#node-input-maxin', maxin);
|
||||
browser.setValue('#node-input-minout', minout);
|
||||
browser.setValue('#node-input-maxout', maxout);
|
||||
}
|
||||
|
||||
module.exports = rangeNode;
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
var keyPage = require("../../../util/key_page");
|
||||
|
||||
function templateNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(templateNode, nodePage);
|
||||
|
||||
templateNode.prototype.setSyntax = function (syntax) {
|
||||
browser.selectWithWait('#node-input-syntax', syntax);
|
||||
}
|
||||
|
||||
templateNode.prototype.setFormat = function (format) {
|
||||
browser.selectWithWait('#node-input-format', format);
|
||||
}
|
||||
|
||||
templateNode.prototype.setTemplate = function (template) {
|
||||
browser.clickWithWait('#node-input-template-editor');
|
||||
browser.keys(keyPage.selectAll());
|
||||
browser.keys(['Delete']);
|
||||
browser.keys(template);
|
||||
browser.keys(keyPage.selectToEnd());
|
||||
browser.keys(['Delete']);
|
||||
// Need to wait until ace editor correctly checks the syntax.
|
||||
browser.pause(300);
|
||||
}
|
||||
|
||||
module.exports = templateNode;
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function delayNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(delayNode, nodePage);
|
||||
|
||||
delayNode.prototype.setTimeout = function (timeout) {
|
||||
browser.setValue('//*[@id="node-input-timeout"]', timeout);
|
||||
}
|
||||
|
||||
module.exports = delayNode;
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function triggerNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(triggerNode, nodePage);
|
||||
|
||||
triggerNode.prototype.setSend = function (send, sendt) {
|
||||
var sendType = {
|
||||
"flow": 1,
|
||||
"global": 2,
|
||||
"str": 3,
|
||||
"num": 4,
|
||||
"bool": 5,
|
||||
"json": 6,
|
||||
"bin": 7,
|
||||
"date": 8,
|
||||
"env": 9,
|
||||
"pay": 10,
|
||||
"nul": 11
|
||||
};
|
||||
|
||||
if (sendt) {
|
||||
browser.clickWithWait('//*[@id="dialog-form"]/div[1]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + sendType[sendt] + ']');
|
||||
}
|
||||
if (send) {
|
||||
browser.setValue('//*[@id="dialog-form"]/div[1]/div/div[1]/input', send);
|
||||
}
|
||||
}
|
||||
|
||||
triggerNode.prototype.setDuration = function (duration, units) {
|
||||
browser.setValue('//*[@id="node-input-duration"]', duration);
|
||||
if (units) {
|
||||
browser.selectWithWait('//*[@id="node-input-units"]', units);
|
||||
}
|
||||
}
|
||||
|
||||
triggerNode.prototype.setThenSend = function (thenSend, thenSendt) {
|
||||
var thenSendType = {
|
||||
"flow": 1,
|
||||
"global": 2,
|
||||
"str": 3,
|
||||
"num": 4,
|
||||
"bool": 5,
|
||||
"json": 6,
|
||||
"bin": 7,
|
||||
"date": 8,
|
||||
"env": 9,
|
||||
"pay": 10,
|
||||
"payl": 11,
|
||||
"nul": 12
|
||||
};
|
||||
|
||||
if (thenSendt) {
|
||||
browser.clickWithWait('//*[@id="dialog-form"]/div[5]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + thenSendType[thenSendt] + ']');
|
||||
}
|
||||
if (thenSend) {
|
||||
browser.setValue('//*[@id="dialog-form"]/div[5]/div/div[1]/input', thenSend);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = triggerNode;
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function execNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(execNode, nodePage);
|
||||
|
||||
execNode.prototype.setCommand = function (command) {
|
||||
browser.setValue('//*[@id="node-input-command"]', command);
|
||||
}
|
||||
|
||||
execNode.prototype.setAppend = function (checkbox) {
|
||||
if (browser.isSelected('#node-input-addpay') !== checkbox) {
|
||||
browser.click('#node-input-addpay');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = execNode;
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
var mqttBrokerNode = {};
|
||||
|
||||
mqttBrokerNode.setServer = function (broker, port) {
|
||||
browser.setValue('#node-config-input-broker', broker);
|
||||
port = port ? port : 1883;
|
||||
browser.setValue('#node-config-input-port', port);
|
||||
};
|
||||
|
||||
mqttBrokerNode.clickOk = function () {
|
||||
browser.clickWithWait('#node-config-dialog-ok');
|
||||
// Wait until an config dialog closes.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000, true);
|
||||
};
|
||||
|
||||
mqttBrokerNode.edit = function () {
|
||||
browser.waitForVisible('#node-input-lookup-broker');
|
||||
browser.click('#node-input-lookup-broker');
|
||||
// Wait until a config dialog opens.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000);
|
||||
};
|
||||
|
||||
function mqttInNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(mqttInNode, nodePage);
|
||||
|
||||
mqttInNode.prototype.setTopic = function (topic) {
|
||||
browser.setValue('#node-input-topic', topic);
|
||||
};
|
||||
|
||||
mqttInNode.prototype.setQoS = function (qos) {
|
||||
browser.selectWithWait('#node-input-qos', qos);
|
||||
};
|
||||
|
||||
mqttInNode.prototype.mqttBrokerNode = mqttBrokerNode;
|
||||
module.exports.mqttInNode = mqttInNode;
|
||||
|
||||
function mqttOutNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(mqttOutNode, nodePage);
|
||||
|
||||
mqttOutNode.prototype.setTopic = function (topic) {
|
||||
browser.setValue('#node-input-topic', topic);
|
||||
};
|
||||
|
||||
mqttOutNode.prototype.setRetain = function (retain) {
|
||||
browser.selectWithWait('#node-input-retain', retain);
|
||||
};
|
||||
|
||||
mqttOutNode.prototype.mqttBrokerNode = mqttBrokerNode;
|
||||
module.exports.mqttOutNode = mqttOutNode;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function httpInNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(httpInNode, nodePage);
|
||||
|
||||
httpInNode.prototype.setMethod = function(method) {
|
||||
browser.selectWithWait('#node-input-method', method);
|
||||
}
|
||||
|
||||
httpInNode.prototype.setUrl = function(url) {
|
||||
browser.setValue('#node-input-url', url);
|
||||
}
|
||||
|
||||
module.exports = httpInNode;
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function httpRequestNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(httpRequestNode, nodePage);
|
||||
|
||||
httpRequestNode.prototype.setUrl = function(url) {
|
||||
browser.setValue('#node-input-url', url);
|
||||
}
|
||||
|
||||
httpRequestNode.prototype.setMethod = function(method) {
|
||||
browser.selectWithWait('#node-input-method', method);
|
||||
}
|
||||
|
||||
httpRequestNode.prototype.setReturn = function(ret) {
|
||||
browser.selectWithWait('#node-input-ret', ret);
|
||||
}
|
||||
|
||||
module.exports = httpRequestNode;
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function httpResponseNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(httpResponseNode, nodePage);
|
||||
|
||||
module.exports = httpResponseNode;
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
var websocketListenerNode = {};
|
||||
|
||||
websocketListenerNode.setPath = function (path) {
|
||||
browser.setValue('#node-config-input-path', path);
|
||||
};
|
||||
|
||||
websocketListenerNode.setSendReceive = function (wholemsg) {
|
||||
browser.selectWithWait('#node-config-input-wholemsg', wholemsg);
|
||||
};
|
||||
|
||||
websocketListenerNode.clickOk = function () {
|
||||
browser.clickWithWait('#node-config-dialog-ok');
|
||||
// Wait until an config dialog closes.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000, true);
|
||||
};
|
||||
|
||||
websocketListenerNode.edit = function () {
|
||||
browser.waitForVisible('#node-input-lookup-server');
|
||||
browser.click('#node-input-lookup-server');
|
||||
// Wait until a config dialog opens.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000);
|
||||
};
|
||||
|
||||
var websocketClientNode = {};
|
||||
|
||||
websocketClientNode.setPath = function (path) {
|
||||
browser.setValue('#node-config-input-path', path);
|
||||
};
|
||||
|
||||
websocketClientNode.setSendReceive = function (wholemsg) {
|
||||
browser.selectWithWait('#node-config-input-wholemsg', wholemsg);
|
||||
};
|
||||
|
||||
websocketClientNode.clickOk = function () {
|
||||
browser.clickWithWait('#node-config-dialog-ok');
|
||||
// Wait until an config dialog closes.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000, true);
|
||||
};
|
||||
|
||||
websocketClientNode.edit = function () {
|
||||
browser.waitForVisible('#node-input-lookup-client');
|
||||
browser.click('#node-input-lookup-client');
|
||||
// Wait until a config dialog opens.
|
||||
browser.waitForVisible('#node-config-dialog-ok', 10000);
|
||||
};
|
||||
|
||||
function websocketInNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(websocketInNode, nodePage);
|
||||
|
||||
websocketInNode.prototype.setType = function (type) {
|
||||
browser.selectWithWait('#node-input-mode', type);
|
||||
};
|
||||
|
||||
websocketInNode.prototype.websocketListenerNode = websocketListenerNode;
|
||||
websocketInNode.prototype.websocketClientNode = websocketClientNode;
|
||||
module.exports.websocketInNode = websocketInNode;
|
||||
|
||||
function websocketOutNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(websocketOutNode, nodePage);
|
||||
|
||||
websocketOutNode.prototype.setType = function (type) {
|
||||
browser.selectWithWait('#node-input-mode', type);
|
||||
};
|
||||
|
||||
websocketOutNode.prototype.websocketListenerNode = websocketListenerNode;
|
||||
websocketOutNode.prototype.websocketClientNode = websocketClientNode;
|
||||
module.exports.websocketOutNode = websocketOutNode;
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function csvNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(csvNode, nodePage);
|
||||
|
||||
csvNode.prototype.setColumns = function (columns) {
|
||||
browser.setValue('#node-input-temp', columns);
|
||||
}
|
||||
|
||||
csvNode.prototype.setSkipLines = function (skip) {
|
||||
browser.setValue('#node-input-skip', skip);
|
||||
}
|
||||
|
||||
csvNode.prototype.setFirstRow4Names = function (checkbox) {
|
||||
if (browser.isSelected('#node-input-hdrin') !== checkbox) {
|
||||
browser.click('#node-input-hdrin');
|
||||
}
|
||||
}
|
||||
|
||||
csvNode.prototype.setOutput = function (output) {
|
||||
browser.selectWithWait('#node-input-multi', output);
|
||||
}
|
||||
|
||||
csvNode.prototype.setIncludeRow = function (checkbox) {
|
||||
if (browser.isSelected('#node-input-hdrout') !== checkbox) {
|
||||
browser.click('#node-input-hdrout');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = csvNode;
|
||||
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function htmlNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(htmlNode, nodePage);
|
||||
|
||||
htmlNode.prototype.setSelector = function (tag) {
|
||||
browser.setValue('#node-input-tag', tag);
|
||||
}
|
||||
|
||||
module.exports = htmlNode;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function jsonNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(jsonNode, nodePage);
|
||||
|
||||
jsonNode.prototype.setAction = function (action) {
|
||||
browser.setValue('node-input-action', action);
|
||||
}
|
||||
|
||||
jsonNode.prototype.setProperty = function (property) {
|
||||
browser.setValue('//*[contains(@class, "red-ui-typedInput-container")]/div[1]/input', property);
|
||||
}
|
||||
|
||||
module.exports = jsonNode;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function xmlNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(xmlNode, nodePage);
|
||||
|
||||
xmlNode.prototype.setAction = function (action) {
|
||||
browser.setValue('node-input-action', action);
|
||||
}
|
||||
|
||||
xmlNode.prototype.setProperty = function (property) {
|
||||
browser.setValue('//*[contains(@class, "red-ui-typedInput-container")]/div[1]/input', property);
|
||||
}
|
||||
|
||||
module.exports = xmlNode;
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function yamlNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(yamlNode, nodePage);
|
||||
|
||||
yamlNode.prototype.setAction = function (action) {
|
||||
browser.setValue('node-input-action', action);
|
||||
}
|
||||
|
||||
yamlNode.prototype.setProperty = function (property) {
|
||||
browser.setValue('//*[contains(@class, "red-ui-typedInput-container")]/div[1]/input', property);
|
||||
}
|
||||
|
||||
module.exports = yamlNode;
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function splitNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(splitNode, nodePage);
|
||||
|
||||
splitNode.prototype.setSplitUsing = function (splt, spltt) {
|
||||
var spltType = {
|
||||
"str": 1,
|
||||
"bin": 2,
|
||||
"len": 3
|
||||
};
|
||||
|
||||
browser.clickWithWait('//*[@id="dialog-form"]/div[3]/div/button[1]');
|
||||
browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options") and not(contains(@style, "display: none"))]/a[' + spltType[spltt] + ']');
|
||||
browser.setValue('//*[@id="dialog-form"]/div[3]/div/div[1]/input', splt);
|
||||
};
|
||||
|
||||
module.exports.splitNode = splitNode;
|
||||
|
||||
function joinNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(joinNode, nodePage);
|
||||
|
||||
module.exports.joinNode = joinNode;
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var nodePage = require('../../node_page');
|
||||
|
||||
function batchNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
batchNode.prototype.setMode = function (mode) {
|
||||
browser.selectWithWait('#node-input-mode', mode);
|
||||
}
|
||||
|
||||
batchNode.prototype.setCount = function (count) {
|
||||
browser.setValue('#node-input-count', count);
|
||||
}
|
||||
|
||||
batchNode.prototype.setOverlap = function (overlap) {
|
||||
browser.setValue('#node-input-overlap', overlap);
|
||||
}
|
||||
|
||||
util.inherits(batchNode, nodePage);
|
||||
|
||||
module.exports = batchNode;
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var util = require("util");
|
||||
|
||||
var nodePage = require("../../node_page");
|
||||
|
||||
function fileInNode(id) {
|
||||
nodePage.call(this, id);
|
||||
}
|
||||
|
||||
util.inherits(fileInNode, nodePage);
|
||||
|
||||
var formatType = {
|
||||
"utf8": 1,
|
||||
"lines": 2,
|
||||
"": 3, // a single Buffer object
|
||||
"stream": 4
|
||||
};
|
||||
|
||||
fileInNode.prototype.setFilename = function(filename) {
|
||||
browser.setValue('#node-input-filename', filename);
|
||||
}
|
||||
|
||||
fileInNode.prototype.setOutput = function(format) {
|
||||
browser.clickWithWait('#node-input-format');
|
||||
var formatTypeXPath = '//*[@id="node-input-format"]/option[' + formatType[format] + ']';
|
||||
browser.clickWithWait(formatTypeXPath);
|
||||
}
|
||||
|
||||
module.exports = fileInNode;
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
function Node(id) {
|
||||
this.id = '//*[@id="' + id + '"]';
|
||||
}
|
||||
|
||||
Node.prototype.edit = function () {
|
||||
browser.waitForVisible(this.id);
|
||||
browser.moveToObject(this.id);
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
browser.keys(['Enter']);
|
||||
// Wait until an edit dialog opens.
|
||||
browser.waitForVisible('#node-dialog-ok', 10000);
|
||||
}
|
||||
|
||||
Node.prototype.clickOk = function () {
|
||||
browser.clickWithWait('#node-dialog-ok');
|
||||
// Wait untile an edit dialog closes.
|
||||
browser.waitForVisible('#node-dialog-ok', 10000, true);
|
||||
browser.pause(50);
|
||||
}
|
||||
|
||||
Node.prototype.connect = function (targetNode, port) {
|
||||
port = port || 1;
|
||||
var outputPort = this.id + '/*[@class="red-ui-flow-port-output"][' + port + ']';
|
||||
var inputPort = targetNode.id + '/*[@class="red-ui-flow-port-input"]';
|
||||
browser.dragAndDrop(outputPort, inputPort);
|
||||
}
|
||||
|
||||
Node.prototype.clickLeftButton = function () {
|
||||
browser.moveToObject(this.id + '/*[@class="red-ui-flow-node-button"]');
|
||||
browser.buttonDown();
|
||||
browser.buttonUp();
|
||||
}
|
||||
|
||||
module.exports = Node;
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* Copyright JS Foundation and other contributors, http://js.foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var injectNode = require('./core/common/20-inject_page');
|
||||
var debugNode = require('./core/common/21-debug_page');
|
||||
var completeNode = require('./core/common/24-complete_page');
|
||||
var catchNode = require('./core/common/25-catch_page');
|
||||
var statusNode = require('./core/common/25-status_page');
|
||||
var commentNode = require('./core/common/90-comment_page');
|
||||
var functionNode = require('./core/function/10-function_page');
|
||||
var switchNode = require('./core/function/10-switch_page');
|
||||
var changeNode = require('./core/function/15-change_page');
|
||||
var rangeNode = require('./core/function/16-range_page');
|
||||
var templateNode = require('./core/function/80-template_page');
|
||||
var delayNode = require('./core/function/89-delay_page');
|
||||
var triggerNode = require('./core/function/89-trigger_page');
|
||||
var execNode = require('./core/function/90-exec_page');
|
||||
var mqttInNode = require('./core/network/10-mqtt_page').mqttInNode;
|
||||
var mqttOutNode = require('./core/network/10-mqtt_page').mqttOutNode;
|
||||
var httpInNode = require('./core/network/21-httpin_page');
|
||||
var httpResponseNode = require('./core/network/21-httpresponse_page');
|
||||
var httpRequestNode = require('./core/network/21-httprequest_page');
|
||||
var websocketInNode = require('./core/network/22-websocket_page').websocketInNode;
|
||||
var websocketOutNode = require('./core/network/22-websocket_page').websocketOutNode;
|
||||
var splitNode = require('./core/sequence/17-split_page').splitNode;
|
||||
var joinNode = require('./core/sequence/17-split_page').joinNode;
|
||||
var batchNode = require('./core/sequence/19-batch_page');
|
||||
var csvNode = require('./core/parsers/70-CSV_page');
|
||||
var htmlNode = require('./core/parsers/70-HTML_page');
|
||||
var jsonNode = require('./core/parsers/70-JSON_page');
|
||||
var xmlNode = require('./core/parsers/70-XML_page');
|
||||
var yamlNode = require('./core/parsers/70-YAML_page');
|
||||
var fileInNode = require('./core/storage/10-filein_page');
|
||||
|
||||
var nodeCatalog = {
|
||||
// common
|
||||
"inject": injectNode,
|
||||
"debug": debugNode,
|
||||
"complete": completeNode,
|
||||
"catch": catchNode,
|
||||
"status": statusNode,
|
||||
"comment": commentNode,
|
||||
// function
|
||||
"function": functionNode,
|
||||
"switch": switchNode,
|
||||
"change": changeNode,
|
||||
"range": rangeNode,
|
||||
"template": templateNode,
|
||||
"delay": delayNode,
|
||||
"trigger": triggerNode,
|
||||
"exec": execNode,
|
||||
// network
|
||||
"mqttIn": mqttInNode,
|
||||
"mqttOut": mqttOutNode,
|
||||
"httpIn": httpInNode,
|
||||
"httpResponse": httpResponseNode,
|
||||
"httpRequest": httpRequestNode,
|
||||
"websocketIn": websocketInNode,
|
||||
"websocketOut": websocketOutNode,
|
||||
// sequence
|
||||
"split": splitNode,
|
||||
"join": joinNode,
|
||||
"batch": batchNode,
|
||||
// parser
|
||||
"csv": csvNode,
|
||||
"html": htmlNode,
|
||||
"json": jsonNode,
|
||||
"xml": xmlNode,
|
||||
"yaml": yamlNode,
|
||||
// storage
|
||||
"fileIn": fileInNode
|
||||
};
|
||||
|
||||
function create(type, id) {
|
||||
var Node = nodeCatalog[type];
|
||||
return new Node(id);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
create: create,
|
||||
};
|
||||
Reference in New Issue
Block a user