-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathServiceTest.cs
More file actions
51 lines (44 loc) · 1.38 KB
/
ServiceTest.cs
File metadata and controls
51 lines (44 loc) · 1.38 KB
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
45
46
47
48
49
50
51
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using SeleniumDocs.TestSupport;
namespace SeleniumDocs.Drivers
{
[TestClass]
public class ServiceTest : BaseTest
{
[TestMethod]
public void BasicService()
{
var service = ChromeDriverService.CreateDefaultService();
driver = new ChromeDriver(service);
}
[TestMethodCustom]
[EnabledOnOs("OSX")]
public async Task DriverLocation()
{
var options = GetLatestChromeOptions();
var service = ChromeDriverService.CreateDefaultService(await GetDriverLocationAsync(options));
driver = new ChromeDriver(service, options);
}
[TestMethod]
public void DriverPort()
{
var service = ChromeDriverService.CreateDefaultService();
service.Port = 1234;
driver = new ChromeDriver(service);
}
private static async Task<string> GetDriverLocationAsync(ChromeOptions options)
{
return await new DriverFinder(options).GetDriverPathAsync();
}
private static ChromeOptions GetLatestChromeOptions()
{
return new ChromeOptions
{
BrowserVersion = "stable"
};
}
}
}