private void btnAddTeam_Click(object sender, EventArgs e) { var form = new TeamsForm(selectedRound, database); form.ShowDialog(this); if (form.Success) { btnTeams_Click(null, null); } }
public void TeamLineUpIsPresented() { HomeForm homeForm = new HomeForm(); Assert.AreEqual(homeForm.IsHomeFormTitleDisplayed, true); homeForm.Header.GoToSection("teams"); TeamsForm teams = new TeamsForm(); teams.GoToTeam(1); TeamForm teamForm = new TeamForm(); Assert.AreEqual(teamForm.IsTeamLineupPresented(), true); }
public void TeamProfileRedirecting() { 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(31)); string teamName = selectedTeam.Title; TeamProfileForm teamProfile = selectedTeam.GoToTeamProfile(); Assert.AreEqual(teamName, teamProfile.TeamName); Assert.IsTrue(teamProfile.TeamNameIsDisplayed); Assert.IsTrue(Browser.Url.Contains(teamName.ToLower())); }
private void btnTeams_Click(object sender, EventArgs e) { FormCollection fc = Application.OpenForms; bool foundForm = false; foreach (Form frm in fc) { if (frm is TeamsForm) { foundForm = true; frm.BringToFront(); break; } } if (!foundForm) { TeamsForm teamsForm = new TeamsForm(); teamsForm.Show(); } }
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(); } }