Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bellatrix playwright upgrade #42

Merged
merged 77 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
78ed32e
updates to API module and package upgrades
MiriamKyoseva Mar 8, 2024
e11091a
added playwright module
MiriamKyoseva Mar 8, 2024
e0b7cc7
Added license info to playwright module
MiriamKyoseva Mar 11, 2024
64fd6c1
Added information for the NativeElementFinderService FindAll() method
MiriamKyoseva Mar 11, 2024
3c58ff9
Added information for private method ParseBooleans(object obj) in Wra…
MiriamKyoseva Mar 11, 2024
563004a
Updates to BrowserService
MiriamKyoseva Mar 11, 2024
d180dd1
Changed the inner logic in Navigate(string url) method in NavigationS…
MiriamKyoseva Mar 11, 2024
77472fe
Small changes to some classes
MiriamKyoseva Mar 11, 2024
ec5b749
Added ignore null value to the lighthouse report deserialization
MiriamKyoseva Mar 14, 2024
48126e7
changes to property names in Capabilities
MiriamKyoseva Mar 14, 2024
cb308df
new Attributes
MiriamKyoseva Mar 14, 2024
7191d15
Create CloudProviderCredentialsResolver.cs
MiriamKyoseva Mar 14, 2024
c5722f6
Update BrowserLifecyclePlugin.cs
MiriamKyoseva Mar 14, 2024
94cee2f
Update BrowserService.cs
MiriamKyoseva Mar 14, 2024
fd836b1
Update WrappedBrowserCreateService.cs
MiriamKyoseva Mar 14, 2024
b00e7f3
Update BrowserConfiguration.cs
MiriamKyoseva Mar 14, 2024
f4953b5
Update LighthouseService.cs
MiriamKyoseva Mar 14, 2024
2a4af4c
Update App.cs
MiriamKyoseva Mar 14, 2024
cf3c1da
Changed the DebuggerDisplay attribute and implemented TagName property
MiriamKyoseva Mar 14, 2024
54dad1e
Renamed RadioButton Check() method back to Click()
MiriamKyoseva Mar 14, 2024
329caa9
Implemented angular find strategies
MiriamKyoseva Mar 14, 2024
00ab88f
Added GettingStarted for Playwright
MiriamKyoseva Mar 14, 2024
692fce1
Update JavaScriptService.cs
MiriamKyoseva Mar 14, 2024
7f8422e
Created a Wrapper for ILocator and IFrameLocator
MiriamKyoseva Mar 14, 2024
4818bf7
Renamed interface Options to IOptions
MiriamKyoseva Mar 20, 2024
8b4caae
Added new wrappers for Playwright IBrowser, IPlaywright, IBrowserCont…
MiriamKyoseva Mar 20, 2024
9492fb9
Moved the options to another folder in SyncPlaywright as they are use…
MiriamKyoseva Mar 20, 2024
c809516
Made the module to use SyncPlaywright objects as to move the async to…
MiriamKyoseva Mar 20, 2024
a7e3459
Updated Bellatrix.Playwright.GettingStarted 04
MiriamKyoseva Mar 20, 2024
4d92284
Moved Bellatrix.Playwright.GettingStarted module
MiriamKyoseva Mar 27, 2024
4d55913
Moved files to the correct 'templates' folder and removed 'Templates'…
MiriamKyoseva Mar 28, 2024
1d2dd6d
Refactored Select component, Option component, and added component Mu…
MiriamKyoseva Mar 28, 2024
0ff3bb4
Renamed method Convert() of the find strategies to Resolve()
MiriamKyoseva Mar 28, 2024
7704c23
Renamed method GetAndWaitWebDriverElements() to GetAndWaitWebElements…
MiriamKyoseva Mar 28, 2024
b5af372
Added logic for index in the NativeElementFinderService
MiriamKyoseva Mar 28, 2024
fb105c8
Update DisposeBrowserService.cs
MiriamKyoseva Mar 28, 2024
288f131
Removed the logic for re-finding elements, as the ILocator does it be…
MiriamKyoseva Mar 28, 2024
5e8db0e
Renamed Highligh() method to JsHighlight() method, as to not clash wi…
MiriamKyoseva Mar 28, 2024
7627f5f
Update BrowserConfiguration.cs
MiriamKyoseva Mar 28, 2024
47ca1d8
Update WrappedBrowserCreateService.cs
MiriamKyoseva Mar 28, 2024
de20e33
Minor reformatting
MiriamKyoseva Mar 28, 2024
bd1f62a
Made available setting the options for actions performed on elements
MiriamKyoseva Mar 29, 2024
0a7be4a
Added new property for Frame component
MiriamKyoseva Mar 29, 2024
06ebf6d
Lighthouse Reports Workflow Plugins update
MiriamKyoseva Mar 29, 2024
47aa7c5
Fixes to DefaultClick
MiriamKyoseva Apr 8, 2024
2397ac8
Renamed BrowserChoice to BrowserTypes
MiriamKyoseva Apr 8, 2024
18030cc
Changed the iframe switching logic
MiriamKyoseva Apr 8, 2024
25e42ff
Update FindTagStrategy.cs
MiriamKyoseva Apr 8, 2024
9f63d68
Create IFrameAndShadowDOMTests.cs
MiriamKyoseva Apr 8, 2024
a5e56d3
Fixed Wait strategies
MiriamKyoseva Apr 10, 2024
5746d87
Renamed method
MiriamKyoseva Apr 10, 2024
61680fe
Added support for playwright browser context options
MiriamKyoseva Apr 10, 2024
0b66294
Update Component.DefaultActions.cs
MiriamKyoseva Apr 11, 2024
f64b252
Updated DialogService; Added custom timeout for actions that will tri…
MiriamKyoseva Apr 11, 2024
ba07774
Moved some files in syncplaywright
MiriamKyoseva Apr 12, 2024
3c25f84
Update JavaScriptService.cs
MiriamKyoseva Apr 12, 2024
ae1cd36
Moved the async to sync conversion logic from InteractionsService to…
MiriamKyoseva Apr 12, 2024
8759d8a
Update Frame.cs
MiriamKyoseva Apr 12, 2024
b733898
Changed some of the BrowserPage events
MiriamKyoseva Apr 12, 2024
bab78a5
Updated Azure.Identity in Bellatrix.KeyVault from v1.10.4 to v1.11.0,…
MiriamKyoseva Apr 15, 2024
c88e23c
Added DebuggerBrowsableState.Never to all properties referencing an e…
MiriamKyoseva Apr 15, 2024
fc815e7
Made synchronous wrappers for native playwright assertions
MiriamKyoseva Apr 15, 2024
f85aa0d
moved file from 'Templates' to 'templates'
MiriamKyoseva Apr 15, 2024
6ebf510
Create EventHandlerUtilities.cs
MiriamKyoseva Apr 16, 2024
f864ed1
Added BrowserPage.Events
MiriamKyoseva Apr 16, 2024
428779c
Added BrowserContext.Events
MiriamKyoseva Apr 16, 2024
0bd70b7
Update DialogService.cs
MiriamKyoseva Apr 16, 2024
779cb46
Merge branch 'bellatrix-playwright-upgrade' of https://github.com/Aut…
MiriamKyoseva Apr 18, 2024
002e76f
Resolved merge conflicts
MiriamKyoseva Apr 18, 2024
3676333
Resolved merge conflicts
MiriamKyoseva Apr 18, 2024
94d30b0
Re-Added Bellatrix.Web.Tests.csproj
MiriamKyoseva Apr 18, 2024
4895192
removed duplicate Bellatrix.Mobile.IOS.Tests.csproj
MiriamKyoseva Apr 18, 2024
dda78f4
Removed duplicate Bellatrix.Mobile.Android.Tests.csproj
MiriamKyoseva Apr 18, 2024
3c95bb1
removed duplicate Bellatrix.Desktop.Tests.csproj
MiriamKyoseva Apr 18, 2024
5009773
Removed duplicate Bellatrix.API.Tests.csproj
MiriamKyoseva Apr 18, 2024
47f8c86
fixed indentation
MiriamKyoseva Apr 18, 2024
a21c43c
Updated MSTest version in Bellatrix.Web.Tests
MiriamKyoseva Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
322 changes: 322 additions & 0 deletions BellatrixTestFramework.sln

