Beispiel #1
0
        static void Main(string[] args)
        {
            IAppDriver driver = new AppChromeDriver();
            //driver.AppUrl= "http://shop.demoqa.com";

            // ShopDemoMainPage sdp = new ShopDemoMainPage(driver);
            //// sdp.Navigate();
            //// sdp.categoryEnum = ShopDemoMainPage.Menu.WOMAN;
            // ItemsPage itemsPage = new ItemsPage(driver);
            MyAccountPage map = new MyAccountPage(driver);

            driver.AppUrl = ("http://shop.demoqa.com/my-account/");
            map.Navigate();
            map.EnterUserNameOrEmailAddressToLogIn("*****@*****.**");
            map.EnterPasswordToLogIn("GreatToStay@5624");
            map.ClickLogIn();
            map.IsSuccessfullyLoggedIn();



            //int itemCount = sdp.GlobalMenu.GetCartCount();
            //sdp.GlobalMenu.ClickMainMenu("WOMAN");
            ////itemsPage.FilterByColor("Black");
            //itemsPage.cartOptions = ItemsPage.AfterAddAction.ContinueShopping;
            //Thread.Sleep(10000);
            //itemsPage.FilterByColor("Brown");

            //List<string> nameList=itemsPage.GetAllItemNames();
            //nameList.Add("ALEXA FAUX LEATHER SADDLE BAG");
            // nameList.Add("COACHELLA EMBROIDERED MAXI DRESS");
            // Random rnd = new Random();
            // int i = rnd.Next(nameList.Count);

            //itemsPage.AddItemsToCart("CLEAN PU CARINA CLUTCH", itemsPage.cartOptions);
            //itemsPage.AddItemsToCart("ALEXA FAUX LEATHER SADDLE BAG", itemsPage.cartOptions);
            //itemsPage.AddItemsToCart("FLORAL CAGE MIDI DRESS", itemsPage.cartOptions);
            //itemsPage.AddItemsToCart("COTSWOLDS COATING OVERSIZED COAT", itemsPage.cartOptions);
            //itemsPage.AddItemsToCart("HETTIE JEWELS MAXI DRESS", itemsPage.cartOptions);
            //i = rnd.Next(nameList.Count);

            //itemsPage.cartOptions = ItemsPage.AfterAddAction.ViewCart;
            //itemsPage.AddItemsToCart((string)nameList[i], itemsPage.cartOptions);
            //int itemCountAfterAdd = sdp.GlobalMenu.GetCartCount();

            driver.Quit();
            // ReadExcelFile("LogInData", "D:\\sarsu\\ShoppingData.xlsx");
        }
Beispiel #2
0
        public static IAppDriver CreateDriver()
        {
            IAppDriver driver  = null;
            var        browser = System.Environment.GetEnvironmentVariable("browser");

            if (browser == "chrome")
            {
                driver = new AppChromeDriver();
            }
            else if (browser == "Firefox")
            {
                driver = new AppFirefoxDriver();
            }
            else if (browser == "Edge")
            {
                driver = new AppEdgeDriver();
            }

            return(driver);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            using (IAppDriver driver = new AppChromeDriver())
            {
                driver.AppUrl = "http://*****:*****@gmail.com";
                //rpage.Password = "******";
                //rpage.ConfirmPassword = "******";
                //rpage.Submit();
                LogInPage lp = new LogInPage(driver);
                lp.Navigate();
                lp.Email    = "*****@*****.**";
                lp.Password = "******";
                lp.Login();

                MyAccountPage p = new MyAccountPage(driver);
                p.ClickMyAccountLink();
                driver.Quit();
            }
        }