public NewsQuestionsPage GetInTouchBBC(BBC_HomePage homepage) { return(homepage .MainMenu .GoToNewsPage() .NewsMenu .MoreBtnClick() .HaveYouSayBtnClick() .DoYouHaveQuestionsClick()); }
public void HardCodedMainArticleTest() { BBC_HomePage HomePage = new BBC_HomePage(driver); NewsMainPage newsMainPage = HomePage.MainMenu.GoToNewsPage(); var topNews = newsMainPage.MainArticle; string actualTopNews = topNews; string expectedTopNews = "Top Iran health official gets virus as fears grow"; Assert.AreEqual(expectedTopNews, actualTopNews); }
public void MatchResultsCheckTest() { BBC_HomePage HomePage = new BBC_HomePage(driver); _bbcService.GoToActualMonthFootballScottishPremResults(HomePage).TeamNameClick(); ScoresFootballFixtures_ThisMonthResults ThisMonthResults = new ScoresFootballFixtures_ThisMonthResults(driver); SportsFootballMatchPage MatchPage = new SportsFootballMatchPage(driver); Assert.Multiple(() => { Assert.AreEqual(ThisMonthResults.FirstLeftTeamScore, MatchPage.FirstLeftTeamScore); Assert.AreEqual(ThisMonthResults.FirstRightTeamScore, MatchPage.FirstRightTeamScore); }); }
public void RequestFormTest_correctinfo() { BBC_HomePage HomePage = new BBC_HomePage(driver); var newsQuestionsPage = _bbcService.GetInTouchBBC(HomePage); var formRequest = new QuestionRequest { TextInput = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc congue sapien non risus consequat luctus. Donec vulputate interdum massa amket.", NameInput = "Vasia Pupkin", EmailInput = "*****@*****.**", AgeInput = "20", PostCodeInput = "04567", }; _bbcService.FillQuestionForm(newsQuestionsPage.QuestionAskingForm, formRequest); Assert.AreEqual(newsQuestionsPage.NewsQuestionSiteAdress, driver.Url); }
public void SearchWithAreaTest() { BBC_HomePage HomePage = new BBC_HomePage(driver); NewsMainPage newsMainPage = HomePage.MainMenu.GoToNewsPage(); var expectedFirstArticle = "Middle East weather forecast"; newsMainPage.MainMenu.FillInSearchField(newsMainPage.MainArticleTheme); SearchResultPage searchResultPage = newsMainPage.MainMenu.SearchButtonClick(); var actualFirstArticle = searchResultPage.FirstArticle; Assert.AreEqual(expectedFirstArticle, actualFirstArticle); }
public void HardCodedSecondaryArticlesTest() { BBC_HomePage HomePage = new BBC_HomePage(driver); NewsMainPage newsMainPage = HomePage.MainMenu.GoToNewsPage(); var headers = newsMainPage.SecondaryHeadings; List <string> h3List = new List <string> { "Tenerife hotel locked down over coronavirus", "Thirteen killed as mobs clash in Delhi", "Clashes erupt over new Greek migrant camps", "Plácido Domingo apologises to accusers", "China jails Hong Kong bookseller for 10 years" }; bool equals = headers.Count == h3List.Count && !headers.Except(h3List).Any(); Assert.IsTrue(equals); }
public void RequestFormTest_EmptyEmail() { BBC_HomePage HomePage = new BBC_HomePage(driver); var newsQuestionsPage = _bbcService.GetInTouchBBC(HomePage); var formRequest = new QuestionRequest { TextInput = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc congue sapien non risus consequat luctus. Donec vulputate interdum massa amket.", NameInput = "Vasia Pupkin", EmailInput = "", AgeInput = "20", PostCodeInput = "04567", }; _bbcService.FillQuestionForm(newsQuestionsPage.QuestionAskingForm, formRequest); QuestionForm_submitErrors questionForm_SubmitErrors = newsQuestionsPage.QuestionAskingForm.SubmitButtonClick(); Assert.IsNotNull(questionForm_SubmitErrors.EmailErrorMessage); }
public ScoresFootballFixtures_ThisMonthResults GoToActualMonthFootballScottishPremResults(BBC_HomePage homepage) { return(homepage .MainMenu .GoToSportPage() .SportMenu .FootballTabClick() .FootballScores .MoreListButtonClick() .ScottishPremButtonClick() .ViewAllLinkClick() .ThisMonthResultsClick()); }