public void splashPage_logIn() { var agent = ConfigurationManager.AppSettings["Browser"]; var cbtapi = new CBTApi(); var sessionId = ((RemoteWebDriver)Driver.Instance).SessionId.ToString(); var caps = new DesiredCapabilities(); if (agent == "Remote_CBT") { try { caps.SetCapability("name", "Club Automation Test: splashPage_logIn"); caps.SetCapability("build", "TestCase #"); SplashPage.GoTo(); SplashPage.AssertPageTitle(); SplashPage.EnterUsername(); SplashPage.EnterPassword(); cbtapi.takeSnapshot(sessionId); SplashPage.ClickLoginBtn(); LocationSelector.SelectLocation(); LocationSelector.SelectPos(); LocationSelector.ClickSelect(); DashboardPage.AssertLoggedUserName(); cbtapi.takeSnapshot(sessionId); log.InfoFormat($"{TestContext.TestName} - Test Passed"); cbtapi.setScore(sessionId, "Pass"); } catch (Exception e) { var snapshotHash = cbtapi.takeSnapshot(sessionId); cbtapi.setDescription(sessionId, snapshotHash, e.ToString()); cbtapi.setScore(sessionId, "Fail"); log.ErrorFormat($"{TestContext.TestName} - Test Failed", e.Message, e.StackTrace); throw; } } else { try { SplashPage.GoTo(); SplashPage.AssertPageTitle(); SplashPage.EnterUsername(); SplashPage.EnterPassword(); SplashPage.ClickLoginBtn(); LocationSelector.SelectLocation(); LocationSelector.SelectPos(); LocationSelector.ClickSelect(); DashboardPage.AssertLoggedUserName(); log.InfoFormat($"{TestContext.TestName} - Test Passed"); } catch (Exception e) { log.ErrorFormat($"{TestContext.TestName} - Test Failed", e.Message, e.StackTrace); throw; } } }
public void cities_SelectedChanged(object sender, CommandEventArgs e) { panelSearch.Update(); NameValueCollection args = Renderer.ParseQueryString(e.CommandArgument.ToString()); LocationSelector.SelectLocation(sender, new LocationWithOptionsEventArgs(args)); GetData(sender, e); }
public void linkLocal_Click(object sender, EventArgs e) { if (!SessionManager.IsLoggedIn) { return; } checkboxBloggersOnly.Checked = false; checkboxPicturesOnly.Checked = false; inputName.Text = string.Empty; inputCity.Text = string.Empty; inputEmailAddress.Text = string.Empty; LocationSelector.SelectLocation(sender, new LocationWithOptionsEventArgs(SessionManager.Account)); GetData(sender, e); panelSearch.Update(); }