Page Object Inheritance

How to implement base page object and inherit it.

Base Page Object

using Atata;

namespace SampleApp.UITests
{
    public class BasePage<TOwner> : Page<TOwner>
        where TOwner : BasePage<TOwner>
    {
        public TextInput<TOwner> SomeInput { get; private set; }

        public TOwner SomeMethod()
        {
            // TODO: Do something.

            return (TOwner)this;
        }
    }
}

Inherited Page Object

using Atata;

namespace SampleApp.UITests
{
    using _ = InheritedPage;

    public class InheritedPage : BasePage<_>
    {
        public TextInput<_> SomeOtherInput { get; private set; }
    }
}

Inherited Page Object with Extra Triggers

using Atata;

namespace SampleApp.UITests
{
    using _ = InheritedPage;

    [VerifyTitle("Some Title")]
    public class InheritedPage : BasePage<_>
    {
        protected override void OnInit()
        {
            base.OnInit();

            SomeInput.Triggers.Add(new PressEnterAttribute(TriggerEvents.AfterSet));
        }
    }
}

Base Page Object with Nested Custom Control

using Atata;

namespace SampleApp.UITests
{
    public class BasePage<TOwner> : Page<TOwner>
        where TOwner : BasePage<TOwner>
    {
        public FooterSection Footer { get; private set; }

        [ControlDefinition("footer")]
        public class FooterSection : Control<TOwner>
        {
        }
    }
}