Advertisement
art_qkc

DixonKioskTests

Mar 4th, 2025
132
0
6 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.45 KB | None | 0 0
  1. package com..tests;
  2.  
  3. import com..enums.Kiosk;
  4. import com..pages.noc.NocPage;
  5. import com..utils.RegressionTestRetryAnalyzer;
  6. import io.qameta.allure.Feature;
  7. import org.testng.annotations.BeforeMethod;
  8. import org.testng.annotations.Test;
  9.  
  10. import java.lang.reflect.Method;
  11.  
  12. import static com..pages.noc.view.JarsView.lock1;
  13. import static com..pages.noc.view.RobotView.robot;
  14. import static com..pages.noc.view.RobotView.robotMonitor1;
  15. import static com..pages.noc.view.SensorsView.*;
  16. import static com..pages.noc.view.VisionView.robotVision;
  17. import static com..pages.noc.view.VisionView.visionCheck1;
  18.  
  19. @Deprecated
  20. public class DixonKioskTests extends RegressionTests {
  21.     private NocPage nocPage;
  22.  
  23.     @BeforeMethod
  24.     public void beforeMethod(Method method) {
  25.         nocPage = new NocPage();
  26.         Kiosk kiosk = Kiosk.DIXON;
  27.         beforeMethod(kiosk);
  28.         enableSoftAssert(method);
  29.     }
  30.  
  31.     @Feature("Dixon kiosk")
  32.     @Test(description = "Kiosk SD", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  33.     public void testKioskSolidDispencers() {
  34.         nocPage.waitPage().assertPageOpened();
  35.         nocPage.validateAllSolidDispencersAreOn();
  36.         throwSoftAssert();
  37.     }
  38.  
  39.     @Feature("Dixon kiosk")
  40.     @Test(description = "Kiosk PD", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  41.     public void testKioskPowderDispencers() {
  42.         // Both the PDs are available and under devices of INGREDIENTS
  43.         nocPage.waitPage().assertPageOpened();
  44.         nocPage.validateAllPowderDispencersAreOn();
  45.  
  46.         // 1. PD1 has 3 ingredients
  47.         String[] ingredients = new String[] {"Daily Vitamin + Zinc", "Ginger", "3G Energy"};
  48.         nocPage.validatePowderDispencerIngredientsCount(1, ingredients, 3);
  49.  
  50.         // 2. PD2 has 2 ingredients
  51.         ingredients = new String[] {"(regular/dairy)", "Soy Protein"};
  52.         nocPage.validatePowderDispencerIngredientsCount(2, ingredients, 2);
  53.         throwSoftAssert();
  54.     }
  55.  
  56.     @Feature("Dixon kiosk")
  57.     @Test(description = "Kiosk LD", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  58.     public void testKioskLiquidDispencers() {
  59.         // LD1 is available and under devices of INGREDIENTS
  60.         nocPage.waitPage().assertPageOpened();
  61.         nocPage.validateAllLiquidDispencersAreOn();
  62.  
  63.         // 1. LD1 has 4 ingredients
  64.         String[] ingredients = new String[] {"Oat Milk", "Mixed berry juice", "Coconut Water, Lemonade", "Passion Mango"};
  65.         nocPage.validateLiquidDispencerIngredientsCount(1, ingredients, 4);
  66.         throwSoftAssert();
  67.     }
  68.  
  69.     @Feature("Dixon kiosk")
  70.     @Test(description = "Kiosk blenders are ON", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  71.     public void testKioskBledners() {
  72.         // 3 Blenders are available under devices and in ACTIVE state
  73.         nocPage.waitPage().assertPageOpened();
  74.         nocPage.validateAllBlendersAreOn();
  75.         throwSoftAssert();
  76.     }
  77.  
  78.     @Feature("Dixon kiosk")
  79.     @Test(description = "Kiosk delivery systems", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  80.     public void testKioskDeliverySystem() {
  81.         // 2 Delivery Systems (DS1 and DS2) and 2 Pour Stations (PS1 and PS2) are available under DEVICES and all 4 are ACTIVE
  82.         nocPage.waitPage().assertPageOpened();
  83.         nocPage.validateAllDeliverySystemsAreOn();
  84.         nocPage.validateAllPourStationsAreOn();
  85.         throwSoftAssert();
  86.     }
  87.  
  88.     @Feature("Dixon kiosk")
  89.     @Test(description = "Kiosk Jars", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  90.     public void testKioskJars() {
  91.         // 8 Jars are available under DEVICES and all of them are ACTIVE
  92.         nocPage.waitPage().assertPageOpened();
  93.         nocPage.validateAllJarsAreOn();
  94.  
  95.         // Jar9 is off
  96.         nocPage.validateJarWithNumberIsOff(9);
  97.         throwSoftAssert();
  98.     }
  99.  
  100.     @Feature("Dixon kiosk")
  101.     @Test(description = "Kiosk Vision", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  102.     public void testKioskVision() {
  103.         // Vision Check1 and Robot Vision are available under DEVICES and both are ACTIVE
  104.         nocPage.waitPage().assertPageOpened();
  105.         nocPage.validateVisionIsOn(robotVision);
  106.         nocPage.validateVisionIsOn(visionCheck1);
  107.         throwSoftAssert();
  108.     }
  109.  
  110.     @Feature("Dixon kiosk")
  111.     @Test(description = "Kiosk Lock", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  112.     public void testKioskLock() {
  113.         // Lock1 is available under DEVICES and in ACTIVE state
  114.         nocPage.waitPage().assertPageOpened();
  115.         nocPage.validateLockIsOn(lock1);
  116.         throwSoftAssert();
  117.     }
  118.  
  119.     @Feature("Dixon kiosk")
  120.     @Test(description = "Kiosk Robot", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  121.     public void testKioskRobot() {
  122.         // Both Robot and Robot Monitor1 are available under DEVICES and both are ACTIVE
  123.         nocPage.waitPage().assertPageOpened();
  124.         nocPage.validateRobotIsOn(robot);
  125.         nocPage.validateRobotIsOn(robotMonitor1);
  126.         throwSoftAssert();
  127.     }
  128.  
  129.     @Feature("Dixon kiosk")
  130.     @Test(description = "Kiosk Sensor", retryAnalyzer = RegressionTestRetryAnalyzer.class)
  131.     public void testKioskSensor() {
  132.         // Both Robot and Robot Monitor1 are available under DEVICES and both are ACTIVE
  133.         nocPage.waitPage().assertPageOpened();
  134.         nocPage.validateSensorIsOn(freezer1);
  135.         nocPage.validateSensorIsOn(freezer2);
  136.         nocPage.validateSensorIsOn(refrigerator1);
  137.         throwSoftAssert();
  138.     }
  139. }
  140.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement