Skip to content

Commit 0bdd86a

Browse files
Merge pull request #50 from AutomateThePlanet/ai-augmention-updates
AI Augmentation Updates and Fixes
2 parents da7ce6e + 8f301e0 commit 0bdd86a

File tree

11 files changed

+33
-15
lines changed

11 files changed

+33
-15
lines changed

.github/workflows/github-actions-tests-on-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
- name: Install dependencies
2323
run: dotnet restore
2424
- name: Build
25-
run: dotnet build --configuration Debug --no-restore --no-parallel
25+
run: dotnet build --configuration Debug --no-restore
2626
- name: Test
27-
run: dotnet test --no-build --no-restore --verbosity normal --filter Category=CI
27+
run: dotnet test --no-build --no-restore --verbosity normal --filter Category=CI

src/Bellatrix.KeyVault/SecretsResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static string GetSecret(Func<string> getConfigValue)
2525
{
2626
if (getConfigValue().StartsWith("env_"))
2727
{
28-
string environmentalVariable = Environment.GetEnvironmentVariable(getConfigValue().Replace("env_", string.Empty), EnvironmentVariableTarget.Machine);
28+
string environmentalVariable = Environment.GetEnvironmentVariable(getConfigValue().Replace("env_", string.Empty));
2929
return environmentalVariable;
3030
}
3131
else if (getConfigValue().StartsWith("vault_"))

src/Bellatrix.Playwright/components/common/Anchor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public virtual void Hover()
3939
}
4040

4141
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
42-
public virtual string Href => HttpUtility.HtmlDecode(HttpUtility.UrlDecode(GetAttribute("href")));
42+
public virtual string Href => new Uri(new Uri(WrappedBrowser.CurrentPage.Url), HttpUtility.HtmlDecode(HttpUtility.UrlDecode(GetAttribute("href")))).AbsoluteUri;
4343

4444
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
4545
public virtual string InnerText => GetInnerText();

src/Bellatrix.Playwright/proxy/ProxyService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void Start()
5151
{
5252
if (IsEnabled)
5353
{
54-
Console.WriteLine($"Start proxy on port {Port}");
54+
Console.WriteLine($"Start proxy on port {Port}");
5555
Console.WriteLine($"PROXY STARTED");
5656
OnRequestCaptureTraffic();
5757
OnResponseCaptureTraffic();
@@ -191,7 +191,7 @@ public void ShouldExecute()
191191
{
192192
if (!IsEnabled)
193193
{
194-
throw new ArgumentException("ProxyService is not enabled. To use open testFramework.json and set isEnabled = true of webProxySettings");
194+
throw new ArgumentException("ProxyService is not enabled. To use open testFrameworkSettings json and set ShouldCaptureHttpTraffic = true of webSettings");
195195
}
196196
}
197197

src/Bellatrix.Playwright/services/ProcessCleanupService.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ private static void KillAllProcessesStartedAfterTime(List<string> processesToKil
8080
{
8181
try
8282
{
83+
if (!OperatingSystem.IsWindows())
84+
{
85+
continue;
86+
}
87+
8388
var children = process.GetChildProcesses();
8489
foreach (var child in children)
8590
{
@@ -114,4 +119,4 @@ private static void KillProcessStartedAfterTime(List<string> processesToKill, Da
114119
}
115120
}
116121
}
117-
}
122+
}

src/Bellatrix.Playwright/syncplaywright/core/elements/WebElement.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,19 @@ internal WebElement(BrowserPage page, WebElement element)
3838
WrappedLocator = element.WrappedLocator;
3939
}
4040

41-
public ILocator WrappedLocator { get; set; }
41+
private ILocator _wrappedLocator;
42+
43+
public ILocator WrappedLocator
44+
{
45+
get
46+
{
47+
return _wrappedLocator.First;
48+
}
49+
set
50+
{
51+
_wrappedLocator = value;
52+
}
53+
}
4254

4355
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
4456
public virtual WebElement First => new WebElement(Page, WrappedLocator.First);
@@ -439,4 +451,4 @@ public virtual FrameElement LocateFrame(string selector)
439451
{
440452
return new FrameElement(Page, Locate(selector));
441453
}
442-
}
454+
}

src/Bellatrix.Web/findstrategies/FindAttributeContainingStrategy.cs

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

1515
namespace Bellatrix.Web;
1616

17-
public class FindAttributeContainingStrategy : FindXpathStrategy
17+
public class FindAttributeContainingStrategy : FindCssStrategy
1818
{
1919
private readonly string _attributeName;
2020
private readonly string _value;

src/Bellatrix.Web/proxy/ProxyService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void Start()
7474
{
7575
Port = GetFreeTcpPort();
7676
var explicitEndPoint = new ExplicitProxyEndPoint(IPAddress.Any, Port);
77-
Console.WriteLine($"Start proxy on port {Port}");
77+
Console.WriteLine($"Start proxy on port {Port}");
7878
ProxyServer.AddEndPoint(explicitEndPoint);
7979
ProxyServer.Start();
8080
Console.WriteLine($"PROXY STARTED");
@@ -225,7 +225,7 @@ public void ShouldExecute()
225225
{
226226
if (!IsEnabled)
227227
{
228-
throw new ArgumentException("ProxyService is not enabled. To use open testFramework.json and set isEnabled = true of webProxySettings");
228+
throw new ArgumentException("ProxyService is not enabled. To use open testFrameworkSettings json and set ShouldCaptureHttpTraffic = true of webSettings");
229229
}
230230
}
231231

templates/Bellatrix.Playwright.GettingStarted/19. Capture HTTP Traffic/CaptureHttpTrafficTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void CaptureTrafficTests()
5252
App.Proxy.AssertNoLargeImagesRequested();
5353

5454
// Check if some specific request is made.
55+
App.Browser.WaitForAjax();
5556
App.Proxy.AssertRequestMade("https://demos.bellatrix.solutions/wp-content/uploads/2018/04/cropped-bellatrix-logo.png");
5657
}
5758

templates/Bellatrix.Playwright.GettingStarted/testFrameworkSettings.Debug.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"waitUntilReadyOnElementFound": "false",
1111
"waitForAngular": "false",
1212
"shouldHighlightElements": "true",
13-
"shouldCaptureHttpTraffic": "false",
13+
"shouldCaptureHttpTraffic": "true",
1414
"pathToSslCertificate": "path",
1515
"shouldCheckForJavaScriptErrors": "false",
1616
"timeoutSettings": {
@@ -227,7 +227,7 @@
227227
"modelSettings": [
228228
{
229229
"endpoint": "env_AZURE_OPENAI_ENDPOINT",
230-
"key": "env_AZURE_OPENAI_KEY",
230+
"key": "env_AZURE_OPENAI_API_KEY",
231231
"deployment": "gpt-4o"
232232
},
233233
{

0 commit comments

Comments
 (0)