standard.test.printedCanvas elementAudio elementButton elementHtml elementImage elementScale elementText elementTextInput elementTooltip elementVideo elementVoiceRecorder elementYoutube element

getElement(id).test.printed() (since beta 0.3)

Tests whether the element was printed onto the page (and has not been removed since then).

Example:

[js highlight=”17-27″ try=”true”]
newText(“instructions”, “Click on Top/Bottom to NOT print its word”)
.print()
,
newButton(“top”, “Top”)
.settings.callback( getButton(“top”).remove() )
.print()
,
newButton(“bottom”, “Bottom”)
.settings.callback( getButton(“bottom”).remove() )
.print()
,
newButton(“print”, “Print the buttons’ words”)
.print()
.wait()
.remove()
,
getButton(“top”)
.test.printed()
.success( newText(“top word”, “hello”).print() )
,
getButton(“bottom”)
.test.printed()
.success( newText(“bottom word”, “world”).print() )
[/js]

Prints a Top and a Bottom button onto the page, which disappear when clicked. After a click on the print button, the word hello will appear if the top button is still displayed, and the word world will appear if the bottom button is still displayed.