Related to issue 28226: Added some automated tests
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Thu, 19 Nov 2015 11:15:01 +0100
changeset 3803 a944561bd049
parent 3802 aea81d12a512
child 3804 582e8acf9dc5
Related to issue 28226: Added some automated tests
src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/CreateLinesFromPopUp.java
src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/GoodsReceiptHeaderTab.java
src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/CreateLinesFromPopUp.java
src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/GoodsShipmentHeaderTab.java
src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression28226.java
src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRO_RegressionSuite.java
src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/build.xml
src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression28226.java
src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SAL_RegressionSuite.java
src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/build.xml
src-test/com/openbravo/test/integration/erp/testscripts/SmokeTabScript.java
src-test/com/openbravo/test/integration/erp/testscripts/procurement/transactions/GoodsReceipt.java
src-test/com/openbravo/test/integration/erp/testscripts/sales/transactions/GoodsShipment.java
--- a/src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/CreateLinesFromPopUp.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/CreateLinesFromPopUp.java	Thu Nov 19 11:15:01 2015 +0100
@@ -22,6 +22,7 @@
 
 package com.openbravo.test.integration.erp.gui.procurement.transactions.goodsreceipt;
 
+import org.openqa.selenium.WebElement;
 import org.apache.log4j.Logger;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.support.ui.Select;
@@ -108,13 +109,18 @@
           tryOrder));
     }
     Sleep.trySleep();
-    SeleniumSingleton.INSTANCE.findElementByName(CHECK_BOX_LINES).click();
+    for (WebElement record : SeleniumSingleton.INSTANCE.findElementsByName(CHECK_BOX_LINES)) {
+      record.click();
+    }
     if (attribute != "") {
-      SeleniumSingleton.INSTANCE.findElementById("buttonAttributeSetInstance").click();
-      Sleep.trySleep();
-      new AttributeSetPopUp().setAttribute(attribute);
-      SeleniumSingleton.INSTANCE.switchTo().window(windowHandle);
-      waitForFrame();
+      for (WebElement record : SeleniumSingleton.INSTANCE
+          .findElementsByName("buttonAttributeSetInstance")) {
+        record.click();
+        Sleep.trySleep();
+        new AttributeSetPopUp().setAttribute(attribute);
+        SeleniumSingleton.INSTANCE.switchTo().window(windowHandle);
+        waitForFrame();
+      }
     }
     clickOK();
   }
--- a/src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/GoodsReceiptHeaderTab.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/GoodsReceiptHeaderTab.java	Thu Nov 19 11:15:01 2015 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2011-2012 Openbravo S.L.U.
+ * All portions are Copyright (C) 2011-2015 Openbravo S.L.U.
  * All Rights Reserved. 
  * Contributor(s):
  *   Pablo Lujan <plu@openbravo.com>.
@@ -67,8 +67,8 @@
     super(TITLE, IDENTIFIER);
     addChildTab(new GoodsReceiptLinesTab(this));
     buttonComplete = new Button(TestRegistry.getObjectString(REGISTRY_KEY_BUTTON_COMPLETE));
-    buttonCreateLinesFrom = new Button(TestRegistry
-        .getObjectString(REGISTRY_KEY_BUTTON_CREATE_LINES_FROM));
+    buttonCreateLinesFrom = new Button(
+        TestRegistry.getObjectString(REGISTRY_KEY_BUTTON_CREATE_LINES_FROM));
 
   }
 
