Esempio n. 1
0
        public void Test_EditEvent_ValidData()
        {
            // Create an event for editing
            string eventName = "Best Show" + DateTime.Now.Ticks;

            this.CreateEvent(eventName);

            // Assert user is redirected to the "All Events" page
            var allEventsPage = new AllEventsPage(driver);

            Assert.IsTrue(allEventsPage.IsOpen(baseUrl));

            // Get the row with the new event
            var eventRowText = allEventsPage.GetEventRow(eventName);

            Assert.That(eventRowText.Contains(eventName));

            // Click on the "Edit" button of the new event
            allEventsPage.PressEventEditButton(eventName);

            // Assert the user is redirected to the "Edit Event" page
            var editPage = new EditPage(driver);

            Assert.IsTrue(editPage.IsOpen(baseUrl));
            Assert.AreEqual("Edit Event - Eventures App", editPage.GetPageTitle());
            Assert.AreEqual("Edit Event", editPage.GetPageHeadingText());
            Assert.IsTrue(editPage.Contains(eventName));

            // Change the name of the event
            var changedName = "Best Best Show" + DateTime.Now.Ticks;

            editPage.EditEventName(changedName);

            // Assert the user is redirected to the "All Events" page
            Assert.IsTrue(allEventsPage.IsOpen(baseUrl));

            // Assert that the page contains the new event name and not the old one
            Assert.IsTrue(allEventsPage.Contains(changedName));
            Assert.IsFalse(allEventsPage.Contains(eventName));
        }
Esempio n. 2
0
        public void Test_HomePage_AllEventsLink()
        {
            // Arrange: go to the "Home" page
            var homePage = new HomePage(driver);

            homePage.Open(baseUrl);

            // Act: click on the "All Events" page link
            homePage.AllEventsPageLink.Click();

            // Assert the user is redirected to the "All Events" page
            var allEventsPage = new AllEventsPage(driver);

            Assert.IsTrue(allEventsPage.IsOpen(baseUrl));
            Assert.AreEqual("All Events - Eventures App", allEventsPage.GetPageTitle());
            Assert.AreEqual("All Events", allEventsPage.GetPageHeadingText());
            Assert.That(allEventsPage.Contains("Create New"));
        }
Esempio n. 3
0
        public void Test_DeleteEvent()
        {
            // Arrange: create an event for deleting
            string eventName = "Best Show" + DateTime.Now.Ticks;

            this.CreateEvent(eventName);

            // Assert the user is redirected to the "All Events" page
            var allEventsPage = new AllEventsPage(driver);

            Assert.IsTrue(allEventsPage.IsOpen(baseUrl));

            // Get the row with the new event
            var eventRowText = allEventsPage.GetEventRow(eventName);

            Assert.That(eventRowText.Contains(eventName));

            // Click on the "Edit" button of the new event
            allEventsPage.PressEventDeleteButton(eventName);

            // Assert the user is redirected to the "Delete Event" page
            var deletePage = new DeletePage(driver);

            Assert.IsTrue(deletePage.IsOpen(baseUrl));
            Assert.AreEqual("Delete Event - Eventures App", deletePage.GetPageTitle());
            Assert.AreEqual("Delete Existing Event", deletePage.GetPageHeadingText());
            Assert.IsTrue(deletePage.Contains(eventName));

            // Act: click on the "Delete" button to confirm deletion
            deletePage.PressConfirmDeleteButton();

            // Assert the user is redirected to the "All Events" page
            Assert.IsTrue(allEventsPage.IsOpen(baseUrl));

            // Assert that the event doesn't appear on the page
            Assert.IsFalse(allEventsPage.Contains(eventName));
        }