public void CheckPriceIsPositiveNumber(string currency)
        {
            ServiceMethodsSet.ChangeCurrency(MyDriver, currency);
            decimal ActualResult = ServiceMethodsSet.GetPriceValue(MyDriver);

            Assert.IsTrue(ActualResult >= 0);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            IWebDriver MyDriver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            MyDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            ServiceMethodsSet.AdminLogIn(MyDriver, "admin", "Lv414_Taqc");
            MyDriver.FindElement(By.Id("menu-system")).Click();
            MyDriver.FindElement(By.XPath("//a[contains(text(),'Localisation')]")).Click();
            MyDriver.FindElement(By.XPath("//a[contains(text(),'Currencies')]")).Click();

            EurRate = Decimal.Parse(MyDriver.FindElement(By.XPath("//td[text()='EUR']/following-sibling::td[@class='text-right'][count(*)=0]")).Text.Replace('.', ','));
            GbpRate = Decimal.Parse(MyDriver.FindElement(By.XPath("//td[text()='GBP']/following-sibling::td[@class='text-right'][count(*)=0]")).Text.Replace('.', ','));

            MyDriver.Navigate().GoToUrl(@"http://192.168.17.128/opencart/upload/");
            MyDriver.Manage().Window.Maximize();
            MyDriver.FindElement(By.CssSelector(".owl-wrapper-outer")).Click();
            ServiceMethodsSet.ChangeCurrency(MyDriver, "USD");
            UsdPrice = ServiceMethodsSet.GetPriceValue(MyDriver);
            ServiceMethodsSet.ChangeCurrency(MyDriver, "EUR");
            EurPrice = ServiceMethodsSet.GetPriceValue(MyDriver);
            ServiceMethodsSet.ChangeCurrency(MyDriver, "GBP");
            GbpPrice = ServiceMethodsSet.GetPriceValue(MyDriver);
            MyDriver.Quit();
        }