public int GetFreePlaces() { WebDriverExtensions.WaitForAjax(driver); string value = this.NumberOfFreePlaces.Text; string result = Regex.Match(value, @"\d+").ToString(); return(int.Parse(result)); }
public void EditParticipantMaximumNumberDefinition() { var loginPage = new Login(this.driver); loginPage.LogIntoServie(Properties.Settings.Default.UserAteam1, Properties.Settings.Default.PasswordAteam1); var dashboard = new Dashboard(this.driver); dashboard.AddSessionButton.Click(); var session = new AddSession(this.driver); session.SessionLink.Click(); var sessionData = new SessionData(); sessionData.PlaceForSession = 5; sessionData.IsSpacePerSession = true; sessionData.LevelAdvanced = false; sessionData.LevelExpert = false; sessionData.LevelOther = false; sessionData.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish = false; sessionData.IstqbAdvancedLevelTestAnalystEnglishPolish = false; sessionData.IstqbAdvancedLevelTestManagerEnglishPolish = false; sessionData.IstqbAgileTesterExtensionEnglishPolish = false; sessionData.ReqbFoundationLevelEnglishPolish = false; sessionData.IstqbImprovingTheTestProcessEnglish = false; sessionData.IstqbTestManagementEnglish = false; session.Populate(sessionData); var text = this.driver.VisibleText(); Assert.IsTrue(text.Contains("ISTQB Foundation Level")); session.SaveSession.Click(); Thread.Sleep(1500); text = this.driver.VisibleText(); Assert.IsTrue(text.Contains(sessionData.SessionDate.ToString("HH:mm"))); Assert.IsTrue(text.Contains(sessionData.PlaceForSession.ToString())); Assert.IsTrue(text.Contains(sessionData.PostCode)); Assert.IsTrue(text.Contains(sessionData.Address)); Assert.IsTrue(text.Contains(sessionData.City)); session.DashboardLink.Click(); var landingPage = new LandingPage(this.driver); landingPage.PgsLogo.Click(); dashboard.DashboardLink.Click(); dashboard.SwitchMonthByDate(sessionData.SessionDate); WebDriverExtensions.WaitForAjax(this.driver); dashboard.ClickSessionLinkNoCheck(sessionData.City); dashboard.EditSessionLink.Click(); var editSession = new EditSession(this.driver); string s = editSession.SpaceForSession.Text; editSession.SpacePerProduct.Click(); Assert.Equals(s, editSession.SpacePerProduct.Text); }
public void Populate(SessionData d) { WebDriverExtensions.WaitForAjax(driver); this.ProposedDate.SendKeys(d.SessionDate.ToString("dd.MM.yyyy HH:mm")); if (d.SetSpecificLocation) { this.SetSpecificLocation.Click(); this.PostCode.Click(); this.PostCode.Clear(); this.PostCode.SendKeys(d.PostCode); this.City.SendKeys(d.City); this.Address.SendKeys(d.Address); } else { this.ProposedDate.SendKeys(d.SessionDate.ToString("dd.MM.yyyy HH:mm")); this.NoSpecificLocation.Click(); } this.AdditionalInformation.SendKeys(string.Format("Additional information: {0}", RandomDataHelper.GetRandomString(10))); }
public void Populate(SessionData d) { WebDriverExtensions.WaitForAjax(driver); this.SessionDtoDate.SendKeys(d.SessionDate.ToString("dd.MM.yyyy HH:mm")); this.LocationPostCode.Click(); this.LocationPostCode.SendKeys(d.PostCode); this.LocationCity.SendKeys(d.City); this.LocationAddress.SendKeys(d.Address); if (d.FillComment) { this.AdditionalInformation.SendKeys(d.Comment); } if (d.IsSpacePerSession) { this.SpacePerSession.Click(); this.SpaceForSession.SendKeys(d.PlaceForSession.ToString()); } else { this.SpacePerProduct.Click(); } this.LevelSelect.Click(); this.LevelBase.WaitForElement(500); if (d.LevelBase) { this.LevelBase.Click(); } if (d.LevelAdvanced) { this.LevelAdvanced.Click(); } if (d.LevelExpert) { this.LevelExpert.Click(); } if (d.LevelOther) { this.LevelOther.Click(); } this.LevelSelect.Click(); this.LevelSelect.SendKeys(Keys.Escape); this.ProductSelect.Click(); this.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish.WaitForElement(1000); if (d.IstqbFoundationLevelEnglishPolish) { this.IstqbFoundationLevelEnglishPolish.WaitForElement(500); this.IstqbFoundationLevelEnglishPolish.Click(); } if (d.ReqbFoundationLevelEnglishPolish) { this.ReqbFoundationLevelEnglishPolish.Click(); } if (d.IstqbAdvancedLevelTestManagerEnglishPolish) { this.IstqbAdvancedLevelTestManagerEnglishPolish.Click(); } if (d.IstqbAdvancedLevelTestAnalystEnglishPolish) { this.IstqbAdvancedLevelTestAnalystEnglishPolish.Click(); } if (d.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish) { this.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish.Click(); } if (d.IstqbAgileTesterExtensionEnglishPolish) { this.IstqbAgileTesterExtensionEnglishPolish.Click(); } if (d.IstqbTestManagementEnglish) { this.IstqbTestManagementEnglish.Click(); } if (d.IstqbImprovingTheTestProcessEnglish) { this.IstqbImprovingTheTestProcessEnglish.Click(); } this.ProductSelect.SendKeys(Keys.Escape); if (!d.IsSpacePerSession) { if (d.IstqbFoundationLevelEnglishPolish) { this.IstqbFoundationLevelPlaces.SendKeys(d.IstqbFoundationLevelPlaces.ToString()); } if (d.ReqbFoundationLevelEnglishPolish) { this.ReqbFoundationLevelPlaces.SendKeys(d.ReqbFoundationLevelPlaces.ToString()); } if (d.IstqbAdvancedLevelTestManagerEnglishPolish) { this.IstqbAdvancedLevelTestManagerPlaces.SendKeys(d.IstqbAdvancedLevelTestManagerPlaces.ToString()); } if (d.IstqbAdvancedLevelTestAnalystEnglishPolish) { this.IstqbAdvancedLevelTestAnalystPlaces.SendKeys(d.IstqbAdvancedLevelTestAnalystPlaces.ToString()); } if (d.IstqbAdvancedLevelTechnicalTestAnalystEnglishPolish) { this.IstqbAdvancedLevelTechnicalTestAnalystPlaces.SendKeys(d.IstqbAdvancedLevelTechnicalTestAnalystPlaces.ToString()); } if (d.IstqbAgileTesterExtensionEnglishPolish) { this.IstqbAgileTesterExtensionPlaces.SendKeys(d.IstqbAgileTesterExtensionPlaces.ToString()); } if (d.IstqbTestManagementEnglish) { this.IstqbTestManagementPlaces.SendKeys(d.IstqbTestManagementPlaces.ToString()); } if (d.IstqbImprovingTheTestProcessEnglish) { this.IstqbImprovingTheTestProcessPlaces.SendKeys(d.IstqbImprovingTheTestProcessPlaces.ToString()); } } this.ExaminerId.Click(); switch (d.ExaminerId) { case Examiner.ATeam1: this.ExaminerAteam1.Click(); break; case Examiner.ATeam2: this.ExaminerAteam2.Click(); break; case Examiner.None: this.ExaminerNone.Click(); break; } this.ExaminerId.Click(); this.ExaminerId.SendKeys(Keys.Escape); }