adcutil
Version:
Utilities tools for Askia Design Control
197 lines (174 loc) • 6.23 kB
text/xml
<tests xmlns="http://www.askia.com/ADCUnitTestSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.askia.com/ADCUnitTestSchema http://www.askia.com/Downloads/dev/schemas/adc2.0/UnitTests.xsd">
<units>
<test id="contains_input_text" description="Should contains an input text" cases="default_open">
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_count is="equal" value="1"/>
<assert_has_attr name="type" value="text"/>
<assert_has_attr name="name" value="S1"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="contains_textarea" description="When multiline=true, should contains a <textarea>" cases="default_open">
<arrange>
<properties>
<property id="multiline">
<value>true</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//textarea">
<assert_exist />
<assert_has_attr name="name" value="S1"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="not_contains_textarea" description="When multiline=true and the opensubtype!=text it should not contains a <textarea>" cases="default_open">
<arrange>
<properties>
<property id="multiline">
<value>true</value>
</property>
<property id="opensubtype">
<value>email</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//textarea">
<assert_not_exist />
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="contains_input_email" description="Should contains an input email when the opensubtype=email" cases="default_open">
<arrange>
<properties>
<property id="opensubtype">
<value>email</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_has_attr name="type" value="email"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="contains_input_url" description="Should contains an input url when the opensubtype=url" cases="default_open">
<arrange>
<properties>
<property id="opensubtype">
<value>url</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_has_attr name="type" value="url"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="contains_input_color" description="Should contains an input color when the opensubtype=color" cases="default_open">
<arrange>
<properties>
<property id="opensubtype">
<value>color</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_has_attr name="type" value="color"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="use_placeholder" description="Should add a `placeholder` attribute when the `placeholder` property is not empty" cases="default_open">
<arrange>
<properties>
<property id="placeholder">
<value>Enter your comment ...</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_has_attr name="type" value="text"/>
<assert_has_attr name="placeholder" value="Enter your comment ..."/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="use_placeholder" description="Should add a `placeholder` attribute when the `placeholder` property is not empty and multiline=true" cases="default_open">
<arrange>
<properties>
<property id="multiline">
<value>true</value>
</property>
<property id="placeholder">
<value>Enter your comment ...</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//textarea">
<assert_has_attr name="placeholder" value="Enter your comment ..."/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="use_datalist_add_list_attribute" description="Should add a `list` attribute when the `datalist` property is not empty" cases="default_open">
<arrange>
<properties>
<property id="datalist">
<value>A|B|C|D</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//input">
<assert_has_attr name="list" value="S1"/>
</select_nodes>
</placeholder>
</asserts>
</test>
<test id="use_datalist_add_datalist_node" description="Should add a `datalist` node with one option per data in the list when the `datalist` property is not empty" cases="default_open">
<arrange>
<properties>
<property id="datalist">
<value>A|B|C|D</value>
</property>
</properties>
</arrange>
<asserts>
<placeholder>
<select_nodes xPath="//datalist">
<assert_exist />
<assert_has_attr name="id" value="S1"/>
</select_nodes>
<select_nodes xPath="//datalist/option">
<assert_count is="equal" value="4"/>
</select_nodes>
</placeholder>
</asserts>
</test>
</units>
</tests>