The first example shows how to compare the number of actions of two PDF documents:
<testcase name="haveSameNumberOfActions"> <assertThat testDocument="test/test.pdf" masterDocument="master/master.pdf" > <haveSameNumberOfActions /> </assertThat> </testcase>
To compare all actions of two PDF documents, you can use the tag
<haveSameActions />:
<testcase name="haveSameActions"> <assertThat testDocument="test/test.pdf" masterDocument="master/master.pdf" > <haveSameActions /> </assertThat> </testcase>
The decision whether two actions are equal depends on their type. The following table shows the properties for each type of action which determine whether the actions are equal:
| Type | Relevant Property for equals() | ||
|---|---|---|---|
| GotoAction | |||
| GotoEmbeddedAction | |||
| GotoRemoteAction | |||
| ImportDataAction | |||
| JavaScriptAction |
|
||
| LaunchAction | |||
| NamedAction | |||
| ResetFormAction | |||
| SubmitFormAction | |||
| URIAction |
The following events are always related to JavaScript actions:
document close (/DC)
document will print (/WP)
document did print (/DP)
document will save (/WS)
document did save (/DS)
The event “document open” (/DocumentOpen) can be linked
to any action in the list. The equality of two “document open” actions
depends on their actual type.