Tests waiting for a find command to succeed.
It requires the following features: selenium.
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
<p:import href="https://xmlcalabash.com/ext/library/selenium.xpl"/>
<p:output port="result" sequence="true"/>
<p:option name="WHOST" select="'http://localhost:8246'" static="true"/>
<cx:selenium>
<p:with-option name="arguments" select="('--headless')"/>
<p:with-input>
<p:inline content-type="text/plain">script version 0.2 .
page "{$WHOST}/apps/delay.html" .
wait until ready.
find $button by tag = "button" .
click $button .
find $message by id = "hello" wait PT4S pause PT0.5S .
output $message to result .
</p:inline>
</p:with-input>
</cx:selenium>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
<s:pattern>
<s:rule context="/">
<s:assert test="h:p">The result isn’t a p.</s:assert>
<s:assert test="h:p = 'Hello, world.'">The value is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added static options for web server host and port.
Created test.