POM.Selenium 1.0.0

dotnet add package POM.Selenium --version 1.0.0
NuGet\Install-Package POM.Selenium -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="POM.Selenium" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add POM.Selenium --version 1.0.0
#r "nuget: POM.Selenium, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install POM.Selenium as a Cake Addin
#addin nuget:?package=POM.Selenium&version=1.0.0

// Install POM.Selenium as a Cake Tool
#tool nuget:?package=POM.Selenium&version=1.0.0

About

POM Selenium is a microframework and extensible wrapper for Selenium Webdriver which combines suitable patterns such as Page Object Models + Inversion of Control with Dependency Injection + Fluent Interface + Design by Contract, making web applications testing easy.

Features

πŸ™ŒNo need to write code: You'll find a set of generic methods that have been designed for general purposes.
πŸ— Auto-Generated Pages: create a configuration file, configure pages selectors and have your class files ready.
πŸ› οΈExtensible: Is something missing? Expand the functionality to your need.

Instalation

This package is also available on Nuget Packages: https://www.nuget.org/packages/POM.Selenium

Nuget

Install-Package POM.Selenium

.NET CLI

dotnet add package POM.Selenium

Getting Started

Setting up

The basic template for "Pages" setup is done through configuration file such as appsettings.json declaring a new section. Once it's done, the application will try to generate these pages based on the following convention:

appsettings.json file:

{
  "Pages": {
    "NugetPages": {
      "HomePage": { ... },
      "SignInPage": { ... },
      "PackagesPage": { ... }
    },
    "AmazonPages": {
      "LoginPage": { ... },
      "CartPage": { ... },
      "CustomerServicePage": { ... }
    }
  }
}

Program.cs file:

public class Program
{
    public static void Main(string[] args)
    {
        CreateHostBuilder(args).Build().Run();
    }

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureServices((hostContext, services) =>
            {
                // Adding POM.Selenium with auto generated pages - requires the first execution
                services.AddPomSelenium(autoGeneratePages:true);
                // Setting up IWebDriver for this test
                services.AddSingleton<IWebDriver, ChromeDriver>();
                // Setting up www.nuget.org testing pages
                services.AddTransient(s => s.AddPage<HomePage>());
                services.AddTransient(s => s.AddPage<SignInPage>());
                services.AddTransient(s => s.AddPage<PackagesPage>());
                // Setting up www.amazon.com testing pages
                services.AddTransient(s => s.AddPage<LoginPage>());
                services.AddTransient(s => s.AddPage<CartPage>());
                services.AddTransient(s => s.AddPage<CustomerServicePage>());
            });
}

Folder structure resulting:

[MyProject Folder]
β”œβ”€β”€ bin
β”œβ”€β”€ obj
β”œβ”€β”€ Pages
β”‚   β”œβ”€β”€ AmazonPages
β”‚   β”‚   β”œβ”€β”€ CartPage.cs
β”‚   β”‚   β”œβ”€β”€ CustomerServicePage.cs
β”‚   β”‚   └── LoginPage.cs
β”‚   └── NugetPages
β”‚       β”œβ”€β”€ HomePage.cs
β”‚       β”œβ”€β”€ PackagesPage.cs
β”‚       └── SignInPage.cs
β”œβ”€β”€ appsettings.json
β”œβ”€β”€ Program.cs
└── MyProject.csproj
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 438 1/24/2021