Merging SCO Extensions
authorAdrián Romero <adrianromero@openbravo.com>
Wed, 30 Jan 2019 10:09:14 +0100
changeset 8276 310562006e7c
parent 8125 ae12ce12dd11 (current diff)
parent 8275 a48bcb4030dc (diff)
child 8277 eb1d4575ed7b
Merging SCO Extensions
src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOTerminalHelper.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOAutoRestartTimeOutWithContinue.java	Wed Jan 30 10:09:14 2019 +0100
@@ -0,0 +1,84 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ */
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckout;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.core.utils.OBUtils;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SCOAutoRestartTimeOutWithContinue extends SCOTerminalHelper {
+  private static final Long AUTO_RESTART_TIMEOUT_30 = 30L;
+  private static final Boolean ENABLE_CONTINUE_TIMEOUT = Boolean.TRUE;
+  private static final Long CONTINUE_TIMEOUT_15 = 15L;
+  private Long autoRestartTimeOut;
+  private Boolean enableContinueTimeOut;
+  private Long continueTimeOut;
+
+  @Override
+  public void beforeWithReload() {
+    // Read configured auto restart timeout and set to 30s
+    autoRestartTimeOut = getAutoRestartTimeOut();
+    setAutoRestartTimeOut(AUTO_RESTART_TIMEOUT_30);
+
+    // Read configured continue time out and set to 15s
+    enableContinueTimeOut = getEnableContinueTimeOut();
+    setEnableContinueTimeOut(ENABLE_CONTINUE_TIMEOUT);
+    continueTimeOut = getContinueTimeOut();
+    setContinueTimeOut(CONTINUE_TIMEOUT_15);
+  }
+
+  @Override
+  public void afterWithReload() {
+    // Restore auto restart timeout value
+    setAutoRestartTimeOut(autoRestartTimeOut);
+
+    // Restore continue timeout values
+    setEnableContinueTimeOut(enableContinueTimeOut);
+    setContinueTimeOut(continueTimeOut);
+  }
+
+  @Test
+  public void doAutoRestartTimeOutWithContinue() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Wait for Continue timeout
+    OBUtils.pause(CONTINUE_TIMEOUT_15 * 1000);
+
+    // Verify Continue screen is displayed
+    assertStepName(TestSteps.CONTINUE);
+
+    // Wait for restart time out
+    OBUtils.pause(AUTO_RESTART_TIMEOUT_30 * 1000);
+
+    // Verify Start Welcome Screen is displayed.
+    assertStepName(TestSteps.STARTWELCOME);
+
+    // Ensure that every models are sync
+    SeleniumHelper.executeScript("OB.MobileApp.model.runSyncProcess();");
+    OBUtils.pause(5000);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOAutoRestartTimeOutWithHome.java	Wed Jan 30 10:09:14 2019 +0100
@@ -0,0 +1,138 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ */
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckout;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.core.utils.OBUtils;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SCOAutoRestartTimeOutWithHome extends SCOTerminalHelper {
+  private static final Long AUTO_RESTART_TIMEOUT_15 = 15L;
+  private Long autoRestartTimeOut;
+
+  @Override
+  public void beforeWithReload() {
+    // Read configured auto restart timeout and set to 30s
+    autoRestartTimeOut = getAutoRestartTimeOut();
+    setAutoRestartTimeOut(AUTO_RESTART_TIMEOUT_15);
+  }
+
+  @Override
+  public void afterWithReload() {
+    // Restore auto restart timeout value
+    setAutoRestartTimeOut(autoRestartTimeOut);
+  }
+
+  @Test
+  public void doAutoRestartTimeOutWithHome() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Click on HOME toolbar button
+    tap(TestIDSCO.TOOLBAR_HOME);
+
+    // Verify Continue screen is displayed
+    assertStepName(TestSteps.CONTINUE);
+
+    // Wait for restart time out
+    OBUtils.pause(AUTO_RESTART_TIMEOUT_15 * 1000);
+
+    // Verify Start Welcome Screen is displayed.
+    assertStepName(TestSteps.STARTWELCOME);
+
+  }
+
+  @Test
+  public void doAutoRestartTimeOutWithHomeAndLines() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Buy bags
+    tap(TestIDSCO.BUYBAGS_YES);
+
+    // Small bag x 1
+    tap(TestIDSCO.BUYBAGSSELECTION_SMALL_BAG);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    tap(TestIDSCO.BUYBAGSSELECTION_CONTINUE);
+
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    // Click on HOME toolbar button
+    tap(TestIDSCO.TOOLBAR_HOME);
+
+    // Verify Continue screen is displayed
+    assertStepName(TestSteps.CONTINUE);
+
+    tap(TestIDSCO.CONTINUE_YES);
+
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    // Click FINISH AND PAY button
+    tap(TestIDSCO.SCAN_FINISHANDPAY);
+
+    assertStepName(TestSteps.CONFIRMBASKET);
+
+    // Verify 4 products and total price of 293.80€ in Confirmation window
+    verify(TestIDSCO.CONFIRM_TOPMSG, "You have *1 product(s)* in the receipt  \nTOTAL: *1.00€*");
+
+    // Go to Select Payment Methods window
+    tap(TestIDSCO.CONFIRM_CONTINUE);
+
+    assertStepName(TestSteps.SELECTPAYMENT);
+
+    // Select Credit Card Print Ask as Payment Method
+    tap(TestIDSCO.SELECTPAYMENT_PAYMENT_0);
+
+    assertStepName(TestSteps.MOCKPAYMENT);
+
+    // Click PAY: Receipt Print Ask window is displayed
+    tap(TestIDSCO.MOCKPAYMENT_PAY);
+
+    assertStepName(TestSteps.RECEIPTPRINT);
+
+    // Click YES on Print Receipt window
+    tap(TestIDSCO.PRINTRECEIPT_BUTTONYES);
+
+    assertStepName(TestSteps.THANKYOU);
+
+    // Click NEW TRANSACTION
+    tap(TestIDSCO.THANKYOU_NEWTRANSACTION);
+
+    // Verify Start Welcome Screen is displayed.
+    assertStepName(TestSteps.STARTWELCOME);
+
+    // Ensure that every models are sync
+    SeleniumHelper.executeScript("OB.MobileApp.model.runSyncProcess();");
+    OBUtils.pause(5000);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCODeleteLineWithoutApproval.java	Wed Jan 30 10:09:14 2019 +0100
@@ -0,0 +1,160 @@
+/*
+ *************************************************************************
+ * 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) 2018-2019 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ */
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckout;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.core.utils.OBUtils;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SCODeleteLineWithoutApproval extends SCOTerminalHelper {
+  private static final Long AUTO_RESTART_TIMEOUT_15 = 15L;
+  private static final Boolean YES = Boolean.TRUE;
+  private static final Long CONTINUE_TIMEOUT_15 = 15L;
+  private Long autoRestartTimeOut;
+  private Boolean enableContinueTimeOut;
+  private Long continueTimeOut;
+  private Boolean deleteLineApproval;
+
+  @Override
+  public void beforeWithReload() {
+    // Read configured auto restart timeout and set to 30s
+    autoRestartTimeOut = getAutoRestartTimeOut();
+    setAutoRestartTimeOut(AUTO_RESTART_TIMEOUT_15);
+
+    // Read configured continue time out and set to 15s
+    enableContinueTimeOut = getEnableContinueTimeOut();
+    setEnableContinueTimeOut(YES);
+    continueTimeOut = getContinueTimeOut();
+    setContinueTimeOut(CONTINUE_TIMEOUT_15);
+
+    // Read Delete Line Approval preference
+    deleteLineApproval = getDeleteLineApprovalPreference();
+    setDeleteLineApprovalPreference(YES);
+  }
+
+  @Override
+  public void afterWithReload() {
+    // Restore auto restart timeout value
+    setAutoRestartTimeOut(autoRestartTimeOut);
+
+    // Restore continue timeout values
+    setEnableContinueTimeOut(enableContinueTimeOut);
+    setContinueTimeOut(continueTimeOut);
+
+    // Restore Delete Line Approval preference
+    setDeleteLineApprovalPreference(deleteLineApproval);
+  }
+
+  @Test
+  public void doDeleteLineWithoutApproval() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Buy bags
+    tap(TestIDSCO.BUYBAGS_YES);
+
+    assertStepName(TestSteps.BUYBAGSSELECTION);
+
+    // Small bag x 1
+    tap(TestIDSCO.BUYBAGSSELECTION_SMALL_BAG);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    tap(TestIDSCO.BUYBAGSSELECTION_CONTINUE);
+
+    // Verify that Scan Product screen is displayed
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    // Click on Trash Icon in Small Bag line.
+    // Verify that "Confirm Delete Line" screen is displayed.
+    deleteLine();
+    // Click on Cancel.
+    tap(TestIDSCO.CONFIRM_DELETELINE_CANCELBUTTON);
+
+    // Verify that Scan Product screen is displayed and no line is deleted.
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    // Click on Trash Icon in Small Bag line.
+    // Verify that "Confirm Delete Line" screen is displayed.
+    deleteLine();
+
+    // Wait for Continue timeout
+    OBUtils.pause(CONTINUE_TIMEOUT_15 * 1000);
+
+    // Verify Continue screen is displayed
+    assertStepName(TestSteps.CONTINUE);
+
+    // Click yes on Continue screen
+    tap(TestIDSCO.CONTINUE_YES);
+
+    // Verify that Scan Product screen is displayed and no line is deleted.
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    // Click on Trash Icon in Small Bag line.
+    // Verify that "Confirm Delete Line" screen is displayed.
+    deleteLine();
+    // Click on Yes button to remove the line
+    tap(TestIDSCO.CONFIRM_DELETELINE_YESBUTTON);
+
+    // Verify that Scan Product screen is displayed and the line is deleted.
+    assertStepName(TestSteps.SCANPRODUCT);
+
+    // Verify line is deleted
+    verify(TestIDSCO.RECEIPT_QUANTITY, "0 items");
+    verify(TestIDSCO.RECEIPT_TOTAL, "0.00€");
+    isVisible(TestIDSCO.RECEIPT_EMPTY, true);
+
+    // Click on HOME toolbar button
+    tap(TestIDSCO.TOOLBAR_HOME);
+
+    // Verify Continue screen is displayed
+    assertStepName(TestSteps.CONTINUE);
+
+    tap(TestIDSCO.CONTINUE_NO);
+
+    // Verify Start Welcome Screen is displayed.
+    assertStepName(TestSteps.STARTWELCOME);
+
+    // Ensure that every models are sync
+    SeleniumHelper.executeScript("OB.MobileApp.model.runSyncProcess();");
+    OBUtils.pause(5000);
+  }
+
+  private void deleteLine() {
+    tap(TestIDSCO.RECEIPT_LINEDELETEBUTTON_0);
+    assertStepName(TestSteps.CONFIRMDELETELINE);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOPrintTimeOutGreaterThanZero.java	Wed Jan 30 10:09:14 2019 +0100
@@ -0,0 +1,106 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ */
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckout;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openbravo.test.mobile.core.utils.OBUtils;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SCOPrintTimeOutGreaterThanZero extends SCOTerminalHelper {
+  private static final Long PRINT_TIMEOUT_30 = 30L;
+  private Long printTimeOut;
+
+  @Before
+  @Override
+  public void before() {
+    super.before();
+    // Read configured print timeout and set to 30s
+    printTimeOut = getPrintTimeOut();
+    setPrintTimeOut(PRINT_TIMEOUT_30);
+    reload();
+  }
+
+  @After
+  @Override
+  public void after() {
+    // Restore print timeout value
+    setPrintTimeOut(printTimeOut);
+    reload();
+    super.after();
+  }
+
+  @Test
+  public void doPrintTimeOutGreaterThanZero() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Buy bags
+    tap(TestIDSCO.BUYBAGS_YES);
+
+    // Small bag x 1
+    tap(TestIDSCO.BUYBAGSSELECTION_SMALL_BAG);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    tap(TestIDSCO.BUYBAGSSELECTION_CONTINUE);
+
+    // Check FINISH AND PAY button enabled
+    isDisabled(TestIDSCO.SCAN_FINISHANDPAY, false);
+
+    // Click FINISH AND PAY button
+    tap(TestIDSCO.SCAN_FINISHANDPAY);
+
+    assertStepName(TestSteps.CONFIRMBASKET);
+
+    // Verify 4 products and total price of 293.80€ in Confirmation window
+    verify(TestIDSCO.CONFIRM_TOPMSG, "You have *1 product(s)* in the receipt  \nTOTAL: *1.00€*");
+
+    // Go to Select Payment Methods window
+    tap(TestIDSCO.CONFIRM_CONTINUE);
+
+    assertStepName(TestSteps.SELECTPAYMENT);
+
+    // Select Credit Card Print Ask as Payment Method
+    tap(TestIDSCO.SELECTPAYMENT_PAYMENT_0);
+
+    assertStepName(TestSteps.MOCKPAYMENT);
+
+    // Click PAY: Receipt Print Ask window is displayed
+    tap(TestIDSCO.MOCKPAYMENT_PAY);
+
+    // Verify Print Screen is displayed.
+    assertStepName(TestSteps.RECEIPTPRINT);
+
+    OBUtils.pause(PRINT_TIMEOUT_30 * 1000);
+
+    // Verify Start Welcome Screen is displayed.
+    assertStepName(TestSteps.STARTWELCOME);
+
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOShoppingBagsToolbar.java	Wed Jan 30 10:09:14 2019 +0100
@@ -0,0 +1,98 @@
+/*
+ *************************************************************************
+ * 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) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ */
+package org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckout;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
+import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SCOShoppingBagsToolbar extends SCOTerminalHelper {
+
+  @Test
+  public void doShoppingBagsToolbar() {
+
+    // Click on START and see Buy Bags window since AskForBags = Y
+    tap(TestIDSCO.WELCOME_START);
+
+    assertStepName(TestSteps.BUYBAGS);
+
+    // Shopping bags button must be hidden
+    isVisible(TestIDSCO.TOOLBAR_ADDBAGS, false);
+
+    // Buy bags
+    tap(TestIDSCO.BUYBAGS_NO);
+
+    // Click on Shopping bags button
+    tap(TestIDSCO.TOOLBAR_ADDBAGS);
+
+    assertStepName(TestSteps.BUYBAGSSELECTION);
+
+    // Shopping bags button must be hidden
+    isVisible(TestIDSCO.TOOLBAR_ADDBAGS, false);
+
+    // Small bag x 1
+    tap(TestIDSCO.BUYBAGSSELECTION_SMALL_BAG);
+
+    verify(TestIDSCO.RECEIPT_QUANTITY, "1 items");
+
+    verify(TestIDSCO.RECEIPT_TOTAL, "1.00€");
+
+    tap(TestIDSCO.BUYBAGSSELECTION_CONTINUE);
+
+    // Shopping bags button is displayed
+    isVisible(TestIDSCO.TOOLBAR_ADDBAGS, true);
+
+    // Check FINISH AND PAY button enabled
+    isDisabled(TestIDSCO.SCAN_FINISHANDPAY, false);
+
+    // Click FINISH AND PAY button
+    tap(TestIDSCO.SCAN_FINISHANDPAY);
+
+    assertStepName(TestSteps.CONFIRMBASKET);
+
+    // Verify 1 product and total price of 1.00€ in Confirmation window
+    verify(TestIDSCO.CONFIRM_TOPMSG, "You have *1 product(s)* in the receipt  \nTOTAL: *1.00€*");
+
+    // Go to Select Payment Methods window
+    tap(TestIDSCO.CONFIRM_CONTINUE);
+
+    assertStepName(TestSteps.SELECTPAYMENT);
+
+    // Select Credit Card Print Ask as Payment Method
+    tap(TestIDSCO.SELECTPAYMENT_PAYMENT_0);
+
+    assertStepName(TestSteps.MOCKPAYMENT);
+
+    // Click PAY: Receipt Print Ask window is displayed
+    tap(TestIDSCO.MOCKPAYMENT_PAY);
+
+    assertStepName(TestSteps.RECEIPTPRINT);
+
+    // Click YES on Print Receipt window
+    tap(TestIDSCO.PRINTRECEIPT_BUTTONYES);
+
+    assertStepName(TestSteps.THANKYOU);
+
+    // Click NEW TRANSACTION
+    tap(TestIDSCO.THANKYOU_NEWTRANSACTION);
+
+  }
+}
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOTerminalHelper.java	Wed Jan 30 06:51:03 2019 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckout/SCOTerminalHelper.java	Wed Jan 30 10:09:14 2019 +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) 2017-2018 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
  * All Rights Reserved.
  * Contributor(s):
  ************************************************************************
@@ -25,6 +25,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.apache.commons.codec.binary.StringUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.openbravo.test.mobile.core.selenium.SeleniumHelper;
@@ -33,6 +34,7 @@
 import org.openbravo.test.mobile.retail.extmodules.selenium.terminals.WebPOSExtModulesTerminalHelper;
 import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestIDSCO;
 import org.openbravo.test.mobile.retail.extmodules.selenium.tests.selfcheckoututils.TestSteps;
+import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperInsertUpdateOrDelete;
 import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperSelect;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.SynchronizationMonitor;
 import org.openbravo.test.mobile.retail.mobilecore.javascript.TestRegistryHelper;
@@ -41,6 +43,14 @@
 
 public class SCOTerminalHelper extends WebPOSExtModulesTerminalHelper {
 
+  private static final String SCO_CONFIGURATION_ID = "FDE1CBB3568042B7952EC0F49E37565A";
+  private static final String SCO_DELETE_LINE_APPROVAL_PREFERENCE_ID = "01E17C12856B4D64B547050A11F1B23E";
+  private Long printTimeOut;
+  private Long autoRestartTimeOut;
+  private Boolean enableContinueTimeOut;
+  private Long continueTimeOut;
+  private Boolean deleteLineApproval;
+
   public SCOTerminalHelper() {
     super("SCO-1", "vallblanca", "openbravo", false);
   }
@@ -73,7 +83,13 @@
   public void goPOS() {
     tap(TestIDSCO.HEADER_COMPANYLOGO);
     tap(TestIDSCO.HEADER_COMPANYLOGO); // Double click
-    verifyAndProcessApproval("Openbravo", "openbravo");
+
+    assertStepName(TestSteps.LOGINPOS);
+
+    write(TestIDSCO.USERNAME_INPUT, "Openbravo");
+    write(TestIDSCO.PASSWORD_INPUT, "openbravo");
+    tap(TestIDSCO.LOGINPOS_OK);
+
     SynchronizationMonitor.waitUntiTheApplicationHasSynchronized();
   }
 
@@ -208,4 +224,124 @@
       }
     }.execute(sql, 1);
   }
