Fixtures

Fixtures used by all of the tests are defined in this section

Fixtures section

Base Fixture Configuration

BaseFixtureConfiguration is base class which configures and builds AtataContext with settings defined in settings.json file.

Driver Reuse TestFixture

DriverReuseTestFixture has a constructor which you can use to define if you want driver to start a new browser instance for each test or reuse the same instance.

Reusing browser instance is convenient because you can login once and then start all your tests after that.

Auto-Login TestFixture

AutoLoginTestFixture is used for tests which require login to happen first. Simply inherit from this fixture and then define your own tests. AutoLoginTestFixture inherits from DriverReuseTestFixture and reuses the same driver instance by default.

Save Cookies TestFixture

SaveCookiesTestFixture is used to save the cookies when you use the RememberMe functionality on the login page. Extracted cookies can be loaded into browser instance when needed on tests inheriting from this fixture.

Example of loading extracted cookies:

[Parallelizable(ParallelScope.Children)]
public class PasswordRecoveryPageTests : SaveCookiesTestFixture
{
    [Test]
    public void PasswordRecoveryCompletePage_Back_To_SelectUserPage_Should_Work()
    {
        AtataContext.Current.Driver.LoadExtractedCookies();
        Pages.PasswordRecoveryPage()
            .SendInstructionsToValidEmail()
            .BackToSelectUserPage();
    }
}

Last updated

Was this helpful?