vendredi 9 février 2018

Test cases that run two different python scripts which are in different directories

I want to run a .robot file to test two different python scripts, which are in different directories. My .robot file is in /home/alperen/Desktop/scpTest and it is as follows:

*** Settings ***
| Library | Process

*** Test Cases ***
| Use Case 1 - Scp Test

| | [Documentation] | This .robot file tests the useCase1ScpTest.py by checking the stdout.

| | [Tags] | use case 1 | critical | scpTest

| | ${result}= | run process | python | /home/alperen/Desktop/scpTest/useCase1scpTest.py
| | Should be equal as integers | ${result.rc} | 0
| | Should be equal as strings | ${result.stdout} | Passed.


| Dummy test

| | [Documentation] | Dummy text

| | [Tags] | foo | bar | runScriptOnRemote

| | ${result}= | run process | python | /home/alperen/Desktop/runScriptOnRemote/masterScript.py
| | Should be equal as integers | ${result.rc} | 0
| | Should be equal as strings | ${result.stdout} | Passed.

If I run the code above, Dummy Test fails with a message "Failed. != Passed." because masterScript.py most probably prints "Failed." However, if I copy the masterScript.py to the same directory with my .robot file, Dummy Test results with a pass. Can anyone please help me understand why it happens? Is there a way to pass the Dummy Test without copying masterScript.py? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire