Beispiel #1
0
 public Friend(String name, String email, int id, boolean haveAcceptedRequest, String asker) {
   this.name = name;
   this.email = email;
   this.id = id;
   this.haveAcceptedRequest = haveAcceptedRequest;
   this.asker = asker;
   for (ShoppingList l : ShoppingList.hmShared.values()) {
     if (l._owner == null && l.getItems().get(0)._owner_id == id) {
       l._owner = name;
     }
   }
   Friend.allFriends.add(this);
 }
  @Test
  public void AddMultiEventsDifferentStoreToCartTest()
      throws InterruptedException, BiffException, IOException {
    logger = report.startTest("Add multiple events from Different store to cart");

    // ** By Passing Age Gate and Welcome Modal
    SiteAccess.ActionAccessSite(driver, IP);

    // **Sign in modal with credential which has pre-existing order history, shopping list etc.
    Events.CustomLogin(driver);

    // **Checking for presence of merge cart modal
    ShoppingList.MergeCartModal(driver);

    // **  Selecting events from PDP
    driver.get(ConfigurationFunctions.accessURL + Event);
    Thread.sleep(3000);
    sAssert.assertEquals(
        driver.findElements(By.cssSelector("div.event-title")).isEmpty(),
        false,
        "If Event title not appear then test will fail");

    // **Adding multiple events from Different store to cart
    JavascriptExecutor js1 =
        (JavascriptExecutor) driver; // Finding out elements that are out of sight
    js1.executeScript(
        "arguments[0].click();",
        driver.findElement(
            By.cssSelector(
                "li:nth-child(1) > div > div.search-main-cont > div:nth-child(1) > div.search-desc > div.search-title > h2 > a")));
    Thread.sleep(3000);

    JavascriptExecutor js2 =
        (JavascriptExecutor) driver; // Finding out elements that are out of sight
    js2.executeScript(
        "arguments[0].click();",
        driver.findElement(By.cssSelector(".btn.btn-red.add-to-cart-event.anAddToCart")));
    Thread.sleep(3000);

    // **Checking for presence of merge cart modal
    ShoppingList.MergeCartModal(driver);

    driver.get(ConfigurationFunctions.accessURL + Event);
    Thread.sleep(3000);

    JavascriptExecutor js3 =
        (JavascriptExecutor) driver; // Finding out elements that are out of sight
    js3.executeScript(
        "arguments[0].click();",
        driver.findElement(
            By.cssSelector(
                "li:nth-child(1) > div > div.search-main-cont > div:nth-child(3) > div.search-desc > div.search-title > h2 > a")));
    Thread.sleep(3000);

    JavascriptExecutor js4 =
        (JavascriptExecutor) driver; // Finding out elements that are out of sight
    js4.executeScript(
        "arguments[0].click();",
        driver.findElement(By.cssSelector(".btn.btn-red.add-to-cart-event.anAddToCart")));
    Thread.sleep(3000);

    // **Checking for presence of merge cart modal
    ShoppingList.MergeCartModal(driver);

    sAssert.assertEquals(
        driver.findElements(By.cssSelector(".itemsInCart.textAlignCenter")).isEmpty(),
        false,
        "If item added in your cart msg doesn't appear then test will fail");
    logger.log(LogStatus.PASS, "Validated multiple events added into Shopping cart");
    Thread.sleep(3000);
    //	    sAssert.assertAll();
  }