source: resources/apps/xforms-test-suite/suite.eg @ aab39dd

Revision aab39dd, 1.9 KB checked in by Eric van der Vlist <vdv@dyomedea.com>, 7 years ago (diff)

Refactoring the test suite vocabulary and adding a schema

  • Property mode set to 100644
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<suite xmlns="http://xformsunit.org/namespaces/suite/" xmlns:m="http://xformsunit.org/namespaces/model/"
3    xmlns:v="http://xformsunit.org/namespaces/view/" xmlns:c="http://xformsunit.org/namespaces/controller/"
4    xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
5    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:eg="http://examplotron.org/0/">
6    <!-- Reference to the form to test -->
7    <form src="hello-world.xhtml"/>
8
9    <!-- The test cases -->
10    <case id="test-greetings" eg:occurs="*" eg:content="eg:interleave">
11        <!-- Title -->
12        <title>Test that the greetings are displayed and enabled.</title>
13        <!-- Set a value (similar to XForms' setvalue action) -->
14        <c:setvalue ref="instance('instance')/PersonGivenName" eg:occurs="*">Eric</c:setvalue>
15        <!-- Check that an instance node is equal to its expected value -->
16        <m:assertEqual eg:occurs="*">
17            <!-- Actual value -->
18            <m:actual ref="instance('instance')/Greetings"/>
19            <!-- Expected -->
20            <m:expected>Hello Eric. We hope you like XForms!</m:expected>
21            <!-- Message to display when the test fails -->
22            <m:message>The greetings should be the concatenation of "Hello ", the given name and ". We hope you like
23                XForms!".</m:message>
24        </m:assertEqual>
25        <!-- Check if a control is enabled -->
26        <v:assertEnabled eg:occurs="*">
27            <!-- Identification of the control. Being an element leaves more flexibility to use other means than id/idref -->
28            <v:control idref="greetings-control"/>
29            <!-- Expected value (boolean) -->
30            <v:expected>true</v:expected>
31            <!-- Message to display if the test fails -->
32            <v:message>The greetings control should be enabled at that point.</v:message>
33        </v:assertEnabled>
34    </case>
35</suite>
Note: See TracBrowser for help on using the repository browser.