예제 #1
0
        public void TestCase_1()
        {
            string stepName = "";
            string testname = "1.LogInForm";
            string datum    = Time.GetFormatedDateNow(testname);

            try
            {
                {
                    // 1. Navigacija drivera do Chess.com
                    driver.Url = "https://www.chess.com/login";
                    driver.Manage().Window.Maximize();
                    Thread.Sleep(6000);

                    // 2. Login Forma samo klik
                    stepName = "2.Login forma";
                    driver.FindElement(By.Id("username")).SendKeys(" ");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("password")).SendKeys("");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("login")).Click();
                    Thread.Sleep(6000);
                    LogStatus.LogSuccess(stepName, testname, datum);

                    // 3. Login forma pogresna
                    stepName = "3.Login forma";
                    driver.FindElement(By.Id("username")).SendKeys("");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("password")).SendKeys("pogresanipass");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("login")).Click();
                    Thread.Sleep(6000);
                    LogStatus.LogSuccess(stepName, testname, datum);


                    // 4. Login Forma tacna
                    stepName = "4.Login forma";
                    driver.FindElement(By.Id("username")).SendKeys("Testuser2019");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("password")).SendKeys("testuser2018");
                    Thread.Sleep(6000);
                    driver.FindElement(By.Id("login")).Click();
                    Thread.Sleep(6000);
                    LogStatus.LogSuccess(stepName, testname, datum);
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                LogStatus.LogError(stepName, testname, datum, msg);
                Assert.Fail(msg);
            }
        }
