Skip to content

Commit 081c55f

Browse files
committed
WIP #54 - Fix missing quirks
However, I've regressed something in the process.
1 parent 06761fc commit 081c55f

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

CSF.Extensions.WebDriver.Tests/CSF.Extensions.WebDriver.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<ItemGroup>
3434
<Content Include="appsettings.*.json">
35-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
35+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3636
</Content>
3737
</ItemGroup>
3838

CSF.Extensions.WebDriver.Tests/Factories/WebDriverFactoryIntegrationTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ Quirks.QuirksData GetCommonBrowserQuirks()
8383
};
8484
}
8585

86-
IServiceProvider GetServiceProvider(Action<WebDriverCreationOptionsCollection>? configureOptions = null, Action<IServiceCollection>? extraRegistrations = null)
86+
IServiceProvider GetServiceProvider(Action<WebDriverCreationOptionsCollection>? configureOptions = null,
87+
Action<IServiceCollection>? extraRegistrations = null)
8788
{
8889
var services = new ServiceCollection();
8990
services.AddSingleton(GetConfiguration());
9091
services.AddWebDriverFactory(configureOptions: configureOptions);
92+
extraRegistrations?.Invoke(services);
9193
services.AddLogging();
9294
return services.BuildServiceProvider();
9395
}

CSF.Extensions.WebDriver.Tests/appsettings.WebDriverFactoryIntegrationTests.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
"DriverFactoryType": "CSF.Extensions.WebDriver.Factories.WebDriverFactoryIntegrationTests+FakeWebDriverFactory, CSF.Extensions.WebDriver.Tests"
2323
},
2424
"Chrome": {
25-
"DriverType": "ChromeDriver"
25+
"DriverType": "ChromeDriver",
26+
"AddBrowserQuirks": "True"
2627
},
2728
"Firefox": {
28-
"DriverType": "FirefoxDriver"
29+
"DriverType": "FirefoxDriver",
30+
"AddBrowserQuirks": "True"
2931
}
3032
},
3133
"SelectedConfiguration": "DefaultInvalid"

CSF.Extensions.WebDriver/Factories/WebDriverConfigurationItemParser.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public WebDriverCreationOptions GetDriverConfiguration(IConfigurationSection con
2424
OptionsType = configuration.GetValue<string>(nameof(WebDriverCreationOptions.OptionsType)),
2525
GridUrl = configuration.GetValue<string>(nameof(WebDriverCreationOptions.GridUrl)),
2626
DriverFactoryType = configuration.GetValue<string>(nameof(WebDriverCreationOptions.DriverFactoryType)),
27+
AddBrowserIdentification = configuration.GetValue<bool>(nameof(WebDriverCreationOptions.AddBrowserIdentification)),
28+
AddBrowserQuirks = configuration.GetValue<bool>(nameof(WebDriverCreationOptions.AddBrowserQuirks)),
2729
};
2830

2931
if(!TryGetDriverType(creationOptions, configuration, out var driverType))

0 commit comments

Comments
 (0)