Exemplo 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();
        }
Exemplo 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();
        }
Exemplo n.º 3
0
        public void SecondaryTitlesValidation()
        {
            IWebDriver        driver     = new ChromeDriver();
            BBCWebSiteService bbcService = new BBCWebSiteService(driver);

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

            bbcService.GoToNewsPage();
            bbcService.CheckHeadlineArticleTitle();
            driver.Quit();
        }
Exemplo 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();
        }
Exemplo 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();
        }
Exemplo 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();
        }
Exemplo 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);
 }