Difference between revisions of "QA/test automation guide"
From Apache OpenOffice Wiki
< QA
(Created page with "VCLAuto VCLAuto is a Java library for OpenOffice UI/functional testing like VCL TestTool. VCLAuto can be used with JUnit. The project is under developing and will be released i…") |
|||
Line 1: | Line 1: | ||
− | VCLAuto | + | == VCLAuto == |
+ | |||
+ | |||
+ | == Introduction == | ||
+ | |||
VCLAuto is a Java library for OpenOffice UI/functional testing like VCL TestTool. | VCLAuto is a Java library for OpenOffice UI/functional testing like VCL TestTool. | ||
VCLAuto can be used with JUnit. The project is under developing and will be released in Apache OpenOffice 4.0. | VCLAuto can be used with JUnit. The project is under developing and will be released in Apache OpenOffice 4.0. | ||
+ | |||
+ | == Code == | ||
+ | Write UI testing case like the following: | ||
+ | |||
+ | |||
+ | public class UITest { | ||
+ | |||
+ | @Before | ||
+ | public void setUp() throws Exception() { | ||
+ | initApp(); | ||
+ | } | ||
+ | |||
+ | @Test | ||
+ | public void test() throws Exception() { | ||
+ | // Create a new text document via main menu | ||
+ | startcenter.menuItem("File->New->Text Document").select(); | ||
+ | typeKeys("Hello OpenOffice"); | ||
+ | writer.menuItem("Edit->Select All").select(); | ||
+ | // Copy the text | ||
+ | typeKeys("<$copy>"); | ||
+ | assert("Text is inputted successfully.", "Hello OpenOffice", App.getClipboard()); | ||
+ | } | ||
+ | |||
+ | @After | ||
+ | public void tearDown() throws Exception() { | ||
+ | |||
+ | } | ||
+ | |||
+ | } |
Revision as of 03:21, 1 February 2012
VCLAuto
Introduction
VCLAuto is a Java library for OpenOffice UI/functional testing like VCL TestTool. VCLAuto can be used with JUnit. The project is under developing and will be released in Apache OpenOffice 4.0.
Code
Write UI testing case like the following:
public class UITest {
@Before public void setUp() throws Exception() { initApp(); }
@Test public void test() throws Exception() { // Create a new text document via main menu startcenter.menuItem("File->New->Text Document").select(); typeKeys("Hello OpenOffice"); writer.menuItem("Edit->Select All").select(); // Copy the text typeKeys("<$copy>"); assert("Text is inputted successfully.", "Hello OpenOffice", App.getClipboard()); }
@After public void tearDown() throws Exception() {
}
}