Test Generator

Code Generator for Producing Automation API Low-Level Tests as Source Code

Description

The Test Generator is responsible for converting the XML based Object Repository into test scripts representing Low-Level tests for an automation API. The conversion will be executed as a flush producing test scripts for all page objects specified in the Object Repository in one single operation.

Screenshot

Output

Following snippet shows an example of a generated Low-Level test script class...

using NUnit.Framework;
using Rojabo.Web.API;
using Rojabo.Web.API.Models;
using Rojabo.Web.API.Tests.Factories;

namespace Rojabo.Web.API.Tests
{
    [Category("Rojabo")]
    [Category("FillFormTests")]
    public class EventsNewPageFillFormTests : BaseTestFixture
    {
        private RojaboUserModel userModel = RojaboUserModelFactory.Default();
        private EventsNewPage frontPage;
        private EventsNewPageModel data = EventsNewPageFactory.ValidRandomData();

        protected override void OneTimeSetup()
        {
            LoginPage loginPage = new LoginPage(Controller.Driver);
            var basePage = loginPage.Login(userModel.LoginId, userModel.Password);
            frontPage = basePage.GetMainMenuPage().ActivateEvents()
                                                  .ActivateLinkNewEvent()
                                                  .FillForm(data);
        }

        [Test]
        public void FillForm_Property_EventName_Expected_To_Be_Equal_Data()
        {
            Assert.That(frontPage.GetEventName(), Is.EqualTo(data.EventName),
                "Property 'EventName' expected to be equal factory data");
        }

        [Test]
        public void FillForm_Property_EventYear_Expected_To_Be_Equal_Data()
        {
            Assert.That(frontPage.GetEventYear(), Is.EqualTo(data.EventYear),
                "Property 'EventYear' expected to be equal factory data");
        }

        [Test]
        public void FillForm_Property_EventMonth_Expected_To_Be_Equal_Data()
        {
            Assert.That(frontPage.GetEventMonth(), Is.EqualTo(data.EventMonth),
                "Property 'EventMonth' expected to be equal factory data");
        }

        [Test]
        public void FillForm_Property_EventDay_Expected_To_Be_Equal_Data()
        {
            Assert.That(frontPage.GetEventDay(), Is.EqualTo(data.EventDay),
                "Property 'EventDay' expected to be equal factory data");
        }

        [Test]
        public void FillForm_Property_EventType_Expected_To_Be_Equal_Data()
        {
            Assert.That(frontPage.GetEventType(), Is.EqualTo(data.EventType),
                "Property 'EventType' expected to be equal factory data");
        }
    }
}