View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

Display Logic Testing

Contents

Introduction

It is possible to check display logic of the application. QA team provides this feature to assert Display Logic in ERP.

Display logic types

There are three different kind of verifiable Display Logic groups:

Display logic test template

The following is a template that shows how a simple Display Logic test is created. Much more complex tests can be created from this simple template.

Testlink template



Automated test code template

Definition of the parameters

 
  @Parameters
  public static Collection<Object[]> purchaseOrderDisplayLogic() {
 
    return Arrays.asList(new Object[][] { {
        new PurchaseOrderHeaderData.Builder().businessPartner(
            new BusinessPartnerSelectorData.Builder().value("VA").build()).build(),
        new PurchaseOrderHeaderDisplayLogic.Builder().organization(true).transactionDocument(true)
            .documentNo(true).deliveryNotes(false).build() } });
  }

The following code creates the record and the next action asserts the Display Logic.

 
  /**
   * Test the display logic of the PurchaseOrderHeader
   */
  @Test
  public void PROa_createPurchaseOrderAndInvoice() {
    logger.info("** Start of test case PurchaseOrderHeaderDisplayLogic. **");
    final PurchaseOrder purchaseOrder = new PurchaseOrder(mainPage).open();
    purchaseOrder.create(purchaseOrderHeaderData);
    purchaseOrder.assertDisplayLogicVisible(purchaseOrderHeaderDisplayLogic);
    logger.info("** End of test PurchaseOrderHeaderDisplayLogic. **");
  }
}

This fragment of code shows how Display Logic is managed. (In this certain case, visibility).

 
  /**
   * Assert display logic visibility
   * 
   * @param visibleDisplayLogic
   *          DataObject with the fields whose visibility has to be asserted.
   */
  public void assertDisplayLogicVisible(DataObject visibleDisplayLogic) {
 
    for (final String key : visibleDisplayLogic.getDataFields().keySet()) {
      if (visibleDisplayLogic.getDataFields().get(key).equals(true)) {
        assertTrue(key + " is not visible", this.getForm().getSection(key).isVisible());
      } else {
        assertFalse(key + " is visible. It shouldn't", this.getForm().getSection(key).isVisible());
      }
    }
  }

Retrieved from "http://wiki.openbravo.com/wiki/Display_Logic_Testing"

This page has been accessed 860 times. This page was last modified on 1 March 2016, at 12:09. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.