getSelector(id).test.index( element ) (since version 1.0) or getSelector(id).test.index( element , index ) (since version 1.0) Tests the index of an element in the selector (starting with 0). If you pass no index, the test will be a success if the element is part of the selector, else a failure. When testing an element, remember to …
Wiki Category Archives:
scale.test.selected
getScale(id).test.selected() or getScale(id).test.selected( value ) Tests whether a button is selected. If you pass a value, it will check that it matches the label of the selected button if it has a label, its index otherwise. If you do not pass a value, it simply checks that a selection happened. Example: [js highlight=”7″ try=”true”]newScale(“score”, 5) …
key.test.pressed
getKey(id).test.pressed() or getKey(id).test.pressed( string ) or getKey(id).test.pressed( string , “first” ) (since beta 0.3) or getKey(id).test.pressed( number ) or getKey(id).test.pressed( number , “first” ) (since beta 0.3) Tests whether a key was pressed. If you pass no argument, it will yield success if any (valid) key has been pressed since the creation of the Key …
html.test.complete
getHtml(id).test.complete() (since beta 0.3) Tests whether all the obligatory fields form the HTML document have been filled. See the IBEX documentation about the Form controller for a discussion of how fields are set as obligatory. Example: [js highlight=”7″ try=”true”]newHtml(“demographics”, “example_intro.html”) .print() , newButton(“continue”, “Continue to the next page”) .print() .wait( getHtml(“demographics”).test.complete() .failure( getHtml(“demographics”).warn() ) )[/js] …
function.test.is
getFunction(id).test.is() or getFunction(id).test.is( value ) Executes the function and tests the value it returns. If you specify no value, it yields success if the return value is 0, null, undefined or false. NOTE: remember that the expression you pass as the test value is executed at the very beginning of the experiment. So calling getFunction(“myFunction”).test.is( …
button.test.clicked
getButton(id).test.clicked() (since beta 0.3) Tests whether the button was ever clicked before.
audio.test.playing
getAudio(id).test.playing() (since beta 0.3) Tests whether the audio stream is playing at the moment when the test command gets evaluated.
audio.test.hasPlayed
getAudio(id).test.hasPlayed() (since beta 0.3) Tests whether the audio stream has played at least once before in the trial.