Esempio n. 1
0
        public void ShouldShowErrorMessageWhenNameFieldEmpty()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToQuestionPage();

            IWebDriver driverForLoremIpsum = new ChromeDriver();
            LoremIpsumWebSiteService loremIpsumWebSiteService =
                new LoremIpsumWebSiteService(driverForLoremIpsum);

            Dictionary <string, string> infoToFill = new Dictionary <string, string>
            {
                ["Name"]           = "",
                ["Email address"]  = "*****@*****.**",
                ["Age"]            = "18",
                ["Postcode"]       = "123123",
                ["Text to submit"] = loremIpsumWebSiteService.GenerateText(145),
                ["Error message"]  = "Name can't be blank"
            };

            driverForLoremIpsum.Quit();
            bbcService.FillFormAndPressSubmitButton(infoToFill);
            driver.Quit();
        }
Esempio n. 2
0
        public void HeadlineTitleValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToNewsPage();
            bbcService.CheckHeadlineArticleTitle("HK police and protesters clash near China office");
            driver.Quit();
        }
Esempio n. 3
0
        public void SecondaryTitlesValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToNewsPage();
            bbcService.CheckSecondaryArticlesTitles();
            driver.Quit();
        }
Esempio n. 4
0
        public void HeadlineTitleValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToNewsPage();
            bbcService.CheckHeadlineArticleTitle();
            driver.Quit();
        }
Esempio n. 5
0
        public void SearchValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToNewsPage();
            bbcService.SubmitSearchCategory();
            bbcService.CheckSearchedArticleTitle("Wild China");
            driver.Quit();
        }
Esempio n. 6
0
        public void SecondaryTitlesValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToNewsPage();
            List <string> expectedTitles = new List <string>()
            {
                "Jailed Russian opposition leader taken to hospital",
                "Indigenous man killed as Brazil miners take land",
                "British 15-year-old becomes gaming millionaire"
            };

            bbcService.CheckSecondaryArticlesTitles(expectedTitles);
            driver.Quit();
        }
Esempio n. 7
0
        public void ShouldCropTextWhenLengthMoreThan140()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToQuestionPage();

            IWebDriver driverForLoremIpsum = new ChromeDriver();
            LoremIpsumWebSiteService loremIpsumWebSiteService =
                new LoremIpsumWebSiteService(driverForLoremIpsum);
            Dictionary <string, string> infoToFill = new Dictionary <string, string>
            {
                ["Name"]          = "Lena",
                ["Email address"] = "*****@*****.**",
                ["Age"]           = "18",
                ["Postcode"]      = "123123",
                ["Error message"] = ""
            };

            bbcService.FillFormAndTakeScreenShot(infoToFill, loremIpsumWebSiteService.GenerateText(145));
            driverForLoremIpsum.Quit();
            driver.Quit();
        }
Esempio n. 8
0
        public void FillFormWithCorrectInfo()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

            bbcService.GoToQuestionPage();

            IWebDriver driverForLoremIpsum = new ChromeDriver();
            LoremIpsumWebSiteService loremIpsumWebSiteService =
                new LoremIpsumWebSiteService(driverForLoremIpsum);
            Dictionary <string, string> infoToFill = new Dictionary <string, string>
            {
                ["Name"]           = "Lena",
                ["Email address"]  = "*****@*****.**",
                ["Age"]            = "18",
                ["Postcode"]       = "123123",
                ["Text to submit"] = loremIpsumWebSiteService.GenerateText(140),
                ["Error message"]  = ""
            };

            driverForLoremIpsum.Quit();
            bbcService.FillFormAndTakeScreenShot(infoToFill);
            driver.Quit();
        }
 public BBCWebSiteTestingSteps()
 {
     driver     = new ChromeDriver();
     bbcService = new BBCWebSiteService(driver);
 }