Difference between revisions of "QA/test automation guide"

From Apache OpenOffice Wiki
< QA
Jump to: navigation, search
(VCLAuto)
(Introduction)
Line 6: Line 6:
 
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.
  
 
+
'''There are a lot of testing codes in the OO project, e.g. junit/cppunit test, qadevooo and smoketestoo_native. Why do we need the library?'''
There are a lot of testing code in the OO project, e.g. qadevooo, smoketestoo_native. Why do we need the library? The code in qadevooo & smoketestoo_native uses UNO API to perform testing. It can't fully simulate a user behavior and check if testing GUI is correct. For example, check if user can draw a shape by dragging, check if OO automatically capitalize the first letter after typing a word, check if a button's checked when user change the selection, etc.
+
Generally, unit test code (pure junit/cppunit test) is executed in the build process before OO is created. It's low-level and used to verify if the source code is right before they are linked to a real product. It's a white-box testing. If you want to verify a function/method/interface is correct, put your test code in unit test.
 
+
qadevooo & smoketestoo_native uses UNO API/Macro to perform testing. To run them, a real OO product must be available. It's middle-level and used to verify if UNO api and business model work correctly. It's a gray-box testing. User interaction is not involved in this testing. It can't fully simulate a user behavior or check if GUI is correct. For example, check if user can draw a shape by dragging, check if OO automatically capitalize the first letter after typing a word, check if a button's checked when user change the selection, etc.
Actually VCLAuto is a client, which connects to the automation server (automation module) in OpenOffice with socket. With the "-enableautomation" argument, OpenOffice will start the server with listening on the port 12479 be default.
+
Vclauto is high-level black-box testing. It performs testing more like a real user. It generates keyboard/mouse events, does GUI actions  and gets information from the GUI to validate the function.
  
 
== Code ==
 
== Code ==

Revision as of 08:24, 22 February 2012

VCLAuto [Planning]

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.

There are a lot of testing codes in the OO project, e.g. junit/cppunit test, qadevooo and smoketestoo_native. Why do we need the library? Generally, unit test code (pure junit/cppunit test) is executed in the build process before OO is created. It's low-level and used to verify if the source code is right before they are linked to a real product. It's a white-box testing. If you want to verify a function/method/interface is correct, put your test code in unit test. qadevooo & smoketestoo_native uses UNO API/Macro to perform testing. To run them, a real OO product must be available. It's middle-level and used to verify if UNO api and business model work correctly. It's a gray-box testing. User interaction is not involved in this testing. It can't fully simulate a user behavior or check if GUI is correct. For example, check if user can draw a shape by dragging, check if OO automatically capitalize the first letter after typing a word, check if a button's checked when user change the selection, etc. Vclauto is high-level black-box testing. It performs testing more like a real user. It generates keyboard/mouse events, does GUI actions and gets information from the GUI to validate the function.

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() {
 
  }
 
}

Use Apache Ant to Run Testing and Generate Report

File:Vclautoreport.png

Personal tools