1.3. Automation Tests - deftpack/testautomation GitHub Wiki

All the test classes should inherit from DeftPack.TestAutomation.Functional.Framework.AutomationTestSuite which will make the framework available. Another important prerequisite is that the tests itself should be decorated with the AutomationTest attribute that has two constructor parameters. The first one is the human readable name of the test, the second is a short description of the test. Both of them will be used during the report generation.

using DeftPack.TestAutomation.Functional.Framework;

public class RegistrationTests : AutomationTestSuite
{
    [AutomationTest("Fail To Register", 
        "Test register user journey with invalid details")]
    public void FailToRegister()
    {
        // Implementation
    }
}

These classes relies on NUnit beneath, so you will need the specific test runner for NUnit.

To navigate to a starting point, just call the StartAtUrl with the address as a parameter. The test actions and test functions can be executed with the Evaluate generic method, and pass the constructor parameters in, excluding the views which will be resolved by the framework. When you referencing a test function type, it will also return the generated model.

public void FailToRegister()
{
    StartAtUrl("https://testsite.co.uk");
    var searchResults = Evaluate<Search>("search expression");
    Evaluate<FailToRegister>(new RegisterModel { 
        EmailAddress = "test1234", 
        Password = "1234", 
        UserName = "test" });
}
⚠️ **GitHub.com Fallback** ⚠️