Large diffs are not rendered by default.

68 changes: 46 additions & 22 deletions src/Bellatrix.Api/ApiClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// <site>https://bellatrix.solutions/</site>
using System;
using System.Diagnostics;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Bellatrix.Api.Configuration;
Expand All @@ -31,27 +32,11 @@ public class ApiClientService
private readonly ApiSettings _apiSettings = ConfigurationService.GetSection<ApiSettings>();

// TODO: is this going to be accessible in the service container?
public ApiClientService(string baseUrl = null)
public ApiClientService(string baseUrl = null, CookieContainer cookieContainer = null)
{
_executionProvider = new ExecutionProvider();
InitializeExecutionExtensions(_executionProvider);

var options = new RestClientOptions
{
BaseUrl = baseUrl is not null ? new Uri(baseUrl) : null,
FollowRedirects = true
};

_executionProvider.OnClientInitialized(WrappedClient);
var authenticator = ServicesCollection.Current.Resolve<IAuthenticator>();
if (authenticator != null)
{
options.Authenticator = authenticator;
}
WrappedClient = new RestClient(
options,
configureSerialization: s => s.UseNewtonsoftJson()
);
////WrappedClient.AddHandler("application/json", () => NewtonsoftJsonSerializer.Default);
////WrappedClient.AddHandler("text/json", () => NewtonsoftJsonSerializer.Default);
////WrappedClient.AddHandler("text/x-json", () => NewtonsoftJsonSerializer.Default);
Expand All @@ -63,6 +48,8 @@ public ApiClientService(string baseUrl = null)
MaxRetryAttempts = _apiSettings.MaxRetryAttempts;
PauseBetweenFailures = Utilities.TimeSpanConverter.Convert(_apiSettings.PauseBetweenFailures, _apiSettings.TimeUnit);

InitializeNewRestClient(baseUrl, cookieContainer);

int timeoutSeconds = _apiSettings.ClientTimeoutSeconds;
Policy.Timeout(timeoutSeconds, onTimeout: (context, timespan, task) =>
{
Expand All @@ -83,11 +70,23 @@ public ApiClientService(string baseUrl = null)

public int MaxRetryAttempts { get; set; }

////public Uri BaseUrl
////{
//// get => WrappedClient.Ur.AbsoluteUri;
//// set => WrappedClient.BaseUrl = new Uri(value);
////}
public CookieContainer CookieContainer
{
get => WrappedClient.Options.CookieContainer;
set
{
InitializeNewRestClient(WrappedClient.Options.BaseUrl.AbsoluteUri, value);
}
}

public Uri BaseUrl
{
get => WrappedClient.Options.BaseUrl;
set
{
InitializeNewRestClient(value.AbsoluteUri, WrappedClient.Options.CookieContainer);
}
}

public TimeSpan PauseBetweenFailures { get; set; }

Expand Down Expand Up @@ -348,4 +347,29 @@ private void SetJsonContent(RestRequest request, object obj = null)
request.AddJsonBody(obj);
}
}

private void InitializeNewRestClient(string baseUrl = null, CookieContainer cookieContainer = null)
{
var options = new RestClientOptions
{
BaseUrl = baseUrl is not null ? new Uri(baseUrl) : null,
FollowRedirects = true
};

if (cookieContainer is not null)
{
options.CookieContainer = cookieContainer;
}

_executionProvider.OnClientInitialized(WrappedClient);
var authenticator = ServicesCollection.Current.Resolve<IAuthenticator>();
if (authenticator != null)
{
options.Authenticator = authenticator;
}
WrappedClient = new RestClient(
options,
configureSerialization: s => s.UseNewtonsoftJson()
);
}
}
2 changes: 1 addition & 1 deletion src/Bellatrix.Api/Bellatrix.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="MSTest" Version="3.2.0" />
<PackageReference Include="MSTest" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Bellatrix.Core/Bellatrix.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="MSTest" Version="3.2.0" />
<PackageReference Include="MSTest" Version="3.2.2" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="Unity" Version="5.11.10" />
<!--<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />-->
Expand Down
2 changes: 1 addition & 1 deletion src/Bellatrix.Desktop/Bellatrix.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.WinAppDriver.Appium.WebDriver" Version="1.0.1-Preview" />
<PackageReference Include="MSTest" Version="3.2.0" />
<PackageReference Include="MSTest" Version="3.2.2" />

