Skip to content

Commit

Permalink
Give programs some time to start after calling Start Process
Browse files Browse the repository at this point in the history
This fixes #42
  • Loading branch information
WojtekKowaluk committed Aug 3, 2016
1 parent 3f271b1 commit 29723e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Suite setup Set Environment Variable CLASSPATH target/test-classes
*** Test Cases ***
Starting application with main window
Start Application myapp2 java org.robotframework.remoteswinglibrary.MySwingApp 5 seconds \ False 31337
Sleep 5s
18 changes: 12 additions & 6 deletions src/test/robotframework/acceptance/remoteswinglibrary.robot
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Start application removes the JAVA_TOOL_OPTIONS from enviroment

Connecting to a started application
Set java tool options
${handle}= Start Process java org.robotframework.remoteswinglibrary.MySwingApp shell=True
${handle}= Start And Wait java org.robotframework.remoteswinglibrary.MySwingApp
Application Started myjava
Exit and check process ${handle} myjava
Set environment variable JAVA_TOOL_OPTIONS ${EMPTY}

Connecting to a specific application
[Timeout] 30 seconds
Set java tool options
${handle1}= Start Process java org.robotframework.remoteswinglibrary.MySwingApp one shell=True
${handle2}= Start Process java org.robotframework.remoteswinglibrary.MySwingApp two shell=True
${handle3}= Start Process java org.robotframework.remoteswinglibrary.MySwingApp three shell=True
${handle1}= Start And Wait java org.robotframework.remoteswinglibrary.MySwingApp one
${handle2}= Start And Wait java org.robotframework.remoteswinglibrary.MySwingApp two
${handle3}= Start And Wait java org.robotframework.remoteswinglibrary.MySwingApp three
Application Started three name_contains=three
Application Started one name_contains=one
Application Started two name_contains=two
Expand All @@ -44,7 +44,7 @@ Connecting to an application and using java agent option
[Timeout] 20 seconds
${agent}= Set Variable -javaagent:"${REMOTESWINGLIBRARYPATH}"\=127.0.0.1:${REMOTESWINGLIBRARYPORT}
log ${agent}
${handle}= Start Process java ${agent} org.robotframework.remoteswinglibrary.MySwingApp shell=True
${handle}= Start And Wait java ${agent} org.robotframework.remoteswinglibrary.MySwingApp
Application Started app
Exit and check process ${handle} app

Expand All @@ -63,7 +63,7 @@ Unallowed SwingLibrary keywords
[Teardown] System Exit

Logging java properties
Start Application mapp java org.robotframework.remoteswinglibrary.MySwingApp timeout=5 seconds
Start Application mapp java org.robotframework.remoteswinglibrary.MySwingApp timeout=10 seconds
${props}= Log Java System Properties
Should Contain ${props} System.getenv():
[Teardown] System Exit
Expand All @@ -85,3 +85,9 @@ My Closing Keyword
Switch To Application ${alias}
Log something plaah
System Exit

Start And Wait
[Arguments] ${command}
${handle}= Start Process ${command} shell=True
Sleep 5s
[Return] ${handle}
18 changes: 0 additions & 18 deletions src/test/robotframework/acceptance/security_dialogs.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,3 @@ Close Security Dialogs Again
Start Application App java org.robotframework.remoteswinglibrary.SecurityDialogsApp 30 seconds \ True
Select Main Window
Close Window Test

*** Keywords ***
Keyword Should Not Exist
[Arguments] ${keyword}
Run Keyword And Expect Error No keyword with name '${keyword}' found. Keyword Should Exist ${keyword}

Exit and check process
[Arguments] ${handler} ${alias}
Switch To Application ${alias}
Process Should Be Running ${handler}
System Exit
Wait until keyword succeeds 5 seconds 0.5 seconds Process Should Be Stopped ${handler}

My Closing Keyword
[Arguments] ${alias}
Switch To Application ${alias}
Log something plaah
System Exit

0 comments on commit 29723e6

Please sign in to comment.