Esempio n. 1
0
        public void TeamIsDisplay()
        {
            try
            {
                HomeForm home = new HomeForm();
                Assert.AreEqual("2018 FIFA World Cup Russia™".ToLower(), home.Header.GetTitleText.ToLower());
                home.GoToPlayersForm();

                PlayersForm players = new PlayersForm();
                players.WaitForLoadingPage();
                Assert.IsTrue(players.IsFormTitleDisplay);

                PlayerBrowserSearchByPositionForm playerBrowser     = players.SelectPlayer();
                PlayerBrowserSearchByTeamForm     playerBrowserTeam = playerBrowser.SelectTeam();
                playerBrowserTeam.WaitForLoadingPage();
                Assert.IsTrue(playerBrowserTeam.IsFormTitleDisplay);
                playerBrowserTeam.ClickTeam(TEAM_NAME);
                playerBrowserTeam.WaitForLoadingPage();
                Assert.IsTrue(playerBrowserTeam.SelectedTeamIsDisplayed(TEAM_NAME));
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message, ex);
                ScreenshotTaker taker = new ScreenshotTaker();
                taker.MakeScreen();
                taker.PrintScreenshotsTo();
                Assert.Fail();
            }
        }
 public void ManOfTheMatch()
 {
     try
     {
         HomeForm home = new HomeForm();
         Assert.AreEqual("2018 FIFA World Cup Russia™".ToLower(), home.Header.GetTitleText.ToLower());
         home.Header.GoToSection("teams");
         TeamsForm teams = new TeamsForm();
         Assert.AreEqual(32, teams.TeamsNumber);
         Assert.AreEqual("Teams".ToLower(), teams.Title.ToLower());
         TeamForm  selectedTeam = teams.GoToTeam((new Random()).Next(teams.TeamsNumber - 1));
         MatchForm match        = selectedTeam.GoToMatch((new Random()).Next(selectedTeam.Matches.Count - 1));
         match.GoToManOfTheMatchPage();
         Assert.IsTrue(match.ManOfTheMatch.Displayed);
     }
     catch
     {
         ScreenshotTaker screenshotmaker = new ScreenshotTaker();
         screenshotmaker.MakeScreen();
         screenshotmaker.PrintScreenshotsTo();
     }
 }