<!--Do not Update to 3.14.0, it has bugs incompatible with Appium.WebDriver 3.0.0.1-->
<!--<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />-->
Expand Down
2 changes: 1 addition & 1 deletion src/Bellatrix.KeyVault/Bellatrix.KeyVault.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\shared\SharedAssemblyInfo.targets" />
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Azure.Identity" Version="1.11.0" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Bellatrix.Mobile/Bellatrix.Mobile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.5" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="MSTest" Version="3.2.0" />
<PackageReference Include="MSTest" Version="3.2.2" />
<PackageReference Include="Selenium.WebDriver" Version="4.17.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
Expand Down
24 changes: 24 additions & 0 deletions src/Bellatrix.Playwright/Bellatrix.Playwright.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configurations>DEBUG;STAGE;QA;LOCAL</Configurations>
</PropertyGroup>

<Import Project="..\..\shared\SharedAssemblyInfo.targets" />

<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Microsoft.Playwright" Version="1.40.0" />
<PackageReference Include="Microsoft.Playwright.NUnit" Version="1.40.0" />
<PackageReference Include="MSTest" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Bellatrix.Api\Bellatrix.API.csproj" />
<ProjectReference Include="..\Bellatrix.AWS\Bellatrix.AWS.csproj" />
<ProjectReference Include="..\Bellatrix.CognitiveServices\Bellatrix.CognitiveServices.csproj" />
<ProjectReference Include="..\Bellatrix.Core\Bellatrix.Core.csproj" />
<ProjectReference Include="..\Bellatrix.Layout\Bellatrix.Layout.csproj" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/Bellatrix.Playwright/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
global using Microsoft.Playwright;
global using static Microsoft.Playwright.Assertions;
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.IO;
global using Bellatrix.Playwright.SyncPlaywright;
Loading
Loading