| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <!DOCTYPE project SYSTEM "../../../../modules/development/test/canoo/lenya_webtest.dtd"> |
| |
| <project name="workflow" basedir="." default="main"> |
| |
| <import file="../../../../modules/development/test/canoo/macros.xml"/> |
| |
| <target name="main" depends="sequence, published-footer, overview"/> |
| |
| <target name="sequence"> |
| <webtest name="workflow-sequence"> |
| &doConfig; |
| <steps> |
| |
| <!-- login as lenya --> |
| <doLogin username="lenya" password="levi"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- publish not allowed --> |
| <invoke url="index.html?lenya.usecase=workflow.publish"/> |
| <verifyText text="The event publish is not executable on document"/> |
| <clickButton name="cancel"/> |
| <verifyText text="Welcome to the Default Publication from the Lenya community!"/> |
| |
| <!-- submit --> |
| <invoke url="index.html?lenya.usecase=workflow.submit"/> |
| <verifyText text="Submit "Welcome to the Lenya default publication" for approval"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="review"/> |
| |
| <!-- logout --> |
| <doLogout/> |
| |
| <!-- login as alice --> |
| <doLogin username="alice" password="levi"/> |
| <verifyElementText type="span" name="workflow-state" text="review"/> |
| |
| <!-- reject --> |
| <invoke url="index.html?lenya.usecase=workflow.reject"/> |
| <verifyText text="Reject document "Welcome to the Lenya default publication""/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- logout --> |
| <doLogout/> |
| |
| <!-- login as lenya --> |
| <doLogin username="lenya" password="levi"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- submit --> |
| <invoke url="index.html?lenya.usecase=workflow.submit"/> |
| <verifyText text="Submit "Welcome to the Lenya default publication" for approval"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="review"/> |
| |
| <!-- logout --> |
| <doLogout/> |
| |
| <!-- login as alice --> |
| <doLogin username="alice" password="levi"/> |
| <verifyElementText type="span" name="workflow-state" text="review"/> |
| |
| <!-- publish --> |
| <invoke url="index.html?lenya.usecase=workflow.publish"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="live"/> |
| |
| <!-- deactivate --> |
| <invoke url="index.html?lenya.usecase=workflow.deactivate"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- logout --> |
| <doLogout/> |
| |
| </steps> |
| </webtest> |
| </target> |
| |
| |
| <target name="published-footer"> |
| <webtest name="Workflow sequence"> |
| <config host="${webtest.config.host}" port="${webtest.config.port}" |
| protocol="http" basepath="default"> |
| <option name="ThrowExceptionOnFailingStatusCode" value="false"/> |
| </config> |
| <steps> |
| |
| <!-- login as alice --> |
| <doLogin username="alice" password="levi" url="authoring/tutorial.html"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- submit --> |
| <invoke url="authoring/tutorial.html?lenya.usecase=workflow.submit"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="review"/> |
| |
| <!-- live version should not exist --> |
| <invoke url="live/tutorial.html"/> |
| <storeResponseCode property="status" /> |
| <verifyProperty name="status" text="404"/> |
| |
| <!-- publish --> |
| <invoke url="authoring/tutorial.html"/> |
| <verifyText text="This page has not been published yet."/> |
| <invoke url="authoring/tutorial.html?lenya.usecase=workflow.publish"/> |
| <clickButton name="submit"/> |
| <verifyElementText type="span" name="workflow-state" text="live"/> |
| <verifyText text="This page was last published at"/> |
| <verifyText text="by Alice."/> |
| |
| <invoke url="live/tutorial.html"/> |
| <verifyText text="This page was last published at"/> |
| |
| <!-- logout --> |
| <doLogout url="authoring/tutorial.html"/> |
| |
| </steps> |
| </webtest> |
| </target> |
| |
| |
| <target name="overview"> |
| <webtest name="workflow.multiWorkflow"> |
| &doConfig; |
| <steps> |
| |
| <!-- login as lenya --> |
| <doLogin username="lenya" password="levi"/> |
| <verifyElementText type="span" name="workflow-state" text="authoring"/> |
| |
| <!-- request workflow overview --> |
| <invoke url="index.html?lenya.usecase=workflow.multiWorkflow"/> |
| <verifyElementText type="h1" text="Workflow Overview"/> |
| |
| <!-- logout --> |
| <doLogout/> |
| |
| </steps> |
| </webtest> |
| </target> |
| |
| </project> |