Ejemplo n.º 1
0
 public NewsQuestionsPage GetInTouchBBC(BBC_HomePage homepage)
 {
     return(homepage
            .MainMenu
            .GoToNewsPage()
            .NewsMenu
            .MoreBtnClick()
            .HaveYouSayBtnClick()
            .DoYouHaveQuestionsClick());
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
            });
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 public ScoresFootballFixtures_ThisMonthResults GoToActualMonthFootballScottishPremResults(BBC_HomePage homepage)
 {
     return(homepage
            .MainMenu
            .GoToSportPage()
            .SportMenu
            .FootballTabClick()
            .FootballScores
            .MoreListButtonClick()
            .ScottishPremButtonClick()
            .ViewAllLinkClick()
            .ThisMonthResultsClick());
 }