+
+  protected void setPrintTimeOut(Long timeOut) {
+    new DatabaseHelperInsertUpdateOrDelete().execute(String.format(
+        "update obsco_configuration set printtimeout = %s where obsco_configuration_id = '%s'",
+        timeOut, SCO_CONFIGURATION_ID), 1);
+  }
+
+  protected Long getPrintTimeOut() {
+    final String select = String.format(
+        "select printtimeout from obsco_configuration " + "WHERE obsco_configuration_id = '%s'",
+        SCO_CONFIGURATION_ID);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        printTimeOut = rs.getLong("printtimeout");
+        if (rs.wasNull()) {
+          printTimeOut = null;
+        }
+      }
+    }.execute(select, 1);
+
+    return printTimeOut;
+  }
+
+  protected void setAutoRestartTimeOut(Long timeOut) {
+    new DatabaseHelperInsertUpdateOrDelete().execute(String.format(
+        "update obsco_configuration set autorestarttimeout = %s where obsco_configuration_id = '%s'",
+        timeOut, SCO_CONFIGURATION_ID), 1);
+  }
+
+  protected Long getAutoRestartTimeOut() {
+    final String select = String.format("select autorestarttimeout from obsco_configuration "
+        + "WHERE obsco_configuration_id = '%s'", SCO_CONFIGURATION_ID);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        autoRestartTimeOut = rs.getLong("autorestarttimeout");
+        if (rs.wasNull()) {
+          autoRestartTimeOut = null;
+        }
+      }
+    }.execute(select, 1);
+
+    return autoRestartTimeOut;
+  }
+
+  protected void setEnableContinueTimeOut(Boolean isEnable) {
+    String yesOrNo = isEnable ? "Y" : "N";
+    new DatabaseHelperInsertUpdateOrDelete().execute(String.format(
+        "update obsco_configuration set enablecontinuetimeout = '%s' where obsco_configuration_id = '%s'",
+        yesOrNo, SCO_CONFIGURATION_ID), 1);
+  }
+
+  protected Boolean getEnableContinueTimeOut() {
+    final String select = String.format("select enablecontinuetimeout from obsco_configuration "
+        + "WHERE obsco_configuration_id = '%s'", SCO_CONFIGURATION_ID);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        String yesOrNo = rs.getString("enablecontinuetimeout");
+        if (rs.wasNull()) {
+          enableContinueTimeOut = null;
+        } else {
+          enableContinueTimeOut = StringUtils.equals(yesOrNo, "Y") ? Boolean.TRUE : Boolean.FALSE;
+        }
+      }
+    }.execute(select, 1);
+
+    return enableContinueTimeOut;
+  }
+
+  protected void setContinueTimeOut(Long timeOut) {
+    new DatabaseHelperInsertUpdateOrDelete().execute(String.format(
+        "update obsco_configuration set continuetimeout = %s where obsco_configuration_id = '%s'",
+        timeOut, SCO_CONFIGURATION_ID), 1);
+  }
+
+  protected Long getContinueTimeOut() {
+    final String select = String.format(
+        "select continuetimeout from obsco_configuration " + "WHERE obsco_configuration_id = '%s'",
+        SCO_CONFIGURATION_ID);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        continueTimeOut = rs.getLong("continuetimeout");
+        if (rs.wasNull()) {
+          continueTimeOut = null;
+        }
+      }
+    }.execute(select, 1);
+
+    return continueTimeOut;
+  }
+
+  protected void setDeleteLineApprovalPreference(Boolean isEnable) {
+    String yesOrNo = isEnable ? "Y" : "N";
+    new DatabaseHelperInsertUpdateOrDelete().execute(
+        String.format("update ad_preference set value = '%s' where ad_preference_id = '%s'",
+            yesOrNo, SCO_DELETE_LINE_APPROVAL_PREFERENCE_ID),
+        1);
+  }
+
+  protected Boolean getDeleteLineApprovalPreference() {
+    final String select = String.format(
+        "select value from ad_preference " + "WHERE ad_preference_id = '%s'",
+        SCO_DELETE_LINE_APPROVAL_PREFERENCE_ID);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        String yesOrNo = rs.getString("value");
+        if (rs.wasNull()) {
+          deleteLineApproval = null;
+        } else {
+          deleteLineApproval = StringUtils.equals(yesOrNo, "Y") ? Boolean.TRUE : Boolean.FALSE;
+        }
+      }
+    }.execute(select, 1);
+
+    return deleteLineApproval;
+  }
 }
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckoututils/TestIDSCO.java	Wed Jan 30 06:51:03 2019 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckoututils/TestIDSCO.java	Wed Jan 30 10:09:14 2019 +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) 2017-2018 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
  * All Rights Reserved.
  * Contributor(s):
  ************************************************************************