예제 #2
0
        public void TestCase_3()
        {
            string stepName        = "";
            string testname        = "4.CoinMarket";
            string datum           = Time.GetFormatedDateNow(testname);
            IJavaScriptExecutor js = driver as IJavaScriptExecutor;

            try
            {
                {
                    // 1. Navigacija drivera do CoinMarket
                    driver.Url = "https://coinmarketcap.com/";
                    driver.Manage().Window.Maximize();
                    Thread.Sleep(6000);

                    // 2. Click na day/night mode.
                    stepName = "Click na day/night mode.";
                    driver.FindElement(By.XPath("//button[@title='Day/Night Mode']")).Click();
                    Thread.Sleep(6000);

                    // 2. Click na EOS
                    stepName = "Click na EOS";
                    js.ExecuteScript("window.scrollBy(0,550);");
                    driver.FindElement(By.LinkText("EOS")).Click();
                    LogStatus.LogSuccess(stepName, testname, datum);
                    Thread.Sleep(6000);

                    // 3. Click na Linkove u isto vreme 7 linka
                    stepName = "Click na linkove";
                    driver.FindElement(By.XPath("//a[@href='https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://bitcointalk.org/index.php?topic=1904415.0']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://bloks.io/']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://eospark.com/']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://t.me/joinchat/AAAAAEQbOeucnaMWN0A9dQ']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://github.com/eosio']")).Click();
                    driver.FindElement(By.XPath("//a[@href='https://eos.io/']")).Click();
                    LogStatus.LogSuccess(stepName, testname, datum);
                    Thread.Sleep(6000);
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                LogStatus.LogError(stepName, testname, datum, msg);
                Assert.Fail(msg);
            }
        }
예제 #3
0
        public void TestCase_4()
        {
            string stepName        = "";
            string testname        = "1.LogInForm";
            string datum           = Time.GetFormatedDateNow(testname);
            IJavaScriptExecutor js = driver as IJavaScriptExecutor;

            try
            {
                {
                    // 1. Navigacija drivera do 500pixel
                    driver.Url = "https://500px.com/richardberesfordharris";
                    driver.Manage().Window.Maximize();
                    Thread.Sleep(6000);

                    // 2. Click na prvu sliku
                    stepName = "Click na prvu sliku";
                    js.ExecuteScript("window.scrollBy(0,650);");
                    driver.FindElement(By.XPath("//a[@href='/photo/297850117/untitled-by-richard-beresford-harris']")).Click();
                    LogStatus.LogSuccess(stepName, testname, datum);
                    Thread.Sleep(6000);

                    //3. Zoom slike
                    stepName = "Zoom slike";
                    driver.FindElement(By.ClassName("")).Click();
                    LogStatus.LogSuccess(stepName, testname, datum);
                    Thread.Sleep(6000);
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                LogStatus.LogError(stepName, testname, datum, msg);
                Assert.Fail(msg);
            }
        }
예제 #4
0
파일: 2.IMDb.cs 프로젝트: wekz/FinalTest
        public void TestCase_2()
        {
            string stepName = "";
            string testname = "2.IMDb";
            string datum    = Time.GetFormatedDateNow(testname);

            try
            {
                //1. Navigacija drivera do IMDB-a
                stepName   = "1. Navigacija drivera do IMDB-a";
                driver.Url = "https://www.imdb.com/";
                driver.Manage().Window.Maximize();
                Thread.Sleep(5000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //2. Login na IMDb
                stepName = "2.Login na IMDb";
                driver.FindElement(By.Id("imdb-signin-link")).Click();
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //3. Sing with IMDb Acc
                stepName = "3 IMDb Acc";
                driver.FindElement(By.XPath("//span[@class='auth-provider-text provider-imdb']")).Click();
                Thread.Sleep(6000);
                driver.FindElement(By.Id("ap_email")).SendKeys("*****@*****.**");
                Thread.Sleep(6000);
                driver.FindElement(By.Id("ap_password")).SendKeys("testuser2018");
                Thread.Sleep(6000);
                driver.FindElement(By.Id("signInSubmit")).Click();
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //4. IMDb top 100
                stepName = "4. IMDb top 100";
                driver.FindElement(By.LinkText("Top Rated Movies")).Click();
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //5. Pick a Movie
                stepName = "5 pick a Movie";
                driver.FindElement(By.LinkText("12 Angry Men")).Click();
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //6. User Reviews
                stepName = "6 User Reviews";
                driver.FindElement(By.LinkText("USER REVIEWS")).Click();
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);

                //7. Sort byy Vote and Rating
                stepName = "7. Sort by Votes and Rating";
                driver.FindElement(By.XPath("//span[@class='faceter-facets-text']")).Click();
                Thread.Sleep(6000);

                //8. Drop down rating
                stepName = "8. Drop down rating";
                var rating        = driver.FindElement(By.Name("ratingFilter"));
                var select_rating = new SelectElement(rating);
                select_rating.SelectByValue("10");
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);


                //9. Drop down Sort by
                stepName = "9. Drop down Sort by";
                var sort        = driver.FindElement(By.Name("sort"));
                var select_sort = new SelectElement(sort);
                select_sort.SelectByValue("totalVotes");
                Thread.Sleep(6000);
                LogStatus.LogSuccess(stepName, testname, datum);
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                LogStatus.LogError(stepName, testname, datum, msg);
                Assert.Fail(msg);
            }
        }
예제 #5
0
        public void TestCase_5()
        {
            string stepName = "";
            string testname = "3.PCParts";
            string datum    = Time.GetFormatedDateNow(testname);
            // scroll down java
            IJavaScriptExecutor js = driver as IJavaScriptExecutor;

            try
            {
                // 1.Navigacija drivera do PCPIKER-a
                stepName   = "1.Navigacija drivera do PCPIKER-a";
                driver.Url = "https://pcpartpicker.com/";
                driver.Manage().Window.Maximize();
                Thread.Sleep(5000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 2.Klik na Listu
                stepName = "2.Klik na Listu";
                driver.FindElement(By.ClassName("nav-build")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 3.Pick CPU
                stepName = "3.Pick Elements CPU";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.ClassName("btn-mds")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("4460");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_30757")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Add")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 4.Pick GPU
                stepName = "4.Pick GPU";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose A CPU Cooler")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("Noctua NH-L9i");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_14597")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Add")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 6. Pick RAM Memory
                stepName = "6. Pick RAM Memory";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose Memory")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("G.Skill Aegis");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_52162")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.XPath("//a[@href='#YRvZxr']")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 7. Pick Storage
                stepName = "6. Pick Element Memory";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose Storage")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("970 evo");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_174613")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.XPath("//a[@href='#JLdxFT']")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 8.Pick Video Card
                stepName = "8. Pick Video Card";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose A Video Card")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("1080ti");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_102640")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.XPath("//a[@href='#YNVBD3']")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 9. Pick Case
                stepName = "9.Pick Case";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose A Case")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("List")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("NZXT H700i ATX Mid Tower");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_136584")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.XPath("//a[@href='#CVtWGX']")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 10. Pick Power Supply
                stepName = "Pick Power Supply";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose A Power Supply")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("EVGA SuperNOVA 850");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_69896")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Add")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 11. Pick OS
                stepName = "Pick OS";
                js.ExecuteScript("window.scrollBy(0,450);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Choose An Operating System")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("Microsoft Windows 10 Pro (64-bit)");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_47046")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Add")).Click();
                Thread.Sleep(2000);
                LogStatus.LogSuccess(stepName, testname, datum);

                // 12. Pick Monitor
                stepName = "Pick Monitor";
                js.ExecuteScript("window.scrollBy(0,550);");
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Monitor")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.Id("part_category_search")).SendKeys("Acer Predator X34");
                Thread.Sleep(2000);
                driver.FindElement(By.Id("px_163366")).Click();
                Thread.Sleep(2000);
                driver.FindElement(By.LinkText("Add")).Click();
                Thread.Sleep(2000);
                js.ExecuteScript("window.scrollBy(0,350);");
                Thread.Sleep(2000);
                driver.Manage().Window.FullScreen();
                Thread.Sleep(2000);
                Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();
                ss.SaveAsFile(@"D:\\PCParts.Jpeg", ScreenshotImageFormat.Jpeg);
                Thread.Sleep(5000);
                LogStatus.LogSuccess(stepName, testname, datum);
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                LogStatus.LogError(stepName, testname, datum, msg);
                Assert.Fail(msg);
            }
        }