public void ThenTheParticipantStatusChanges() { _participantId = GetParticipantId(); _participantId.Should().NotBeEmpty(); PollForStatusToUpdate(EventsPage.ParticipantStatus(_participantId), _participantState.ToString()).Should() .BeTrue(); }
private void SetTheTransferFromAndTo(string transferFrom, string transferTo) { _browser.Clear(EventsPage.ParticipantTransferFromTextfield(_participantId)); _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferFromTextfield(_participantId)).SendKeys(transferFrom); _browser.Clear(EventsPage.ParticipantTransferToTextfield(_participantId)); _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferToTextfield(_participantId)).SendKeys(transferTo); }
public void EditAnEventItem() { // Set up the test in ReportLog wrapper class. ReportLog.CreateTest("EditAnEventItem", "This is an end-to-end test case regarding the editing of an Event."); try { // Log in. LoginPage loginPage = new LoginPage(driver); loginPage.NavigateToLoginPage(); ReportLog.Log("Navigated to Login Page."); loginPage.TypeUserName("plan.6"); loginPage.TypePassword("plan01#"); ReportLog.Log("Entered credentials."); // Go to home page. HomePage homePage = loginPage.ConfirmLoginAndGoBackToHomePage(); homePage.WaitUntilHomePageLoadingComplete(); ReportLog.Log("Login confirmed and redirected back to Home Page."); // Go to events page. EventsPage eventsPage = homePage.GoToEventsPage(); eventsPage.WaitUntilEventsPageLoadingComplete(); ReportLog.Log("Navigated to Events Page."); // Go to event item page of a specific item. EventsItemPage eventsItemPage = eventsPage.GoToSpecificEventsItemPage(0); eventsItemPage.WaitUntilEventsItemPageLoadingComplete(); ReportLog.Log("Go to the editing page of a specific item."); // Input mandatory values, save changes and extract item reference ID. string referenceID = eventsItemPage.InputMandatoryChangesAndSave().Substring(13); ReportLog.Log("Mandatory fields inputted and changes saved."); // Search for this specific item. eventsPage.SearchByReferenceID(referenceID, false, true); try { // Assertion. eventsPage.ConfirmEventEdited(referenceID); ReportLog.Pass("EditAnEventItem."); } catch (AssertionException a) { // Test failed due to assertion error. ReportLog.Fail(a.Message, ReportLog.TakeScreenShot("AddAnEventItemViaPortal", driver)); throw a; } driver.Quit(); } catch (Exception e) { // Test failed due to unforeseen exception. ReportLog.Fail(e.Message + "\n" + e.StackTrace); ReportLog.Fail("UnforeseenException", ReportLog.TakeScreenShot("UnforeseenException", driver)); throw e; } }
private void ClearTheTransferFromAndToTextFields() { var transferFromText = _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferFromTextfield(_participantId)).GetAttribute("value"); DeleteTextFromTextField.Delete(_browser, EventsPage.ParticipantTransferFromTextfield(_participantId), transferFromText.Length); var transferToText = _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferToTextfield(_participantId)).GetAttribute("value"); DeleteTextFromTextField.Delete(_browser, EventsPage.ParticipantTransferToTextfield(_participantId), transferToText.Length); }
private void VerifyParticipantDetails() { foreach (var participant in _c.Test.Conference.Participants) { _browser.TextOf(EventsPage.ParticipantDisplayName(participant.Id)).Should().Be(participant.DisplayName); _browser.TextOf(EventsPage.ParticipantUsername(participant.Id)).Should().Be(participant.Username); _browser.TextOf(EventsPage.ParticipantUserRole(participant.Id)).Should().Be(participant.UserRole.ToString()); _browser.TextOf(EventsPage.ParticipantId(participant.Id)).Should().Be(participant.Id.ToString()); _browser.TextOf(EventsPage.ParticipantStatus(participant.Id)).Should().Be(participant.CurrentStatus.ToString()); } }
public void WhenTheUserAttemptsToSendATransferEventWithABlankTransferFromAndTo() { SelectAConference(); GetTheConferenceDetailsById(); VerifyHearingDetails(); VerifyParticipantDetails(); _participantId = GetParticipantId(); _participantId.Should().NotBeEmpty(); _participantState = ParticipantState.InHearing; _commonSharedSteps.WhenTheUserSelectsTheOptionFromTheDropdown(_browser.Driver, EventsPage.ParticipantEventDropdown(_participantId), "Transfer"); _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferFromTextfield(_participantId)).Displayed.Should().BeTrue(); ClearTheTransferFromAndToTextFields(); }
public void Events_03_ContactOrganiser() { UiTest(() => { _eventsPage = _myProfilePage.NavigateToEventsPage(); _contactOrganiserPage = _eventsPage.ClickContactOrganiser(); _contactOrganiserPage.CheckThatAllDetailsAreEnabled(); _contactOrganiserPage.FillInTheFormAndSendMessage(); Assert.That(_contactOrganiserPage.EmailSentTx.Displayed); }); }
public void WhenTheUserSendsAParticipantEvent() { SelectAConference(); GetTheConferenceDetailsById(); VerifyHearingDetails(); VerifyParticipantDetails(); _participantId = GetParticipantId(); _participantId.Should().NotBeEmpty(); _participantState = ParticipantState.InHearing; _commonSharedSteps.WhenTheUserSelectsTheOptionFromTheDropdown(_browser.Driver, EventsPage.ParticipantEventDropdown(_participantId), "Transfer"); _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferFromTextfield(_participantId)).Displayed.Should().BeTrue(); SetTheTransferFromAndTo("WaitingRoom", "HearingRoom"); _browser.Click(EventsPage.ParticipantSendEventButton(_participantId)); }
protected override void OnElementChanged(ElementChangedEventArgs <Page> e) { base.OnElementChanged(e); if (e.OldElement != null || Element == null) { return; } if (page == null) { page = new EventsPage(); } SetNativeControl(page); }
public void AddAnEventItemViaPortal() { // Set up the test in ReportLog wrapper class. ReportLog.CreateTest("AddAnEventItemViaPortal", "This is an end-to-end test case regarding the adding of an Event via the Portal."); try { // Add from portal. var portalPage = new PortalPage(driver); portalPage.NavigateToPortalPage(); // Fill out and save a new report. portalPage.ReportAnInjury(); // Login in order to check Event has been added. var loginPage = new LoginPage(driver); loginPage.NavigateToLoginPage(); var homePage = loginPage.LoginWithCredentials("plan.8", "plan01#"); ReportLog.Log("Submitted login details."); // Now check if the event has been added. var eventsPage = new EventsPage(driver); eventsPage.NavigateToEventsPage(); ReportLog.Log("Navigated to Events page."); eventsPage.SearchByReferenceID(portalPage.GetReferenceID(), true, true); ReportLog.Log("Searched for reference ID: " + portalPage.GetReferenceID()); try { // Confirm Event has been added. eventsPage.ConfirmEventAdded(portalPage.GetReferenceID()); ReportLog.Pass("AddAnEventItemViaPortal Test Passed."); } catch (AssertionException a) { // Test failed due to assertion error. ReportLog.Fail(a.Message + "\n" + a.StackTrace, ReportLog.TakeScreenShot("AddAnEventItemViaPortal", driver)); throw a; } driver.Quit(); } catch (Exception e) { // Test failed due to unforeseen exception. ReportLog.Fail(e.Message + "\n" + e.StackTrace, ReportLog.TakeScreenShot("UnforeseenException", driver)); throw e; } }
public void TC01Chrome() { Console.WriteLine("TC01 - Chrome - Verify that the data displayed on the Events page is the same data of the row that the button was clicked"); webDriver = new ChromeDriver(); webDriver.Manage().Window.Maximize(); MainPage mainpage = new MainPage(webDriver); Record Record3rd = new Record(); mainpage.Open(); webDriver.SwitchTo().Frame(0); Record3rd = mainpage.SearchDeviceByID("164800178").GetRecordByIndex(3); mainpage.ClickEventButton(3); webDriver.SwitchTo().Window(webDriver.WindowHandles[1].ToString()); EventsPage eventspage = new EventsPage(webDriver); string ActualResult = eventspage.LblRecoverData.Text; string ExpectedResult = "deviceid: " + Record3rd.DeviceID + "; obdvin: " + Record3rd.Vin + "; insertiontime: " + Record3rd.Insertiontime + "; odometer: " + Record3rd.Odometer + ";"; Assert.AreEqual(ExpectedResult, ActualResult); }
private void initPagesCollectionHelper(ProgressReportModel i_Report, Dictionary <EAppTab, SvgCachedImage> i_AppTabs) { updateReporter("Initializing app pages...", i_Report); PagesCollection = new Dictionary <EAppTab, Tuple <IBindable, SvgCachedImage> >(); updateReporter("Fetching Cameras...", i_Report); CamerasPage camerasPageInstance = new CamerasPage(); camerasPageInstance.RaiseContentViewUpdateEvent += OnContentViewUpdateEvent; PagesCollection.Add(EAppTab.SensorsPage, new Tuple <IBindable, SvgCachedImage>(camerasPageInstance, i_AppTabs[EAppTab.SensorsPage])); updateReporter("Fetching Settings...", i_Report); PagesCollection.Add(EAppTab.SettingsPage, new Tuple <IBindable, SvgCachedImage>(new SettingsPage(), i_AppTabs[EAppTab.SettingsPage])); PagesCollection.Add(EAppTab.HealthPage, new Tuple <IBindable, SvgCachedImage>(new HealthStatPage(), i_AppTabs[EAppTab.HealthPage])); updateReporter("Fetching Events...", i_Report); EventsPage eventsPageBuf = new EventsPage(); eventsPageBuf.RaiseContentViewUpdateEvent += OnContentViewUpdateEvent; PagesCollection.Add(EAppTab.EventsPage, new Tuple <IBindable, SvgCachedImage>(eventsPageBuf, i_AppTabs[EAppTab.EventsPage])); }
public void Events_02_AdvancedSearch() { UiTest(() => { _eventsPage = _myProfilePage.NavigateToEventsPage(); _advancedSearchPage = _eventsPage.ClickAdvancedSearch(); _advancedSearchPage.TypeInDateFrom(string.Format("{0:d}", DateTime.Now.AddYears(-1))); _advancedSearchPage.TypeInDateTo(string.Format("{0:d}", DateTime.Now.AddYears(1))); _advancedSearchPage.ChooseCategoriesAndRegions(new IWebElement[] { _advancedSearchPage.ConnectionsChb, _advancedSearchPage.ReliabilityChb, _advancedSearchPage.EnvironmentChb, _advancedSearchPage.EnglandChb }); _advancedSearchPage.ClickSearch(); Assert.That(_advancedSearchPage.EventNameTx.Displayed); Assert.That(_advancedSearchPage.EventDateTx.Displayed); Assert.That(_advancedSearchPage.EventDescriptionTx.Displayed); Assert.That(_advancedSearchPage.ContactOrganiserBtn.Displayed); Assert.That(_advancedSearchPage.ContactOrganiserBtn.Enabled); }); }
public void Events_04_RegisteredEvents() { UiTest(() => { string eventName; if (_myProfilePage.UpcomingEventsTx.Text.Contains("You are not currently registered to attend any events.")) { _eventsPage = _myProfilePage.ClickViewAllEventsBtn(); _eventsPage.ClickFutureEvent(); _eventRegisterationPage = _eventsPage.ClickRegisterNow(); _eventRegisterationPage.FillInRegistrationForm(); Assert.That(_eventRegisterationPage.ThankYouForRegisteringTx.Text, Is.EqualTo("Thank you for registering. You should receive an email shortly confirming this.")); eventName = _eventRegisterationPage.EventNameTx.Text; _eventRegisterationPage.NavigateToMyProfilePageWhenSignedIn(); Assert.That(_myProfilePage.EventHeadingTx.Text, Is.EqualTo(eventName)); _myProfilePage.ClickCancelRegistrationBtn(); } else { Assert.That(_myProfilePage.EventHeadingTx.Displayed); } }); }
public void Events_01_EventsCalendar() { UiTest(() => { _eventsPage = _myProfilePage.NavigateToEventsPage(); Assert.That(_eventsPage.Calendar.Displayed); Assert.That(_eventsPage.Calendar.Enabled); _eventsPage.ClickFutureEvent(); Assert.That(_eventsPage.GetStartDate().Displayed); Assert.That(_eventsPage.GetStartDate().Text, Is.Not.Empty); _eventRegisterationPage = _eventsPage.ClickRegisterNow(); Assert.That(_eventRegisterationPage.RegisterYourDetailsTx.Displayed); driver.Navigate().Back(); _advancedSearchPage = _eventsPage.ClickAdvancedSearch(); Assert.That(_advancedSearchPage.SearchResultsTx.Displayed); driver.Navigate().Back(); Assert.That(_eventsPage.Calendar.Displayed); }); }
public void ThenEventWithNameNotExists(string name) { var items = new EventsPage().GetEventsByName(name); Assert.IsFalse(items.Any()); }
public void ThenTheEventCannotBeSent() { _browser.Driver.WaitUntilVisible(EventsPage.ParticipantSendEventButton(_participantId)).Enabled.Should().BeFalse(); }
public void ThenTheTransferFromAndToInvalidErrorMessagesAreDisplayed() { _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferFromError(_participantId)).Displayed.Should().BeTrue(); _browser.Driver.WaitUntilVisible(EventsPage.ParticipantTransferToError(_participantId)).Displayed.Should().BeTrue(); }
public App() { InitializeComponent(); MainPage = new EventsPage(); }