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

Merge pull request #2616 from kazuhitoyokoi/dev-fixuitest

Fix page object of inject node
This commit is contained in:
Nick O'Leary 2020-06-15 22:27:30 +01:00 committed by GitHub
commit e3c8466819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,15 +25,17 @@ function injectNode(id) {
util.inherits(injectNode, nodePage); util.inherits(injectNode, nodePage);
var payloadTypeList = { var payloadTypeList = {
"flow": 1, "msg": 1,
"global": 2, "flow": 2,
"str": 3, "global": 3,
"num": 4, "str": 4,
"bool": 5, "num": 5,
"json": 6, "bool": 6,
"bin": 7, "json": 7,
"date": 8, "bin": 8,
"env": 9, "date": 9,
"jsonata": 10,
"env": 11,
}; };
var repeatTypeList = { var repeatTypeList = {
@ -45,13 +47,13 @@ var repeatTypeList = {
injectNode.prototype.setPayload = function(payloadType, payload) { injectNode.prototype.setPayload = function(payloadType, payload) {
// Open a payload type list. // Open a payload type list.
browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-container")]'); browser.clickWithWait('//*[@id="node-input-property-container"]/li[1]/div/div/div[3]');
// Select a payload type. // Select a payload type.
var payloadTypeXPath = '//*[contains(@class, "red-ui-typedInput-options")]/a[' + payloadTypeList[payloadType] + ']'; var payloadTypeXPath = '//*[contains(@class, "red-ui-typedInput-options")]/a[' + payloadTypeList[payloadType] + ']';
browser.clickWithWait(payloadTypeXPath); browser.clickWithWait(payloadTypeXPath);
if (payload) { if (payload) {
// Input a value. // Input a value.
browser.setValue('//*[contains(@class, "red-ui-typedInput-input")]/input', payload); browser.setValue('//*[@id="node-input-property-container"]/li[1]/div/div/div[3]/div[1]/input', payload);
} }
} }