@@ -97,6 +97,14 @@
   }
 
   /**
+   * Complete the order.
+   * 
+   */
+  public void close() {
+    process("Void");
+  }
+
+  /**
    * Creates lines from an order.
    * 
    * @param warehouseAlias
--- a/src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/CreateLinesFromPopUp.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/CreateLinesFromPopUp.java	Thu Nov 19 11:15:01 2015 +0100
@@ -22,6 +22,7 @@
 
 package com.openbravo.test.integration.erp.gui.sales.transactions.goodsshipment;
 
+import org.openqa.selenium.WebElement;
 import org.apache.log4j.Logger;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.support.ui.Select;
@@ -105,7 +106,9 @@
           tryOrder));
     }
     Sleep.trySleep();
-    SeleniumSingleton.INSTANCE.findElementByName(CHECK_BOX_LINES).click();
+    for (WebElement record : SeleniumSingleton.INSTANCE.findElementsByName(CHECK_BOX_LINES)) {
+      record.click();
+    }
     clickOK();
   }
 
--- a/src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/GoodsShipmentHeaderTab.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/GoodsShipmentHeaderTab.java	Thu Nov 19 11:15:01 2015 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo S.L.U. 
- * All portions are Copyright (C) 2011-2012 Openbravo S.L.U. 
+ * All portions are Copyright (C) 2011-2015 Openbravo S.L.U. 
  * All Rights Reserved. 
  * Contributor(s):
  *   Leo Arias <leo.arias@openbravo.com>.
@@ -111,4 +111,12 @@
   public void complete() {
     process("Complete");
   }
+
+  /**
+   * Complete the shipment.
+   * 
+   */
+  public void close() {
+    process("Void");
+  }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRORegression28226.java	Thu Nov 19 11:15:01 2015 +0100
@@ -0,0 +1,211 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo S.L.U. 
+ * All portions are Copyright (C) 2015 Openbravo S.L.U. 
+ * All Rights Reserved. 
+ * Contributor(s):
+ *  Leo Arias <leo.arias@openbravo.com>.
+ ************************************************************************
+ */
+
+package com.openbravo.test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions;
+
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import com.openbravo.test.integration.erp.data.DataObject;
+import com.openbravo.test.integration.erp.data.LogInData;
+import com.openbravo.test.integration.erp.data.procurement.transactions.goodsreceipt.GoodsReceiptHeaderData;
+import com.openbravo.test.integration.erp.data.procurement.transactions.goodsreceipt.GoodsReceiptLinesData;
+import com.openbravo.test.integration.erp.data.procurement.transactions.purchaseorder.PurchaseOrderHeaderData;
+import com.openbravo.test.integration.erp.data.procurement.transactions.purchaseorder.PurchaseOrderLinesData;
+import com.openbravo.test.integration.erp.data.selectors.BusinessPartnerSelectorData;
+import com.openbravo.test.integration.erp.data.selectors.LocatorSelectorData;
+import com.openbravo.test.integration.erp.data.selectors.ProductCompleteSelectorData;
+import com.openbravo.test.integration.erp.data.selectors.ProductSelectorData;
+import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest;
+import com.openbravo.test.integration.erp.testscripts.procurement.transactions.GoodsReceipt;
+import com.openbravo.test.integration.erp.testscripts.procurement.transactions.PurchaseOrder;
+
+/**
+ * Test regression 28226
+ * 
+ * @author aferraz
+ */
+@RunWith(Parameterized.class)
+public class PRORegression28226 extends OpenbravoERPTest {
+
+  /** Log4j logger for this class. */
+  private static Logger logger = Logger.getLogger(PRORegression28226.class);
+
+  /* Data for this test. */
+
+  PurchaseOrderHeaderData purchaseOrderHeaderData;
+  PurchaseOrderHeaderData purchaseOrderHeaderVerficationData;
+  PurchaseOrderLinesData purchaseOrderLinesData;
+  PurchaseOrderLinesData purchaseOrderLinesVerificationData;
+  PurchaseOrderLinesData purchaseOrderLinesData2;
+  PurchaseOrderLinesData purchaseOrderLinesVerificationData2;
+  PurchaseOrderHeaderData bookedPurchaseOrderHeaderVerificationData;
+  GoodsReceiptHeaderData goodsReceiptHeaderData;
+  GoodsReceiptHeaderData goodsReceiptHeaderVerificationData;
+  GoodsReceiptLinesData goodsReceiptLineVerificationData;
+  GoodsReceiptLinesData goodsReceiptLineVerificationData2;
+  GoodsReceiptHeaderData completedGoodsReceiptHeaderVerificationData;
+  GoodsReceiptHeaderData completedGoodsReceiptHeaderVerificationData2;
+
+  /**
+   * Class constructor.
+   * 
+   */
+  public PRORegression28226(PurchaseOrderHeaderData purchaseOrderHeaderData,
+      PurchaseOrderHeaderData purchaseOrderHeaderVerficationData,
+      PurchaseOrderLinesData purchaseOrderLinesData,
+      PurchaseOrderLinesData purchaseOrderLinesVerificationData,
+      PurchaseOrderLinesData purchaseOrderLinesData2,
+      PurchaseOrderLinesData purchaseOrderLinesVerificationData2,
+      PurchaseOrderHeaderData bookedPurchaseOrderHeaderVerificationData,
+      GoodsReceiptHeaderData goodsReceiptHeaderData,
+      GoodsReceiptHeaderData goodsReceiptHeaderVerificationData,
+      GoodsReceiptLinesData goodsReceiptLineVerificationData,
+      GoodsReceiptLinesData goodsReceiptLineVerificationData2,
+      GoodsReceiptHeaderData completedGoodsReceiptHeaderVerificationData,
+      GoodsReceiptHeaderData completedGoodsReceiptHeaderVerificationData2) {
+    this.purchaseOrderHeaderData = purchaseOrderHeaderData;
+    this.purchaseOrderHeaderVerficationData = purchaseOrderHeaderVerficationData;
+    this.purchaseOrderLinesData = purchaseOrderLinesData;
+    this.purchaseOrderLinesVerificationData = purchaseOrderLinesVerificationData;
+    this.purchaseOrderLinesData2 = purchaseOrderLinesData2;
+    this.purchaseOrderLinesVerificationData2 = purchaseOrderLinesVerificationData2;
+    this.bookedPurchaseOrderHeaderVerificationData = bookedPurchaseOrderHeaderVerificationData;
+    this.goodsReceiptHeaderData = goodsReceiptHeaderData;
+    this.goodsReceiptHeaderVerificationData = goodsReceiptHeaderVerificationData;
+    this.goodsReceiptLineVerificationData = goodsReceiptLineVerificationData;
+    this.goodsReceiptLineVerificationData2 = goodsReceiptLineVerificationData2;
+    this.completedGoodsReceiptHeaderVerificationData = completedGoodsReceiptHeaderVerificationData;
+    this.completedGoodsReceiptHeaderVerificationData2 = completedGoodsReceiptHeaderVerificationData2;
+    logInData = new LogInData.Builder().userName("QAAdmin").password("QAAdmin").build();
+  }
+
+  /**
+   * Test parameters.
+   * 
+   * @return collection of object arrays with data for the test
+   * 
+   */
+  @Parameters
+  public static Collection<Object[]> purchaseOrderValues() {
+    Object[][] data = new Object[][] { {
+        new PurchaseOrderHeaderData.Builder().transactionDocument("Purchase Order")
+            .businessPartner(new BusinessPartnerSelectorData.Builder().name("Vendor A").build())
+            .build(),
+        new PurchaseOrderHeaderData.Builder().organization("Spain")
+            .partnerAddress(".Pamplona, Street Purchase center nº1").warehouse("Spain warehouse")
+            .priceList("Purchase").paymentMethod("1 (Spain)").paymentTerms("90 days").build(),
+        new PurchaseOrderLinesData.Builder()
+            .product(
+                new ProductSelectorData.Builder().searchKey("SVA").priceListVersion("Purchase")
+                    .build()).orderedQuantity("1").build(),
+        new PurchaseOrderLinesData.Builder().uOM("Day").unitPrice("2.00").listPrice("2.00")
+            .tax("VAT 10%").lineNetAmount("2.00").build(),
+        new PurchaseOrderLinesData.Builder()
+            .product(
+                new ProductSelectorData.Builder().searchKey("SVB").priceListVersion("Purchase")
+                    .build()).orderedQuantity("-1").build(),
+        new PurchaseOrderLinesData.Builder().uOM("Hour").unitPrice("2.00").listPrice("2.00")
+            .tax("VAT 10%").lineNetAmount("-2.00").build(),
+        new PurchaseOrderHeaderData.Builder().documentStatus("Booked").summedLineAmount("0.00")
+            .grandTotalAmount("0.00").currency("EUR").build(),
+
+        new GoodsReceiptHeaderData.Builder().businessPartner(
+            new BusinessPartnerSelectorData.Builder().name("Vendor A").build()).build(),
+        new GoodsReceiptHeaderData.Builder().documentType("MM Receipt")
+            .partnerAddress(".Pamplona, Street Purchase center nº1").warehouse("Spain warehouse")
+            .build(),
+        new GoodsReceiptLinesData.Builder().lineNo("10")
+            .product(new ProductCompleteSelectorData.Builder().name("Service A").build())
+            .movementQuantity("1").uOM("Day")
+            .storageBin(new LocatorSelectorData.Builder().alias("L01").build())
+            .organization("Spain").build(),
+        new GoodsReceiptLinesData.Builder().lineNo("20")
+            .product(new ProductCompleteSelectorData.Builder().name("Service B").build())
+            .movementQuantity("-1").uOM("Hour")
+            .storageBin(new LocatorSelectorData.Builder().alias("L01").build())
+            .organization("Spain").build(),
+        new GoodsReceiptHeaderData.Builder().documentStatus("Completed").build(),
+        new GoodsReceiptHeaderData.Builder().documentStatus("Voided").build() } };
+    return Arrays.asList(data);
+  }
+
+  /**
+   * Test regression 28226
+   * 
+   * @throws ParseException
+   */
+  @Test
+  public void PRORegression28226Test() throws ParseException {
+    logger.info("** Start of test case [PRORegression28226] Test regression 28226. **");
+
+    PurchaseOrder purchaseOrder = new PurchaseOrder(mainPage).open();
+    purchaseOrder.create(purchaseOrderHeaderData);
+    purchaseOrder.assertSaved();
+    purchaseOrder.assertData(purchaseOrderHeaderVerficationData);
+    PurchaseOrder.Lines purchaseOrderLines1 = purchaseOrder.new Lines(mainPage);
+    purchaseOrderLines1.create(purchaseOrderLinesData);
+    purchaseOrderLines1.assertSaved();
+    purchaseOrderLines1.assertData(purchaseOrderLinesVerificationData);
+    PurchaseOrder.Lines purchaseOrderLines2 = purchaseOrder.new Lines(mainPage);
+    purchaseOrderLines2.create(purchaseOrderLinesData2);
+    purchaseOrderLines2.assertSaved();
+    purchaseOrderLines2.assertData(purchaseOrderLinesVerificationData2);
+    purchaseOrder.book();
+    purchaseOrder.assertProcessCompletedSuccessfully2();
+    purchaseOrder.assertData(bookedPurchaseOrderHeaderVerificationData);
+    DataObject completedPurchaseOrderHeaderData = purchaseOrder.getData();
+
+    GoodsReceipt goodsReceipt = new GoodsReceipt(mainPage).open();
+    goodsReceipt.create(goodsReceiptHeaderData);
+    goodsReceipt.assertSaved();
+    goodsReceipt.assertData(goodsReceiptHeaderVerificationData);
+    String purchaseOrderIdentifier = String.format("%s - %s - %s",
+        completedPurchaseOrderHeaderData.getDataField("documentNo"),
+        completedPurchaseOrderHeaderData.getDataField("orderDate"),
+        bookedPurchaseOrderHeaderVerificationData.getDataField("grandTotalAmount"));
+    goodsReceipt.createLinesFrom("L01", purchaseOrderIdentifier);
+    goodsReceipt.assertProcessCompletedSuccessfully();
+
+    GoodsReceipt.Lines goodsReceiptLines = goodsReceipt.new Lines(mainPage);
+    goodsReceiptLines.assertCount(2);
+    goodsReceiptLines.selectWithoutFiltering(0);
+    goodsReceiptLines.assertData(goodsReceiptLineVerificationData);
+    goodsReceiptLines.closeForm();
+    goodsReceiptLines.selectWithoutFiltering(1);
+    goodsReceiptLines.assertData(goodsReceiptLineVerificationData2);
+    goodsReceipt.complete();
+    goodsReceipt.assertProcessCompletedSuccessfully2();
+    goodsReceipt.assertData(completedGoodsReceiptHeaderVerificationData);
+
+    goodsReceipt.close();
+    goodsReceipt.assertProcessCompletedSuccessfully2();
+    goodsReceipt.assertData(completedGoodsReceiptHeaderVerificationData2);
+
+    logger.info("** End of test case [PRORegression28226] Test regression 28226. **");
+  }
+}
\ No newline at end of file
--- a/src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRO_RegressionSuite.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/PRO_RegressionSuite.java	Thu Nov 19 11:15:01 2015 +0100
@@ -22,7 +22,7 @@
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses({ PRORegression29171.class, PRORegression28426.class })
+@Suite.SuiteClasses({ PRORegression29171.class, PRORegression28426.class, PRORegression28226.class })
 public class PRO_RegressionSuite {
   // No content is required, this is just the definition of a test suite.
 
--- a/src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/build.xml	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/procurement/testsuites/PRO_Regressions/build.xml	Thu Nov 19 11:15:01 2015 +0100
@@ -26,6 +26,7 @@
     <sequential>
       <antcall target="test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression29171" />
       <antcall target="test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression28426" />
+      <antcall target="test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression28226" />
      </sequential>
   </target>
         
@@ -46,5 +47,11 @@
       <param name="testclass" value="com.openbravo.test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression28426" />
     </antcall>
   </target>
+  
+  <target name="test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression28226">
+    <antcall target="test.integration">
+      <param name="testclass" value="com.openbravo.test.integration.erp.modules.functionalteam.procurement.testsuites.PRO_Regressions.PRORegression28226" />
+    </antcall>
+  </target>
 
 </project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SALRegression28226.java	Thu Nov 19 11:15:01 2015 +0100
@@ -0,0 +1,207 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo S.L.U. 
+ * All portions are Copyright (C) 2015 Openbravo S.L.U. 
+ * All Rights Reserved. 
+ * Contributor(s):
+ *  Leo Arias <leo.arias@openbravo.com>.
+ ************************************************************************
+ */
+
+package com.openbravo.test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions;
+
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import com.openbravo.test.integration.erp.data.DataObject;
+import com.openbravo.test.integration.erp.data.LogInData;
+import com.openbravo.test.integration.erp.data.sales.transactions.goodsshipment.GoodsShipmentHeaderData;
+import com.openbravo.test.integration.erp.data.sales.transactions.goodsshipment.GoodsShipmentLinesData;
+import com.openbravo.test.integration.erp.data.sales.transactions.salesorder.SalesOrderHeaderData;
+import com.openbravo.test.integration.erp.data.sales.transactions.salesorder.SalesOrderLinesData;
+import com.openbravo.test.integration.erp.data.selectors.BusinessPartnerSelectorData;
+import com.openbravo.test.integration.erp.data.selectors.ProductCompleteSelectorData;
+import com.openbravo.test.integration.erp.data.selectors.ProductSelectorData;
+import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest;
+import com.openbravo.test.integration.erp.testscripts.sales.transactions.GoodsShipment;
+import com.openbravo.test.integration.erp.testscripts.sales.transactions.SalesOrder;
+
+/**
+ * Test regression 28226
+ * 
+ * @author aferraz
+ */
+@RunWith(Parameterized.class)
+public class SALRegression28226 extends OpenbravoERPTest {
+
+  /** Log4j logger for this class. */
+  private static Logger logger = Logger.getLogger(SALRegression28226.class);
+
+  /* Data for this test. */
+
+  SalesOrderHeaderData salesOrderHeaderData;
+  SalesOrderHeaderData salesOrderHeaderVerficationData;
+  SalesOrderLinesData salesOrderLinesData;
+  SalesOrderLinesData salesOrderLinesVerificationData;
+  SalesOrderLinesData salesOrderLinesData2;
+  SalesOrderLinesData salesOrderLinesVerificationData2;
+  SalesOrderHeaderData bookedSalesOrderHeaderVerificationData;
+  GoodsShipmentHeaderData goodsShipmentHeaderData;
+  GoodsShipmentHeaderData goodsShipmentHeaderVerificationData;
+  GoodsShipmentLinesData goodsShipmentLineVerificationData;
+  GoodsShipmentLinesData goodsShipmentLineVerificationData2;
+  GoodsShipmentHeaderData completedGoodsShipmentHeaderVerificationData;
+  GoodsShipmentHeaderData completedGoodsShipmentHeaderVerificationData2;
+
+  /**
+   * Class constructor.
+   * 
+   */
+  public SALRegression28226(SalesOrderHeaderData salesOrderHeaderData,
+      SalesOrderHeaderData salesOrderHeaderVerficationData,
+      SalesOrderLinesData salesOrderLinesData, SalesOrderLinesData salesOrderLinesVerificationData,
+      SalesOrderLinesData salesOrderLinesData2,
+      SalesOrderLinesData salesOrderLinesVerificationData2,
+      SalesOrderHeaderData bookedSalesOrderHeaderVerificationData,
+      GoodsShipmentHeaderData goodsShipmentHeaderData,
+      GoodsShipmentHeaderData goodsShipmentHeaderVerificationData,
+      GoodsShipmentLinesData goodsShipmentLineVerificationData,
+      GoodsShipmentLinesData goodsShipmentLineVerificationData2,
+      GoodsShipmentHeaderData completedGoodsShipmentHeaderVerificationData,
+      GoodsShipmentHeaderData completedGoodsShipmentHeaderVerificationData2) {
+    this.salesOrderHeaderData = salesOrderHeaderData;
+    this.salesOrderHeaderVerficationData = salesOrderHeaderVerficationData;
+    this.salesOrderLinesData = salesOrderLinesData;
+    this.salesOrderLinesVerificationData = salesOrderLinesVerificationData;
+    this.salesOrderLinesData2 = salesOrderLinesData2;
+    this.salesOrderLinesVerificationData2 = salesOrderLinesVerificationData2;
+    this.bookedSalesOrderHeaderVerificationData = bookedSalesOrderHeaderVerificationData;
+    this.goodsShipmentHeaderData = goodsShipmentHeaderData;
+    this.goodsShipmentHeaderVerificationData = goodsShipmentHeaderVerificationData;
+    this.goodsShipmentLineVerificationData = goodsShipmentLineVerificationData;
+    this.goodsShipmentLineVerificationData2 = goodsShipmentLineVerificationData2;
+    this.completedGoodsShipmentHeaderVerificationData = completedGoodsShipmentHeaderVerificationData;
+    this.completedGoodsShipmentHeaderVerificationData2 = completedGoodsShipmentHeaderVerificationData2;
+    logInData = new LogInData.Builder().userName("QAAdmin").password("QAAdmin").build();
+  }
+
+  /**
+   * Test parameters.
+   * 
+   * @return collection of object arrays with data for the test
+   * 
+   */
+  @Parameters
+  public static Collection<Object[]> salesOrderValues() {
+    Object[][] data = new Object[][] { {
+        new SalesOrderHeaderData.Builder().transactionDocument("Standard Order")
+            .businessPartner(new BusinessPartnerSelectorData.Builder().name("Customer A").build())
+            .build(),
+        new SalesOrderHeaderData.Builder().organization("Spain")
+            .partnerAddress(".Pamplona, Street Customer center nº1")
+            .invoiceAddress(".Pamplona, Street Customer center nº1").warehouse("Spain warehouse")
+            .priceList("Customer A").paymentMethod("1 (Spain)").paymentTerms("30 days, 5")
+            .invoiceTerms("Customer Schedule After Delivery").build(),
+        new SalesOrderLinesData.Builder()
+            .product(
+                new ProductSelectorData.Builder().searchKey("DGA").priceListVersion("Sales")
+                    .build()).orderedQuantity("1").build(),
+        new SalesOrderLinesData.Builder().uOM("Bag").unitPrice("2.00").listPrice("2.00")
+            .tax("VAT 10%").lineNetAmount("2.00").build(),
+        new SalesOrderLinesData.Builder()
+            .product(
+                new ProductSelectorData.Builder().searchKey("DGB").priceListVersion("Sales")
+                    .build()).orderedQuantity("-1").build(),
+        new SalesOrderLinesData.Builder().uOM("Bag").unitPrice("2.00").listPrice("2.00")
+            .tax("VAT 10%").lineNetAmount("-2.00").build(),
+        new SalesOrderHeaderData.Builder().documentStatus("Booked").summedLineAmount("0.00")
+            .grandTotalAmount("0.00").currency("EUR").build(),
+
+        new GoodsShipmentHeaderData.Builder().businessPartner(
+            new BusinessPartnerSelectorData.Builder().name("Customer A").build()).build(),
+        new GoodsShipmentHeaderData.Builder().documentType("MM Shipment")
+            .partnerAddress(".Pamplona, Street Customer center nº1").warehouse("Spain warehouse")
+            .build(),
+        new GoodsShipmentLinesData.Builder().lineNo("10")
+            .product(new ProductCompleteSelectorData.Builder().name("Distribution good A").build())
+            .movementQuantity("1").uOM("Bag").storageBin("L01").organization("Spain").build(),
+        new GoodsShipmentLinesData.Builder().lineNo("20")
+            .product(new ProductCompleteSelectorData.Builder().name("Distribution good B").build())
+            .movementQuantity("-1").uOM("Bag").storageBin("L01").organization("Spain").build(),
+        new GoodsShipmentHeaderData.Builder().documentStatus("Completed").build(),
+        new GoodsShipmentHeaderData.Builder().documentStatus("Voided").build() } };
+    return Arrays.asList(data);
+  }
+
+  /**
+   * Test regression 28226
+   * 
+   * @throws ParseException
+   */
+  @Test
+  public void SALRegression28226Test() throws ParseException {
+    logger.info("** Start of test case [SALRegression28226] Test regression 28226. **");
+
+    SalesOrder salesOrder = new SalesOrder(mainPage).open();
+    salesOrder.create(salesOrderHeaderData);
+    salesOrder.assertSaved();
+    salesOrder.assertData(salesOrderHeaderVerficationData);
+    SalesOrder.Lines salesOrderLines1 = salesOrder.new Lines(mainPage);
+    salesOrderLines1.create(salesOrderLinesData);
+    salesOrderLines1.assertSaved();
+    salesOrderLines1.assertData(salesOrderLinesVerificationData);
+    SalesOrder.Lines salesOrderLines2 = salesOrder.new Lines(mainPage);
+    salesOrderLines2.create(salesOrderLinesData2);
+    salesOrderLines2.assertSaved();
+    salesOrderLines2.assertData(salesOrderLinesVerificationData2);
+    salesOrder.book();
+    salesOrder.assertProcessCompletedSuccessfully2();
+    salesOrder.assertData(bookedSalesOrderHeaderVerificationData);
+    DataObject completedSalesOrderHeaderData = salesOrder.getData();
+
+    GoodsShipment goodsShipment = new GoodsShipment(mainPage).open();
+    goodsShipment.create(goodsShipmentHeaderData);
+    goodsShipment.assertSaved();
+    goodsShipment.assertData(goodsShipmentHeaderVerificationData);
+    String salesOrderIdentifier = String.format("%s - %s - %s",
+        completedSalesOrderHeaderData.getDataField("documentNo"),
+        completedSalesOrderHeaderData.getDataField("orderDate"),
+        bookedSalesOrderHeaderVerificationData.getDataField("grandTotalAmount"));
+    goodsShipment.createLinesFrom("L01", salesOrderIdentifier);
+    goodsShipment.assertProcessCompletedSuccessfully();
+
+    GoodsShipment.Lines goodsShipmentLines = goodsShipment.new Lines(mainPage);
+    goodsShipmentLines.assertCount(2);
+    goodsShipmentLines.selectWithoutFiltering(0);
+    goodsShipmentLines.assertData(goodsShipmentLineVerificationData);
+    goodsShipmentLines.closeForm();
+    goodsShipmentLines.selectWithoutFiltering(1);
+    goodsShipmentLines.assertData(goodsShipmentLineVerificationData2);
+    goodsShipment.complete();
+    goodsShipment.assertProcessCompletedSuccessfully2();
+    goodsShipment.assertData(completedGoodsShipmentHeaderVerificationData);
+
+    goodsShipment.close();
+    goodsShipment.assertProcessCompletedSuccessfully2();
+    goodsShipment.assertData(completedGoodsShipmentHeaderVerificationData2);
+
+    logger.info("** End of test case [SALRegression28226] Test regression 28226. **");
+  }
+}
\ No newline at end of file
--- a/src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SAL_RegressionSuite.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/SAL_RegressionSuite.java	Thu Nov 19 11:15:01 2015 +0100
@@ -22,7 +22,7 @@
 import org.junit.runners.Suite;
 
 @RunWith(Suite.class)
-@Suite.SuiteClasses({ SALRegression29171.class, SALRegression28426.class })
+@Suite.SuiteClasses({ SALRegression29171.class, SALRegression28426.class, SALRegression28226.class })
 public class SAL_RegressionSuite {
   // No content is required, this is just the definition of a test suite.
 
--- a/src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/build.xml	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/modules/functionalteam/sales/testsuites/SAL_Regressions/build.xml	Thu Nov 19 11:15:01 2015 +0100
@@ -26,6 +26,7 @@
     <sequential>
       <antcall target="test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression29171" />
       <antcall target="test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression28426" />
+      <antcall target="test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression28226" />
      </sequential>
   </target>
         
@@ -46,5 +47,11 @@
       <param name="testclass" value="com.openbravo.test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression28426" />
     </antcall>
   </target>
+  
+  <target name="test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression28226">
+    <antcall target="test.integration">
+      <param name="testclass" value="com.openbravo.test.integration.erp.modules.functionalteam.sales.testsuites.SAL_Regressions.SALRegression28226" />
+    </antcall>
+  </target>
 
 </project>
\ No newline at end of file
--- a/src-test/com/openbravo/test/integration/erp/testscripts/SmokeTabScript.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/testscripts/SmokeTabScript.java	Thu Nov 19 11:15:01 2015 +0100
@@ -294,4 +294,9 @@
     tab.closeForm();
   }
 
+  public void selectWithoutFiltering(int row) {
+    T tab = selectTab();
+    tab.selectWithoutFiltering(row);
+  }
+
 }
