📄 web-tests.xdt
字号:
<XDtTagDef:tagDef namespace="Form" handler="org.example.antbook.xdoclet.FormTagsHandler"/><!--<XDtForm:className/>-START--> <!-- runs person-related tests --> <target name="<XDtForm:className/>Tests" depends="Search<XDtForm:className/>s,Edit<XDtForm:className/>,Save<XDtForm:className/>,Add<XDtForm:className/>,Delete<XDtForm:className/>" description="Call and executes all person test cases (targets)"> <echo>Successfully ran all <XDtForm:className/> JSP tests!</echo> </target> <!-- Verify the edit person screen displays without errors --> <target name="Edit<XDtForm:className/>" description="Tests editing an existing <XDtForm:className/>'s information"> <canoo name="edit<XDtForm:className/>"> &config; <steps> &login; <invoke stepid="View <XDtForm:className/> List" url="/<XDtForm:classNameLower/>s.html"/> <clicklink stepid="edit first record in list" label="1"/> <verifytitle stepid="we should see the <XDtForm:classNameLower/>Detail title" text="${webapp.prefix}${<XDtForm:classNameLower/>Detail.title}"/> </steps> </canoo> </target> <!-- Edit a <XDtForm:classNameLower/> and then save --> <target name="Save<XDtForm:className/>" description="Tests editing and saving a user"> <canoo name="save<XDtForm:className/>"> &config; <steps> &login; <invoke stepid="View <XDtForm:className/> List" url="/<XDtForm:classNameLower/>s.html"/> <clicklink stepid="edit first record in list" label="1"/> <verifytitle stepid="we should see the <XDtForm:classNameLower/>Detail title" text="${webapp.prefix}${<XDtForm:classNameLower/>Detail.title}"/> <!-- update some of the required fields --> <XDtMethod:forAllMethods> <XDtMethod:ifMethodTagValueEquals tagName="hibernate.property" paramName="not-null" value="true"> <XDtType:ifIsOfType value="return-type" type="java.lang.String" extent="concrete-type"> <setinputfield stepid="set <XDtMethod:propertyName/>" name="<XDtForm:classNameLower/>Form:<XDtMethod:propertyName/>" value="<XDtMethod:propertyName/>"/> </XDtType:ifIsOfType> </XDtMethod:ifMethodTagValueEquals> </XDtMethod:forAllMethods> <clickbutton label="${button.save}" stepid="Click Save"/> <verifytitle stepid="Page re-appears if save successful" text="${webapp.prefix}${<XDtForm:classNameLower/>Detail.title}"/> </steps> </canoo> </target> <!-- Add a new <XDtForm:className/> --> <target name="Add<XDtForm:className/>" description="Adds a new <XDtForm:className/>"> <canoo name="add<XDtForm:className/>"> &config; <steps> &login; <invoke stepid="View <XDtForm:className/> List" url="/<XDtForm:classNameLower/>s.html"/> <clickbutton stepid="Click 'Add' button'" label="${button.add}"/> <verifytitle stepid="we should see the <XDtForm:classNameLower/>Detail title" text="${webapp.prefix}${<XDtForm:classNameLower/>Detail.title}"/> <!-- enter required fields --> <XDtMethod:forAllMethods> <XDtMethod:ifMethodTagValueEquals tagName="hibernate.property" paramName="not-null" value="true"> <XDtType:ifIsOfType value="return-type" type="java.lang.Boolean" extent="concrete-type"> <setinputfield stepid="set <XDtMethod:propertyName/>" name="<XDtForm:classNameLower/>Form:<XDtMethod:propertyName/>" value="true"/> </XDtType:ifIsOfType> <XDtType:ifIsOfType value="return-type" type="java.lang.String" extent="concrete-type"> <setinputfield stepid="set <XDtMethod:propertyName/>" name="<XDtForm:classNameLower/>Form:<XDtMethod:propertyName/>" value="<XDtMethod:propertyName/>"/> </XDtType:ifIsOfType> <XDtType:ifIsOfType value="return-type" type="java.lang.Long,java.lang.Integer" extent="concrete-type"> <setinputfield stepid="set <XDtMethod:propertyName/>" name="<XDtForm:classNameLower/>Form:<XDtMethod:propertyName/>" value="150"/> </XDtType:ifIsOfType> </XDtMethod:ifMethodTagValueEquals> </XDtMethod:forAllMethods> <clickbutton label="${button.save}" stepid="Click button 'Save'"/> <verifytitle stepid="<XDtForm:className/> List appears if save successful" text="${webapp.prefix}${<XDtForm:classNameLower/>List.title}"/> <verifytext stepid="verify success message" text="${<XDtForm:classNameLower/>.added}"/> </steps> </canoo> </target> <!-- Delete existing <XDtForm:classNameLower/> --> <target name="Delete<XDtForm:className/>" description="Deletes existing <XDtForm:className/>"> <canoo name="delete<XDtForm:className/>"> &config; <steps> &login; <invoke stepid="View <XDtForm:className/> List" url="/<XDtForm:classNameLower/>s.html"/> <clicklink stepid="delete first record in list" label="1"/> <clickbutton label="${button.delete}" stepid="Click button 'Delete'"/> <verifytitle stepid="display <XDtForm:className/> List" text="${webapp.prefix}${<XDtForm:classNameLower/>List.title}"/> <verifytext stepid="verify success message" text="${<XDtForm:classNameLower/>.deleted}"/> </steps> </canoo> </target> <!-- Verify the people list screen displays without errors --> <target name="Search<XDtForm:className/>s" description="Tests search for and displaying all <XDtForm:classNameLower/>s"> <canoo name="search<XDtForm:className/>s"> &config; <steps> &login; <invoke stepid="click View <XDtForm:className/>s link" url="/<XDtForm:classNameLower/>s.html"/> <verifytitle stepid="we should see the <XDtForm:classNameLower/>List title" text="${webapp.prefix}${<XDtForm:classNameLower/>List.title}"/> </steps> </canoo> </target><!--<XDtForm:className/>-END--></project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -