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(); }
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(); }
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 WhenIGoToQuestionPage() { bbcService.GoToQuestionPage(); }