<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/selenium-028.xml"
        name="selenium-028.xml"
        expected="pass"
        features="selenium">
   <t:info>
      <t:title>selenium-028</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-05-23</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added static options for web server host and port.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2025-02-09</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Created test.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests pause.</p>
   </t:description>
   <t:pipeline>
      <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" .

find $button by tag = "button" .
click $button .

pause PT3S.

find $message by id = "hello" .
output $message to result .
      </p:inline>
            </p:with-input>
         </cx:selenium>
         <p:wrap-sequence wrapper="wrapper"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <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="wrapper">The result isn’t a wrapper.</s:assert>
               <s:assert test="wrapper = 'Hello, world.'">The value is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>
