Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
robot-version: [2.8.7, 2.9.2, 3.0.4, 3.2.1]
robot-version: [2.8.7, 2.9.2, 3.0.4, 3.1.2, 3.2.1]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} and Robot Framework ${{ matrix.robot-version }}
Expand Down
6 changes: 6 additions & 0 deletions lib/robotremote.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function Server(libraries, options, listeningCallback) {
this.server.on('get_keyword_arguments', rpcWrap(this.getKeywordArguments));
this.server.on('get_keyword_documentation', rpcWrap(this.getKeywordDocumentation));
this.server.on('get_keyword_tags', rpcWrap(this.getKeywordTags));
this.server.on('get_keyword_types', rpcWrap(this.getKeywordTypes));

// Register signal handlers.
var handleSignal = function () {
Expand Down Expand Up @@ -101,6 +102,11 @@ Server.prototype.getKeywordTags = function (name, response) {
response(null, this.keywords[name].tags || []);
};

Server.prototype.getKeywordTypes = function (name, response) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than indirectly, by using libdoc, this could be tested with mocha for basic functionality and maybe couple edge cases.

// https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#argument-types
response(null, this.keywords[name].types);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if types is not specified? how is that supposed to be filled? would be good and example keyword in test library where types are specified.

};

Server.prototype.getKeywordArguments = function (name, response) {
response(null, this.keywords[name].args);
};
Expand Down
15 changes: 12 additions & 3 deletions test/robotremote.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
Library Process
Library String
Suite Setup Start Remote Server
Suite Teardown Stop Remote Server
Suite Teardown Collect Logs and Stop Server

*** Variables ***

${HOST} localhost
${PORT} 8270

*** Test Cases ***

Run Synchronous Keyword Without Return Value And No Arguments
${result}= Do Nothing
Should Be Equal ${result} ${EMPTY}
Expand Down Expand Up @@ -61,11 +60,21 @@ Run Asynchronous Failing Keyword
Never Returning Keyword Should Fail After Timeout
Run Keyword And Expect Error Error: Keyword execution got timeout Never Return

Generate Documentation
Run Process python -m robot.libdoc Remote::http://${HOST}:${PORT} example.html
Process Should Be Running
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't wait for it? and check status?


*** Keywords ***

Start Remote Server
${remote}= Start Process node ./test/testlibrary.js ${HOST} ${PORT}
Sleep 1s
Process Should Be Running ${remote}
Process Should Be Running
Import Library Remote http://${HOST}:${PORT}

Collect Logs and Stop Server
Run Keyword And Ignore Error Stop Remote Server
Wait For Process
${result} Get Process Result
Log ${result.stdout}
Log ${result.stderr}
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,3 @@ describe('Robot Remote Library', function () {
});
});
});