Now that you know how to redesign a long script into several modules, try this out with the TestNames test from the last chapter's exercise. If you didn't do that exercise, you can find the solution (TestNames.java
and TestNames.java
) in the \tutorial\gettingStarted
directory.
For this exercise:
Acceptance2.jst
, so that you don't confuse it with the original version.
There's more than one way to tackle this exercise. One solution breaks the search test down into four modules:
OpenNames
--open the Names window
SelectName
--select a name from the list
VerifyRecord
--the same script you recorded earlier in this chapter, with no modifications
CloseNames
--close the Names window
You might have chosen fewer, and that's okay. Using four modules comes in handy later on, when you can parameterize individual nodes.
If you did use four nodes, your search JST in the Test Composer should look somewhat like this:
Incorporating the VerifyNames JST into the acceptance test requires only a few steps. You only need to:
Acceptance.jst
in the Test Composer.ClearDisplay
to VerifyNames.jst
.Acceptance2.jst
.Acceptance2.jst--one solution
When you run this test, the summary for the overall Acceptance2.jst run should show 12 verifications instead of the original six.
You can find VerifyNames.jst
and the scripts that support it in the \tutorial\modular
directory. Look at the files:
VerifyNames.jst
and
OpenNames.classOpenNames.java
and
SelectName.classSelectName.java
and
VerifyRecord.classVerifyRecord.java
and
CloseNames.classCloseNames.java
Acceptance2.jst
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.