mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Refactor UI testing code following a design note
This commit is contained in:
@@ -19,8 +19,8 @@ var should = require("should");
|
||||
var fs = require('fs-extra');
|
||||
|
||||
var helper = require("../../editor_helper");
|
||||
var debugTab = require('../../pageobjects/workspace/debugTab_page');
|
||||
var workspace = require('../../pageobjects/workspace/workspace_page');
|
||||
var debugTab = require('../../pageobjects/editor/debugTab_page');
|
||||
var workspace = require('../../pageobjects/editor/workspace_page');
|
||||
|
||||
var nodeWidth = 200;
|
||||
|
@@ -17,8 +17,8 @@
|
||||
var should = require("should");
|
||||
|
||||
var helper = require("../../editor_helper");
|
||||
var debugTab = require('../../pageobjects/workspace/debugTab_page');
|
||||
var workspace = require('../../pageobjects/workspace/workspace_page');
|
||||
var debugTab = require('../../pageobjects/editor/debugTab_page');
|
||||
var workspace = require('../../pageobjects/editor/workspace_page');
|
||||
|
||||
var nodeWidth = 200;
|
||||
var nodeHeight = 100;
|
||||
@@ -65,7 +65,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello');
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -105,7 +105,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-query?name=Nick');
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -145,7 +145,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-param/Dave');
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -190,7 +190,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-headers');
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(changeNode);
|
||||
@@ -249,7 +249,7 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 2, nodeHeight * 2);
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-data');
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
@@ -299,12 +299,12 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 2, nodeHeight);
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-json');
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
debugNode.edit();
|
||||
debugNode.setTarget("msg", "headers");
|
||||
debugNode.setOutput("headers");
|
||||
debugNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -332,7 +332,7 @@ describe('cookbook', function() {
|
||||
|
||||
fileinNode.edit();
|
||||
fileinNode.setFilename("test/resources/file-in-node/test.txt");
|
||||
fileinNode.setFormat("");
|
||||
fileinNode.setOutput("");
|
||||
fileinNode.clickOk();
|
||||
|
||||
changeNode.edit();
|
||||
@@ -352,7 +352,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-file');
|
||||
httpRequestNode.setMethod("get");
|
||||
httpRequestNode.setMethod("GET");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -396,7 +396,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-raw');
|
||||
httpRequestNode.setMethod("post");
|
||||
httpRequestNode.setMethod("POST");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequestNode);
|
||||
@@ -445,7 +445,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-form');
|
||||
httpRequestNode.setMethod("post");
|
||||
httpRequestNode.setMethod("POST");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(changeNode);
|
||||
@@ -495,7 +495,7 @@ describe('cookbook', function() {
|
||||
|
||||
httpRequestNode.edit();
|
||||
httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/hello-json');
|
||||
httpRequestNode.setMethod("post");
|
||||
httpRequestNode.setMethod("POST");
|
||||
httpRequestNode.clickOk();
|
||||
|
||||
injectNode.connect(changeNode);
|
||||
@@ -531,7 +531,7 @@ describe('cookbook', function() {
|
||||
httpinNodeFormat.clickOk();
|
||||
|
||||
functionNodeFormat.edit();
|
||||
functionNodeFormat.setCode("msg.payload = JSON.stringify(msg.req.cookies,null,4);");
|
||||
functionNodeFormat.setFunction("msg.payload = JSON.stringify(msg.req.cookies,null,4);");
|
||||
functionNodeFormat.clickOk();
|
||||
|
||||
templateNode.edit();
|
||||
@@ -550,7 +550,7 @@ describe('cookbook', function() {
|
||||
httpinNodeAdd.clickOk();
|
||||
|
||||
functionNodeAdd.edit();
|
||||
functionNodeAdd.setCode("msg.cookies = { };\n msg.cookies[\"demo-\"+(Math.floor(Math.random()*1000))] = Date.now();");
|
||||
functionNodeAdd.setFunction("msg.cookies = { };\n msg.cookies[\"demo-\"+(Math.floor(Math.random()*1000))] = Date.now();");
|
||||
functionNodeAdd.clickOk();
|
||||
|
||||
changeNode.edit();
|
||||
@@ -571,7 +571,7 @@ describe('cookbook', function() {
|
||||
httpinNodeClear.clickOk();
|
||||
|
||||
functionNodeClear.edit();
|
||||
functionNodeClear.setCode("var cookieNames = Object.keys(msg.req.cookies).filter(function(cookieName) { return /^demo-/.test(cookieName);});\nmsg.cookies = {};\n\ncookieNames.forEach(function(cookieName) {\n msg.cookies[cookieName] = null;\n});\n\n");
|
||||
functionNodeClear.setFunction("var cookieNames = Object.keys(msg.req.cookies).filter(function(cookieName) { return /^demo-/.test(cookieName);});\nmsg.cookies = {};\n\ncookieNames.forEach(function(cookieName) {\n msg.cookies[cookieName] = null;\n});\n\n");
|
||||
functionNodeClear.clickOk();
|
||||
|
||||
httpinNodeClear.connect(functionNodeClear);
|
||||
|
@@ -19,8 +19,8 @@ var should = require("should");
|
||||
var fs = require('fs-extra');
|
||||
|
||||
var helper = require("../../editor_helper");
|
||||
var debugTab = require('../../pageobjects/workspace/debugTab_page');
|
||||
var workspace = require('../../pageobjects/workspace/workspace_page');
|
||||
var debugTab = require('../../pageobjects/editor/debugTab_page');
|
||||
var workspace = require('../../pageobjects/editor/workspace_page');
|
||||
var specUtil = require('../../pageobjects/util/spec_util_page');
|
||||
|
||||
var nodeWidth = 200;
|
||||
@@ -168,8 +168,8 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 2);
|
||||
|
||||
injectNode.edit();
|
||||
injectNode.setTimeType("interval");
|
||||
injectNode.setRepeat(1);
|
||||
injectNode.setRepeat("interval");
|
||||
injectNode.setRepeatInterval(1);
|
||||
injectNode.clickOk();
|
||||
injectNode.connect(debugNode);
|
||||
|
||||
@@ -196,12 +196,12 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 3);
|
||||
|
||||
httpRequetNode.edit();
|
||||
httpRequetNode.setMethod("get");
|
||||
httpRequetNode.setMethod("GET");
|
||||
httpRequetNode.setUrl(helper.url());
|
||||
httpRequetNode.clickOk();
|
||||
|
||||
htmlNode.edit();
|
||||
htmlNode.setTag("title");
|
||||
htmlNode.setSelector("title");
|
||||
htmlNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequetNode);
|
||||
@@ -336,14 +336,14 @@ describe('cookbook', function() {
|
||||
changeNodeSetPost.clickOk();
|
||||
|
||||
httpRequetNode.edit();
|
||||
httpRequetNode.setMethod("get");
|
||||
httpRequetNode.setMethod("GET");
|
||||
var url = helper.url() + httpNodeRoot + "/{{post}}";
|
||||
httpRequetNode.setUrl(url);
|
||||
httpRequetNode.setRet("obj");
|
||||
httpRequetNode.setReturn("obj");
|
||||
httpRequetNode.clickOk();
|
||||
|
||||
debugNode.edit();
|
||||
debugNode.setTarget("msg", "payload.title");
|
||||
debugNode.setOutput("payload.title");
|
||||
debugNode.clickOk();
|
||||
|
||||
injectNode.connect(changeNodeSetPost);
|
||||
@@ -389,9 +389,9 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 2);
|
||||
|
||||
httpRequetNode.edit();
|
||||
httpRequetNode.setMethod("get");
|
||||
httpRequetNode.setMethod("GET");
|
||||
httpRequetNode.setUrl(helper.url() + "/settings");
|
||||
httpRequetNode.setRet("bin");
|
||||
httpRequetNode.setReturn("bin");
|
||||
httpRequetNode.clickOk();
|
||||
|
||||
injectNode.connect(httpRequetNode);
|
||||
@@ -413,11 +413,11 @@ describe('cookbook', function() {
|
||||
var debugNode = workspace.addNode("debug", nodeWidth * 3);
|
||||
|
||||
functionNode.edit();
|
||||
functionNode.setCode("msg.payload = \"data to post\";");
|
||||
functionNode.setFunction("msg.payload = \"data to post\";");
|
||||
functionNode.clickOk();
|
||||
|
||||
httpRequetNode.edit();
|
||||
httpRequetNode.setMethod("post");
|
||||
httpRequetNode.setMethod("POST");
|
||||
var url = helper.url() + httpNodeRoot + "/set-header";
|
||||
httpRequetNode.setUrl(url);
|
||||
httpRequetNode.clickOk();
|
||||
|
Reference in New Issue
Block a user