Home

Awesome

Selenium Automation Framework

Frameworks provides base infrastrcutre for your acceptances tests. That will help to reduce start time and allows to separation of concerns from the very beggining.

The framework are available via nuget package: TODO

The default structure of the project:

QuickStarts:

   [TestFixture]
   public abstract class BaseAutomationTest : AutomationTest
   {
       public TestContext TestContext { get; set; }

       [SetUp]
       public void TestInitialize()
       {
           StartTest();
       }

       [TearDown]
       public void TearDown()
       {
           EndTest(() => NUnit.Framework.TestContext.CurrentContext.Result.Status == TestStatus.Failed);
       }
   }
   public class RepositoryView : View
   {
       public Element Description
       {
           get { return FindElement(By.ClassName("repository-description")); }
       }

       protected override By BaseBy
       {
           get { return By.ClassName("repohead"); }
       }
   }
public class SearchRepositoryScenario : Scenario
   {
       public RepositoryItemView Search(SearchRepositoryModel searchRepositoryModel)
       {
           var homeView = View<DefaultNavigationBarView>();

           homeView.Search.Type(searchRepositoryModel.Name);

           homeView.Search.PressEnter();

           var searchResults = Resolve<SearchResultsView>();

           RepositoryItemView view = searchResults.Repositories
               .Where(repository => repository.Name != null)
               .FirstOrDefault(repository => repository.Name.Text == searchRepositoryModel.Name);

           view
               .Should()
               .NotBeNull();

           return view;
       }
   }
   [TestFixture]
   public class RepositoriesReviewFeatureTest : BaseAutomationTest
   {
       [Test]
       public void Search_For_Automation_Framework_Repository()
       {
           Scenario<SearchRepositoryScenario>()
               .Search(Model<SearchRepositoryModel>());
       }
   }