--- a/src-test/com/openbravo/test/integration/erp/testscripts/procurement/transactions/GoodsReceipt.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/testscripts/procurement/transactions/GoodsReceipt.java	Thu Nov 19 11:15:01 2015 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2011-2012 Openbravo S.L.U.
+ * All portions are Copyright (C) 2011-2015 Openbravo S.L.U.
  * All Rights Reserved.
  * Contributor(s):
  *   Pablo Lujan <pablo.lujan@openbravo.com>,
@@ -92,6 +92,16 @@
   }
 
   /**
+   * Complete the order.
+   * 
+   */
+  public void close() {
+    logger.info(String.format("Voiding goods receipt."));
+    final GoodsReceiptHeaderTab tab = selectTab();
+    tab.close();
+  }
+
+  /**
    * Create lines from an order.
    * 
    * @param warehouseAlias
--- a/src-test/com/openbravo/test/integration/erp/testscripts/sales/transactions/GoodsShipment.java	Thu Nov 26 13:06:07 2015 +0100
+++ b/src-test/com/openbravo/test/integration/erp/testscripts/sales/transactions/GoodsShipment.java	Thu Nov 19 11:15:01 2015 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2011-2012 Openbravo S.L.U.
+ * All portions are Copyright (C) 2011-2015 Openbravo S.L.U.
  * All Rights Reserved.
  * Contributor(s):
  *   Leo Arias <leo.arias@openbravo.com>.
@@ -104,6 +104,16 @@
   }
 
   /**
+   * Complete the shipment.
+   * 
+   */
+  public void close() {
+    logger.info(String.format("Voiding the goods shipment."));
+    GoodsShipmentHeaderTab tab = selectTab();
+    tab.close();
+  }
+
+  /**
    * Executes and verifies actions on the Goods Shipment Lines tab.
    * 
    * @author elopio