public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); StoreManagement.restartInstance(); sa = StoreManagement.getInstance(); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); UserManager.restartInstance(); ua = UserManager.getInstance(); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); RaffleSalesManager.restartInstance(); rsa = RaffleSalesManager.getInstance(); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); BuyHistoryManager.restartInstance(); bha = BuyHistoryManager.getInstance(); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); admin = new User("admin", "123456"); admin.register("admin", "123456"); admin.login("admin", "123456"); admin1 = new User("admin1", "123456"); admin1.register("admin1", "123456"); zahi = new User("zahi", "123456"); zahi.register("zahi", "123456"); itamar = new User("itamar", "123456"); itamar.register("itamar", "123456"); itamar.login("itamar", "123456"); int storeId = itamar.createStore("Maria&Netta Inc."); store = StoreManagement.getInstance().getStore(storeId); niv = new User("niv", "123456"); niv.register("niv", "123456"); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); DiscountsManager.restartInstance(); discountsArchive = DiscountsManager.getInstance(); discountsArchive.addNewDiscount(1, 1, "", 10, DateTime.Now.AddDays(10).ToString(), ""); discountsArchive.addNewDiscount(2, 1, "", 20, DateTime.Now.AddDays(15).ToString(), ""); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); productArchive = ProductManager.getInstance(); p1 = productArchive.addProduct("bread"); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); UserCartsManager.restartInstance(); userCartsArchive = UserCartsManager.getInstance(); userCartsArchive.updateUserCarts("itamar", 1, 1); userCartsArchive.updateUserCarts("itamar", 2, 1); userCartsArchive.updateUserCarts("niv", 3, 3, 50); userCartsArchive.updateUserCarts("niv", 3, 1); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); DiscountsManager.restartInstance(); productArchive = ProductManager.getInstance(); discountsArchive = DiscountsManager.getInstance(); milk = productArchive.addProduct("milk"); store = new Store(1, "halavi", new User("itamar", "123456")); milkInStore = productArchive.addProductInStore(milk, store, 50, 200); }
public void Initialize() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.insertData(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl(URL); Console.WriteLine("Opened URL"); IWebElement login = driver.FindElement(By.Id("LoginLink")); login.Click(); Thread.Sleep(sleepTime); IWebElement userName = driver.FindElement(By.Id("username")); userName.SendKeys("adminTest"); Thread.Sleep(sleepTime); IWebElement password = driver.FindElement(By.Id("password")); password.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin = driver.FindElement(By.Id("btnLogin")); btnLogin.Click(); Thread.Sleep(sleepTime); Thread.Sleep(sleepTime); IWebElement initdb; int i = 0; while (i == 0) { try { Thread.Sleep(sleepTime); initdb = driver.FindElement(By.Id("initdbButton")); i = 1; initdb.Click(); } catch (Exception) { continue; } } Thread.Sleep(sleepTime); IWebElement logout = driver.FindElement(By.Id("LogoutLink")); logout.Click(); Thread.Sleep(sleepTime); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); configuration.DB_MODE = "Testing"; ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); shippingProxy = new ShippingProxy(); us = userServices.getInstance(); ss = storeServices.getInstance(); sellS = sellServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); int storeId = ss.createStore("Maria&Netta Inc.", itamar); store = StoreManagement.getInstance().getStore(storeId); niv = us.startSession(); us.register(niv, "niv", "123456"); us.login(niv, "niv", "123456"); ss.addStoreManager(storeId, "niv", itamar); int colaId = ss.addProductInStore("cola", 3.2, 10, itamar, storeId, "Drinks"); cola = ProductManager.getInstance().getProductInStore(colaId); int spriteId = ss.addProductInStore("sprite", 5.2, 100, itamar, storeId, "Drinks"); sprite = ProductManager.getInstance().getProductInStore(spriteId); ss.addSaleToStore(itamar, storeId, cola.getProductInStoreId(), 1, 10, DateTime.Now.AddMonths(10).ToString()); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); sellS = sellServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); us.login(zahi, "zahi", "123456"); store2 = ss.createStore("Darkness Inc.", zahi); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); store = ss.createStore("Maria&Netta Inc.", itamar); niv = us.startSession(); us.register(niv, "niv", "123456"); us.login(niv, "niv", "123456"); ss.addStoreManager(store, "niv", itamar); cola = ss.addProductInStore("cola", 3.2, 10, itamar, store, "drinks"); sprite = ss.addProductInStore("sprite", 5.3, 20, itamar, store, "drinks"); chicken = ss.addProductInStore("chicken", 50, 20, zahi, store2, "drinks"); cow = ss.addProductInStore("cow", 80, 40, zahi, store2, "food"); saleId1 = ss.addSaleToStore(itamar, store, cola, 1, 5, "20/5/2018"); saleId2 = ss.addSaleToStore(zahi, store2, chicken, 1, 15, "20/7/2019"); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); }
public void init() { // ARCHIVE INIT WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); PurchasePolicyManager.restartInstance(); SalesManager.restartInstance(); DiscountsManager.restartInstance(); CouponsManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); ProductManager.restartInstance(); UserCartsManager.restartInstance(); purchasePolicyArchive = PurchasePolicyManager.getInstance(); salesArchive = SalesManager.getInstance(); discountsArchive = DiscountsManager.getInstance(); couponsArchive = CouponsManager.getInstance(); productArchive = ProductManager.getInstance(); StoreManagement = StoreManagement.getInstance(); userArchive = UserManager.getInstance(); // USERS INIT admin = new User("admin", "123456"); admin.register("admin", "123456"); admin.login("admin", "123456"); storeOwner = new User("owner", "123456"); storeOwner.register("owner", "123456"); storeOwner.login("owner", "123456"); itamar = new User("itamar", "123456"); itamar.register("itamar", "123456"); itamar.login("itamar", "123456"); shay = new User("shay", "123456"); shay.register("shay", "123456"); shay.login("shay", "123456"); // PRODUCTS INIT cola = productArchive.addProduct("cola"); sprite = productArchive.addProduct("sprite"); // STORES AND PRODUCTS IN STORES store = StoreManagement.addStore("samsung", storeOwner); colaInStore = productArchive.addProductInStore(cola, store, 200, 500, "cola category"); spriteInStore = productArchive.addProductInStore(sprite, store, 100, 200, "sprite category"); // SALES INIT colaRegularSale = salesArchive.addSale(colaInStore.getProductInStoreId(), regularSale, 50, DateTime.Now.AddDays(10).ToString()); spriteRaffleSale = salesArchive.addSale(spriteInStore.getProductInStoreId(), raffleSale, 3, DateTime.Now.AddDays(20).ToString()); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); sell = sellServices.getInstance(); admin = us.startSession(); us.register(admin, "admin", "123456"); us.login(admin, "admin", "123456"); admin1 = us.startSession(); us.register(admin1, "admin1", "123456"); zahi = us.startSession(); us.register(zahi, "zahi", "123456"); itamar = us.startSession(); us.register(itamar, "itamar", "123456"); us.login(itamar, "itamar", "123456"); store = ss.createStore("Maria&Netta Inc.", itamar); niv = us.startSession(); us.register(niv, "niv", "123456"); us.login(niv, "niv", "123456"); ss.addStoreManager(store, "niv", itamar); cola = ss.addProductInStore("cola", 3.2, 10, itamar, store, "drinks"); saleId = ss.addSaleToStore(itamar, store, cola, 1, 1, "20.5.2018"); raffleSale = ss.addSaleToStore(itamar, store, cola, 3, 1, "20.5.2018"); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); us = userServices.getInstance(); ss = storeServices.getInstance(); partislav = us.startSession(); us.register(partislav, "partislav", "123456"); us.login(partislav, "partislav", "123456"); manager1 = us.startSession(); us.register(manager1, "manager1", "123456"); us.login(manager1, "manager1", "123456"); manager2 = us.startSession(); us.register(manager2, "manager2", "123456"); us.login(manager2, "manager2", "123456"); int sId = ss.createStore("makolet", partislav); int s2Id = ss.createStore("makolet", partislav); s = StoreManagement.getInstance().getStore(sId); s2 = StoreManagement.getInstance().getStore(s2Id); ownerRole = StoreRole.getStoreRole(s, partislav); ownerRole2 = StoreRole.getStoreRole(s, partislav); ownerRole.addStoreManager(partislav, s, "manager1"); ownerRole.addStoreManager(partislav, s, "manager2"); ownerRole.addStoreManager(partislav, s2, "manager1"); ownerRole.addStoreManager(partislav, s2, "manager2"); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); StorePremissionsArchive.restartInstance(); BuyHistoryManager.restartInstance(); CouponsManager.restartInstance(); DiscountsManager.restartInstance(); RaffleSalesManager.restartInstance(); StorePremissionsArchive.restartInstance(); zahi = new User("zahi", "123456"); zahi.register("zahi", "123456"); zahi.login("zahi", "123456"); aviad = new User("aviad", "123456"); aviad.register("aviad", "123456"); aviad.login("aviad", "123456"); shay = new User("shay", "123456"); shay.register("shay", "123456"); shay.login("shay", "123456"); itamar = new User("itamar", "123456"); niv = new User("niv", "123456"); niv.register("niv", "123456"); int storeId = zahi.createStore("abowim"); store = StoreManagement.getInstance().getStore(storeId); int storeId2 = zahi.createStore("broes"); store2 = StoreManagement.getInstance().getStore(storeId2); zahiOwner = new StoreOwner(zahi, store); aviadManeger = new StoreManager(aviad, store); zahiOwner.addStoreManager(zahi, store, "aviad"); niv.logOut(); int colaId = zahiOwner.addProductInStore(zahi, store, "cola", 3.2, 40, "Drinks"); cola = ProductManager.getInstance().getProductInStore(colaId); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); ProductManager.restartInstance(); SalesManager.restartInstance(); StoreManagement.restartInstance(); UserManager.restartInstance(); UserCartsManager.restartInstance(); DiscountsManager.restartInstance(); CouponsManager.restartInstance(); RaffleSalesManager.restartInstance(); pA = ProductManager.getInstance(); saleA = SalesManager.getInstance(); storeA = StoreManagement.getInstance(); userA = UserManager.getInstance(); userCartA = UserCartsManager.getInstance(); discountA = DiscountsManager.getInstance(); couponA = CouponsManager.getInstance(); raffleA = RaffleSalesManager.getInstance(); p1 = pA.addProduct("Milk"); p2 = pA.addProduct("Bread"); p3 = pA.addProduct("T.V"); zahi = new User("zahi", "123456"); aviad = new User("aviad", "123456"); aviad.register("aviad", "123456"); zahi.register("zahi", "123456"); store = storeA.addStore("zahi inc", zahi); pis1 = ProductManager.getInstance().addProductInStore(p1, store, 20, 10); pis2 = ProductManager.getInstance().addProductInStore(p2, store, 30, 15); pis3 = ProductManager.getInstance().addProductInStore(p3, store, 40, 50); sale1 = saleA.addSale(pis1.getProductInStoreId(), 1, 10, "1/5/2020"); sale2 = saleA.addSale(pis2.getProductInStoreId(), 1, 10, "1/5/2020"); sale3 = saleA.addSale(pis3.getProductInStoreId(), 3, 1, "1/5/2020"); cart = new ShoppingCart(); }
public void Initialize() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.insertData(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl(URL); Console.WriteLine("Opened URL"); IWebElement login = driver.FindElement(By.Id("LoginLink")); login.Click(); Thread.Sleep(sleepTime); IWebElement userName = driver.FindElement(By.Id("username")); userName.SendKeys("adminTest"); Thread.Sleep(sleepTime); IWebElement password = driver.FindElement(By.Id("password")); password.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin = driver.FindElement(By.Id("btnLogin")); btnLogin.Click(); Thread.Sleep(sleepTime); IWebElement initdb; int i = 0; while (i == 0) { try { initdb = driver.FindElement(By.Id("initdbButton")); Thread.Sleep(sleepTime); i = 1; initdb.Click(); } catch (Exception) { continue; } } Thread.Sleep(sleepTime); IWebElement logout = driver.FindElement(By.Id("LogoutLink")); logout.Click(); Thread.Sleep(sleepTime); //add product to cart IWebElement AllProducts = driver.FindElement(By.Id("AllProductsLink")); AllProducts.Click(); Thread.Sleep(sleepTime * 2); IWebElement sale1 = driver.FindElement(By.Id("viewSale0")); sale1.Click(); Thread.Sleep(sleepTime * 2); IWebElement submitViewInstantSale = driver.FindElement(By.Id("submit")); submitViewInstantSale.Click(); Thread.Sleep(sleepTime * 2); IAlert alert2 = driver.SwitchTo().Alert(); alert2.Accept(); Thread.Sleep(sleepTime); IWebElement shoppingCartIcon = driver.FindElement(By.Id("shoppingCartIcon")); shoppingCartIcon.Click(); Thread.Sleep(sleepTime * 2); }
public void Initialize() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); cDB.addUserToDB("zahiSimpleRegister", "123456"); cDB.addUserToDB("aviadTest", "123456"); cDB.addStoreToDB("zahiSimpleRegister", "abowStore"); userServices.getInstance().startSession(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl(URL); Console.WriteLine("Opened URL"); IWebElement login = driver.FindElement(By.Id("LoginLink")); login.Click(); Thread.Sleep(sleepTime); IWebElement userName2 = driver.FindElement(By.Id("username")); userName2.SendKeys("adminTest"); Thread.Sleep(sleepTime); IWebElement password = driver.FindElement(By.Id("password")); password.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin = driver.FindElement(By.Id("btnLogin")); btnLogin.Click(); Thread.Sleep(sleepTime); IAlert alert = null; IWebElement initdb; int i = 0; while (i == 0) { try { Thread.Sleep(sleepTime); initdb = driver.FindElement(By.Id("initdbButton")); i = 1; initdb.Click(); } catch (Exception) { continue; } } Thread.Sleep(sleepTime); IWebElement logout = driver.FindElement(By.Id("LogoutLink")); logout.Click(); Thread.Sleep(sleepTime); IWebElement login1 = driver.FindElement(By.Id("LoginLink")); login1.Click(); Thread.Sleep(sleepTime); IWebElement userName = driver.FindElement(By.Id("username")); userName.SendKeys("zahiSimpleRegister"); Thread.Sleep(sleepTime); IWebElement password3 = driver.FindElement(By.Id("password")); password3.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin3 = driver.FindElement(By.Id("btnLogin")); btnLogin3.Click(); Thread.Sleep(sleepTime); IWebElement MystoreBtn = driver.FindElement(By.Id("MyStoresPublicLink")); MystoreBtn.Click(); Thread.Sleep(sleepTime * 2); //add productToStore IWebElement crateStoreBtn2 = driver.FindElement(By.Id("addProductInStore0")); crateStoreBtn2.Click(); Thread.Sleep(sleepTime); IWebElement productName = driver.FindElement(By.Id("product-name")); productName.SendKeys("colaTests"); Thread.Sleep(sleepTime); IWebElement productPrice = driver.FindElement(By.Id("product-price")); productPrice.SendKeys("100"); Thread.Sleep(sleepTime); IWebElement productAmount = driver.FindElement(By.Id("product-amount")); productAmount.SendKeys("20"); Thread.Sleep(sleepTime); IWebElement productCat = driver.FindElement(By.Id("product-cat")); productCat.SendKeys("DRINKS"); Thread.Sleep(sleepTime); IWebElement productBtn = driver.FindElement(By.Id("add_product_btn")); productBtn.Click(); Thread.Sleep(sleepTime * 2); IAlert alert2 = driver.SwitchTo().Alert(); alert2.Accept(); Thread.Sleep(sleepTime); }
public void Initialize() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); cDB.addUserToDB("zahiSimpleRegister", "123456"); cDB.addUserToDB("aviadTest", "123456"); cDB.addStoreToDB("zahiSimpleRegister", "abowStore"); userServices.getInstance().startSession(); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl(URL); Console.WriteLine("Opened URL"); IWebElement login = driver.FindElement(By.Id("LoginLink")); login.Click(); Thread.Sleep(sleepTime); IWebElement userName2 = driver.FindElement(By.Id("username")); userName2.SendKeys("adminTest"); Thread.Sleep(sleepTime); IWebElement password = driver.FindElement(By.Id("password")); password.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin = driver.FindElement(By.Id("btnLogin")); btnLogin.Click(); Thread.Sleep(sleepTime); IAlert alert = null; IWebElement initdb; int i = 0; while (i == 0) { try { Thread.Sleep(sleepTime); initdb = driver.FindElement(By.Id("initdbButton")); i = 1; initdb.Click(); } catch (Exception) { continue; } } Thread.Sleep(sleepTime); IWebElement logout = driver.FindElement(By.Id("LogoutLink")); logout.Click(); Thread.Sleep(sleepTime); IWebElement login1 = driver.FindElement(By.Id("LoginLink")); login1.Click(); Thread.Sleep(sleepTime); IWebElement userName = driver.FindElement(By.Id("username")); userName.SendKeys("zahiSimpleRegister"); Thread.Sleep(sleepTime); IWebElement password3 = driver.FindElement(By.Id("password")); password3.SendKeys("123456"); Thread.Sleep(sleepTime); IWebElement btnLogin3 = driver.FindElement(By.Id("btnLogin")); btnLogin3.Click(); Thread.Sleep(sleepTime); IWebElement MystoreBtn = driver.FindElement(By.Id("MyStoresPublicLink")); MystoreBtn.Click(); Thread.Sleep(sleepTime * 2); }