Exemple #1
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();
        }
Exemple #2
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 void ThenIFillFormWithFollowingValuesAndTakeScreenshot(Table infoToFill)
        {
            var info = infoToFill.Rows.ToDictionary(k => k["Key"], k => k["Value"]);

            bbcService.FillFormAndTakeScreenShot(info, generatedText);
        }