forked from nikolay-advolodkin/dot-net-sauce
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathAxeAccesibility.cs
44 lines (41 loc) · 1.39 KB
/
AxeAccesibility.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using Selenium.Axe;
namespace Core.Selenium.Examples
{
[TestClass]
public class AxeAccesibility
{
IWebDriver _webDriver;
public TestContext TestContext { get; set; }
[TestMethod]
public void AccessibilityTest()
{
var browserOptions = new ChromeOptions
{
PlatformName = "Windows 10",
BrowserVersion = "latest"
};
var sauceOptions = new Dictionary<string, object>
{
{ "name", TestContext.TestName },
{ "username", Environment.GetEnvironmentVariable("SAUCE_USERNAME") },
{ "accessKey", Environment.GetEnvironmentVariable("SAUCE_ACCESS_KEY") }
};
browserOptions.AddAdditionalOption("sauce:options", sauceOptions);
_webDriver = new RemoteWebDriver(new Uri("https://ondemand.us-west-1.saucelabs.com/wd/hub"), browserOptions);
_webDriver.Navigate().GoToUrl("https://www.saucedemo.com");
var results = _webDriver.Analyze();
Assert.IsNull(results.Error);
}
[TestCleanup]
public void Teardown()
{
_webDriver?.Quit();
}
}
}