rainmanwy / robotframework-SikuliLibrary

Sikuli Robot Framework Library provide keywords for Robot Framework to test UI through Sikuli.
Apache License 2.0
144 stars 61 forks source link

Executing a Robot Script in VSCode works whereas in Terminal it doesn't #144

Closed dschiller closed 3 years ago

dschiller commented 3 years ago

Executing a Robot Script in VSCode works whereas in Terminal it doesn't.

Executed in the Terminal of MacOS Sikuli fails with:

com.github.rainmanwy.robotframework.sikulilib.exceptions.TimeoutException: Timeout happend, could not find P(LPX/EmptyProject.png) S: 0.7

Executing the same Script in VSCode finds the Image LPX/EmptyProject.png and clicks it.

In VScode and in the Terminal my current workdir is exactly the same also how I execute the robot Script is exactly the same in both cases.

TestLogicAUQT.robot

*** Settings ***
Library  Libraries/LibDaw.py
Library  SikuliLibrary  timeout=20.0
Test Setup  Setup
Test Teardown  Teardown

*** Test Cases ***
Test Logic Pro ABDemo AU 
  Open DAW  Logic Pro X
  Double Click  LPX/EmptyProject  # <-- Works in VSCode ( bash ) and fails in Terminal

*** Keywords ***
Setup
  Add Image Path  Tests/Data/UIAutomationImages
Teardown
  Type with Modifiers  q  CMD
  @{expectedImages}  Create List  LPX/QuitDontSave  LPX/QuitDontSaveDark
  @{unexpectedImages}  Create List
  ${status}  ${image}  Run Keyword and ignore Error  Wait for multiple Images  10  0  ${expectedImages}  ${unexpectedImages}
  Run Keyword If  '${image}' == 'LPX/QuitDontSave'
  ...  Click  LPX/QuitDontSave
  Run Keyword If  '${image}' == 'LPX/QuitDontSaveDark'
  ...  Click  LPX/QuitDontSaveDark
  Stop Remote Server

Output

VSCode

==============================================================================
TestLogicAUQT                                                                 
==============================================================================
Test Logic Pro ABDemo AU                                              | PASS |
------------------------------------------------------------------------------
TestLogicAUQT                                                         | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/output.xml
Log:     /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/log.html
Report:  /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/report.html

Terminal

==============================================================================
TestLogicAUQT                                                                 
==============================================================================
Test Logic Pro ABDemo AU                                              | FAIL |
com.github.rainmanwy.robotframework.sikulilib.exceptions.TimeoutException: Timeout happend, could not find P(LPX/EmptyProject.png) S: 0.7
------------------------------------------------------------------------------
TestLogicAUQT                                                         | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/output.xml
Log:     /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/log.html
Report:  /Users/dirk.schiller/Work/Coding/Python/QALibs/Tests/Results/report.html
dschiller commented 3 years ago

Tried to update the Bash brew install bash from 3.2.x to 5.1.x. No difference, same Issue. VScode and Terminal using the same Bash.

dschiller commented 3 years ago

System Preferences / Security & Privacy / Privacy / Screen Recording / Terminal ( active ) ( Catalina 10.15.7 ) need to be set to work in Terminal.