Automation.Web.NUnit
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Automation.Web.NUnit --version 1.0.0
NuGet\Install-Package Automation.Web.NUnit -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="Automation.Web.NUnit" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Automation.Web.NUnit --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Automation.Web.NUnit, 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 Automation.Web.NUnit as a Cake Addin #addin nuget:?package=Automation.Web.NUnit&version=1.0.0 // Install Automation.Web.NUnit as a Cake Tool #tool nuget:?package=Automation.Web.NUnit&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Introduction
This is the web automation test library that can help use early to create an automation web test on many browsers and many OS without setup the corresponding webdriver such as ChromeDriver, FirefoxDriver or IEDriver. This library is still developing, so please keep looking. Thanks!
Getting Started
- Create your test project.
- Installation the nuget package:
Automation.Web.NUnit
- Create a
browsers.json
file as below in your test project and set it as aContent
in theBuild action
andCopy to Output Directory
. Notice thatExecutableBrowsers
is the browsers that will be executed in parallel when you run your test cases.Browsers
is the configuration of each browser that you wanna support.
{
"ExecutableBrowsers": [ "Chrome", "Firefox" ],
"Browsers": [
{
"Browser": "Chrome",
"Version": "Latest",
"IsHeadless": false,
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Browser": "Firefox",
"Version": "Latest",
"IsHeadless": false,
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Browser": "InternetExplorer",
"Platform": "X32",
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Browser": "Edge",
"Version": "83.0.478.37",
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Browser": "Opera",
"LogLevel": "Debug",
"Arguments": [],
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
},
{
"Browser": "Safari",
"LogLevel": "Debug",
"ImplicitTimeoutInSecond": 30,
"DefaultWaitTimeInSecond": 30
}
]
}
This configuration is based on your browser version & your expection browser behaviours.
- Add your test code. We recommend to use the Page Object Modle (POM) pattern in your UI test project. Below example is following the POM pattern.
- Define your page object models:
public class HomePage : PageBase
{
private readonly string url = @"https://www.google.com/";
public HomePage(IBrowser browser) : base(browser)
{
}
public void GoHere()
{
Browser.Navigation.GoToUrl(url);
Browser.WaitUntilTitleIs("Google");
}
public void GotoLogin()
{
LinkLogin.Click();
}
public void GotoGmail()
{
LinkGmail.Click();
}
public void Search(string text)
{
SearchInput.SendKeys(text);
//SearchInput.SendKeys(Keys.Enter);
SearchBtn.Click();
}
public bool IsDisplaying()
{
return Browser.WaitUntilTitleIs("Google");
}
public IWebElement SearchInput => Browser.FindElementByName("q");
public IWebElement SearchBtn => Browser.FindElementByName("btnK");
public IWebElement LinkGmail => Browser.FindElementByLinkText("Gmail");
public IWebElement LinkLogin => Browser.FindElementById("gb_70");
}
public class LoginPage : PageBase
{
public LoginPage(IBrowser browser) : base(browser)
{
}
public void WaitUntilReady()
{
Browser.WaitUntilElementExists("identifierId", SelectorType.Id);
}
public void Login(string username, string password)
{
UsernameInput.SendKeys(username);
NextBtn.Click();
PasswordInput.SendKeys(password);
PasswordNextBtn.Click();
}
public IWebElement UsernameInput => Browser.FindElementById("identifierId");
public IWebElement PasswordInput => Browser.FindElementByName("password");
public IWebElement NextBtn => Browser.FindElementById("identifierNext");
public IWebElement PasswordNextBtn => Browser.FindElementById("passwordNext");
}
public class GooglePages
{
public readonly HomePage HomePage;
public readonly LoginPage LoginPage;
public GooglePages(IBrowser browser)
{
HomePage = new HomePage(browser);
LoginPage = new LoginPage(browser);
}
}
- Create your scenario tests
public class LoginScenario : WebTestBase
{
private GooglePages pages;
public LoginScenario(BrowserType browserType) : base(browserType)
{
}
public override void SetUp()
{
base.SetUp();
pages = new GooglePages(Browser);
}
[Test]
public void LoginSuccess()
{
pages.HomePage.GoHere();
pages.HomePage.GotoLogin();
pages.LoginPage.Login("**************", "****************");
Assert.True(pages.HomePage.IsDisplaying());
}
}
- Run your test cases and see the magic^^
Contribute
Will update later.
Product | Versions 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.
-
.NETStandard 2.0
- Automation.Web.Core (>= 1.0.0)
- Microsoft.NET.Test.Sdk (>= 15.9.0)
- nunit (>= 3.11.0)
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 |
---|---|---|
2.5.1 | 99 | 4/29/2024 |
2.5.0 | 217 | 12/5/2023 |
2.5.0-preview.285 | 93 | 11/28/2023 |
2.4.0-preview.279 | 104 | 11/16/2023 |
2.4.0-preview.278 | 71 | 11/14/2023 |
2.3.4-preview.266 | 105 | 11/3/2023 |
2.3.3-preview.264 | 81 | 11/2/2023 |
2.3.3-preview.262 | 89 | 11/2/2023 |
2.3.2 | 230 | 11/2/2023 |
2.3.2-preview.257 | 87 | 11/2/2023 |
2.3.2-preview.256 | 88 | 11/2/2023 |
2.3.2-preview.254 | 81 | 10/31/2023 |
2.3.1 | 195 | 7/4/2023 |
2.3.0 | 172 | 6/21/2023 |
2.3.0-preview.227 | 146 | 6/21/2023 |
2.2.1-preview.224 | 79 | 6/20/2023 |
2.2.0 | 151 | 6/19/2023 |
2.2.0-preview.212 | 94 | 6/7/2023 |
2.1.0-preview.191 | 293 | 1/18/2023 |
2.1.0-preview.190 | 95 | 1/18/2023 |
2.1.0-preview.188 | 98 | 1/10/2023 |
2.1.0-preview.187 | 102 | 1/10/2023 |
2.1.0-preview.185 | 94 | 1/6/2023 |
2.1.0-preview.179 | 94 | 12/22/2022 |
2.0.0 | 284 | 12/21/2022 |
2.0.0-preview.172 | 93 | 12/21/2022 |
2.0.0-preview.166 | 92 | 12/21/2022 |
2.0.0-preview.164 | 92 | 12/19/2022 |
2.0.0-preview.157 | 94 | 12/14/2022 |
1.0.2-preview.132 | 309 | 5/27/2020 |
1.0.2-preview.130 | 232 | 5/27/2020 |
1.0.1 | 563 | 5/27/2020 |
1.0.1-preview.124 | 249 | 5/27/2020 |
1.0.1-preview.122 | 263 | 5/27/2020 |
1.0.0 | 538 | 5/25/2020 |