Skip to content

Commit

Permalink
Refactor the testing logic into the common library
Browse files Browse the repository at this point in the history
Tests the fix for regression in #124.

Generally streamlines the process of test creation - from now on, your
test should have the same name as the reference image. (cc: #63)
  • Loading branch information
shippy committed Jul 18, 2017
1 parent 2a6afb6 commit 230b136
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 34 deletions.
45 changes: 11 additions & 34 deletions test/visual/correct-lotto-placement/correct-lotto-placement.robot
Original file line number Diff line number Diff line change
@@ -1,47 +1,24 @@
*** Settings ***
*** Settings ***
Documentation PsychTaskFramework correct display of lottery
Test Setup Add Needed Images
Library SikuliLibrary
Resource ../lib.robot
Test template Display Correct Lottery With

*** Variables ***
${IMAGE_DIR} ${CURDIR}\\img

*** Test Cases ***
Display Correct Lottery
Sleep 1s
Focus Matlab Command Window
Input Text ${EMPTY} testRA_25
Press Special Key ENTER
Wait Until Screen Contain RA_monetary_USD10_25.png 30
Sleep 1s
Press Special Key LEFT
Display Medical Symbols
Sleep 1s
Focus Matlab Command Window
Input Text ${EMPTY} testMDM_img
Press Special Key ENTER
Wait Until Screen Contain MDM_amb50.png 30
Sleep 1s
Press Special Key LEFT
Display Cash Symbols
Sleep 1s
Focus Matlab Command Window
Input Text ${EMPTY} testRA_img
Press Special Key ENTER
Wait Until Screen Contain RA_moneyimg_ambig24.png 30
Sleep 1s
Press Special Key LEFT
Correct Win Probability And Color
testRA_25
Correct Medical Image Display
testMDM_img
Correct Monetary Image Display
testRA_img
testSODM_mon_img
Correct Food Image Display
testHLFF_HF_0

*** Keywords ***
Add Needed Images
Add Image Path ${IMAGE_DIR}

# This is duplicated from ../__init__.txt and should be put in a resource file
# Focus Matlab Command Window
# Add Image Path ${MATLAB_IMAGE_DIR}
# #Type With Modifiers 0 CTRL
# Wait Until Screen Contain matlab-command-window-symbol.png 30
# Click matlab-command-window-symbol.png
# Sleep 1s
# Press Special Key ENTER
10 changes: 10 additions & 0 deletions test/visual/lib.robot
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ Focus Matlab Command Window
Click matlab-command-window-symbol.png
Sleep 1s
Press Special Key ENTER

Display Correct Lottery With
[Arguments] ${matlab_test_name}
Sleep 1s
Focus Matlab Command Window
Input Text ${EMPTY} ${matlab_test_name}
Press Special Key ENTER
Wait Until Screen Contain ${matlab_test_name}.png 15
Sleep 1s
Press Special Key LEFT

0 comments on commit 230b136

Please sign in to comment.