public bool SelectAddToCart()
        {
            bool returnBool = false;

            FrameWork.ClickButton(AddToCart);
            return(returnBool);
        }
        private bool Initialize()
        {
            bool          returnBool = false;
            ChromeOptions options    = new ChromeOptions();

            options.AddArgument("--start-maximized");
            driver = new ChromeDriver(options);
            url    = "http://automationpractice.com/index.php";
            FrameWork.Init(driver);
            return(returnBool);
        }
Exemplo n.º 3
0
        public bool EnterEmail(String emailAddress)
        {
            FrameWork.SetTextBoxValue(email, emailAddress);
            String resultText = FrameWork.GetText(email);

            StatusOutput("resultText:" + resultText.ToString());
            if (resultText.Equals(emailAddress) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public bool EnterPwd(String password)
        {
            FrameWork.SetTextBoxValue(passwd, password);
            String resultText = FrameWork.GetText(passwd);

            StatusOutput("resultText:" + resultText.ToString());
            if (resultText.Equals(password) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public void SelectProceedToCheckout()
 {
     FrameWork.ClickButton(ProceedToCheckout);
 }
 public void SelectContinueShopping()
 {
     FrameWork.ClickButton(ContinueShopping);
 }
 public void SelectX()
 {
     FrameWork.ClickButton(X);
 }
        public bool CheckCartCount(int count)
        {
            By quantity = By.XPath("//span[@class='ajax_cart_quantity'][contains(text(), '" + count.ToString() + "')]");

            return(FrameWork.WaitForElementPresent(quantity));
        }
 public bool WaitForCAddToCart()
 {
     return(FrameWork.WaitForElementPresent(AddedToCartCheck));
 }
Exemplo n.º 10
0
 public void SelectSignIn()
 {
     FrameWork.ClickButton(SubmitLogin);
 }
 public bool WaitForHomeImg()
 {
     return(FrameWork.WaitForElementPresent(Img));
 }
Exemplo n.º 12
0
 public bool WaitForAuthentication()
 {
     return(FrameWork.WaitForElementPresent(Authentication));
 }
 public bool WaitForDressesCat()
 {
     return(FrameWork.WaitForElementPresent(DressesCat));
 }
 public bool SelectSummerDressSku6()
 {
     driver.Navigate().GoToUrl(SummerDressSku6);
     FrameWork.Highlight(DressesSku6, 5);
     return(FrameWork.WaitForElementPresent(DressesSku6));
 }
 public void ClickDresses()
 {
     FrameWork.ClickButton(Dresses);
 }
        public bool RunScript()
        {
            bool returnBool = false;

            StatusOutput("RunScript()");

            bool resultInit = Initialize();

            bool resultUrl = FrameWork.RemoteFileExists(url);

            StatusOutput("resultUrl:" + resultUrl);

            bool resultNavigate = Navigate();

            StatusOutput("resultNavigate:" + resultNavigate);

            CloudAutomationHomePage cloudAutomationHomePage = new CloudAutomationHomePage();
            bool resultHomePage = cloudAutomationHomePage.WaitForHomePage();

            StatusOutput("resultHomePage:" + resultHomePage);

            bool resultHImg = cloudAutomationHomePage.WaitForHomeImg();

            StatusOutput("resultHImg:" + resultNavigate);

            cloudAutomationHomePage.ClickDresses();

            bool resultClickDresses = cloudAutomationHomePage.WaitForDressesCat();

            StatusOutput("resultClickDresses:" + resultClickDresses);

            cloudAutomationHomePage.SelectSummerDressSku5();
            UrlOutput();//should output summer dress A url

            cloudAutomationHomePage.SelectAddToCart();
            bool resultWaitForCart = cloudAutomationHomePage.WaitForCAddToCart();

            StatusOutput(" resultWaitForCart:" + resultWaitForCart);

            PopUpAddToCart popUpAddToCart    = new PopUpAddToCart();
            bool           resultAddedToCart = popUpAddToCart.WaitForCAddToCart();

            StatusOutput("resultAddedToCart:" + resultAddedToCart);

            bool resultcount1 = popUpAddToCart.CheckCartCount(1);

            StatusOutput("resultcount1:" + resultNavigate);

            popUpAddToCart.SelectContinueShopping();
            FrameWork.RefeshPage();

            bool resultAddedToCartNull = cloudAutomationHomePage.WaitForCAddToCartNull();//Add to cart page closed

            StatusOutput("resultAddedToCartNull:" + resultAddedToCartNull);

            cloudAutomationHomePage.SelectSummerDressSku6();
            UrlOutput();//should output summer dress B url

            cloudAutomationHomePage.SelectAddToCart();
            resultAddedToCart = cloudAutomationHomePage.WaitForCAddToCart();
            StatusOutput("resultAddedToCart:" + resultAddedToCart);

            bool resultcount2 = popUpAddToCart.CheckCartCount(2);

            StatusOutput("resultcount2:" + resultNavigate);

            popUpAddToCart.SelectProceedToCheckout();

            PageShoppingCartSummary pageShoppingCartSummary = new PageShoppingCartSummary();
            bool resultWaitForShoppingCartSummary           = pageShoppingCartSummary.WaitForCart();

            StatusOutput("resultWaitForShoppingCartSummary:" + resultWaitForShoppingCartSummary);

            pageShoppingCartSummary.ScrollToProceedToCheckout();
            pageShoppingCartSummary.HighlightProceedToCheckout();
            pageShoppingCartSummary.SelectProceedToCheckout();

            PageAuthentication pageAuthentication = new PageAuthentication();

            pageAuthentication.WaitForAuthentication();

            bool resultLogin = pageAuthentication.EnterEmail("*****@*****.**");

            StatusOutput("resultLogin:"******"MyPassword");

            StatusOutput("resultPassword:"******"Done with script");

            Thread.Sleep(2500);
            StatusOutput("Call Close()");
            bool resultClose = Close();

            StatusOutput("resultClose:" + resultClose);
            return(returnBool);
        }
 public bool WaitForHomePage()
 {
     return(FrameWork.WaitForElementPresent(MainPage));
 }