@@ -43,6 +43,10 @@
       "zh_CN", EnyoKind.BUTTON); //
   public final static TestIdConstructor TOOLBAR_LANG_ES_ES = new TestIdConstructor( //
       "es_ES", EnyoKind.BUTTON); //
+  public final static TestIdConstructor TOOLBAR_HOME = new TestIdConstructor( //
+      "toolbar_home", EnyoKind.BUTTON); //
+  public final static TestIdConstructor TOOLBAR_ADDBAGS = new TestIdConstructor( //
+      "toolbar_addBags", EnyoKind.BUTTON); //
 
   // Welcome Panel
 
@@ -161,6 +165,12 @@
   public final static TestIdConstructor DELETELINE_CANCELBUTTON = new TestIdConstructor( //
       "DeleteLinePanel_cancel", EnyoKind.BUTTON); //
 
+  // Confirm Delete line panel
+  public final static TestIdConstructor CONFIRM_DELETELINE_CANCELBUTTON = new TestIdConstructor( //
+      "ConfirmDeleteLinePanel_confirmDeleteLineCancel", EnyoKind.BUTTON); //
+  public final static TestIdConstructor CONFIRM_DELETELINE_YESBUTTON = new TestIdConstructor( //
+      "ConfirmDeleteLinePanel_confirmDeleteLineYes", EnyoKind.BUTTON); //
+
   // Confirm basket paneL
 
   public final static TestIdConstructor CONFIRM_TOPMSG = new TestIdConstructor( //
@@ -208,4 +218,17 @@
   public final static TestIdConstructor SHOW_LOADING_TEXT = new TestIdConstructor( //
       "LoadingAnimation_loadingLabel"); //
 
+  // Continue Panel
+  public final static TestIdConstructor CONTINUE_YES = new TestIdConstructor( //
+      "ContinuePanel_continueContinue", EnyoKind.BUTTON); //
+  public final static TestIdConstructor CONTINUE_NO = new TestIdConstructor( //
+      "ContinuePanel_continueRestart", EnyoKind.BUTTON); //
+
+  // LoginPOS Panel
+  public final static TestIdConstructor USERNAME_INPUT = new TestIdConstructor( //
+      "username_input"); //
+  public final static TestIdConstructor PASSWORD_INPUT = new TestIdConstructor( //
+      "password_input");
+  public final static TestIdConstructor LOGINPOS_OK = new TestIdConstructor( //
+      "LoginPOSPanel_ok", EnyoKind.BUTTON); //
 }
--- a/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckoututils/TestSteps.java	Wed Jan 30 06:51:03 2019 +0100
+++ b/src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/selfcheckoututils/TestSteps.java	Wed Jan 30 10:09:14 2019 +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) 2017 Openbravo S.L.U.
+ * All portions are Copyright (C) 2017-2019 Openbravo S.L.U.
  * All Rights Reserved.
  * Contributor(s):
  ************************************************************************
@@ -22,6 +22,8 @@
 
   public final static String INIT = "_INIT_";
 
+  public final static String LOGINPOS = "LoginPOS";
+
   public final static String STARTWELCOME = "StartWelcome";
 
   public final static String BUYBAGS = "BuyBags";
@@ -58,4 +60,8 @@
 
   public final static String VERIFYPRODUCT = "VerifyProduct";
 
+  public final static String CONTINUE = "Continue";
+
+  public final static String CONFIRMDELETELINE = "ConfirmDeleteLine";
+
 }