Skip to content

Commit a500d4e

Browse files
Improve "user opens relative URL" step (#111)
1 parent c26ead2 commit a500d4e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
[1.9.4] - 2022-05-13
8+
### Changed
9+
- Improve "user opens relative URL" step
10+
711
[1.9.3] - 2022-05-12
812
### Changed
913
- Fix table rows count assertion message.

src/Behavioral.Automation/Behavioral.Automation.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The whole automation code is divided into the following parts:
1616
- UI structure descriptive code
1717
- Supportive code</Description>
1818
<Copyright>Quantori Inc.</Copyright>
19-
<PackageVersion>1.9.3</PackageVersion>
19+
<PackageVersion>1.9.4</PackageVersion>
2020
<RepositoryUrl>https://github.com/quantori/Behavioral.Automation</RepositoryUrl>
2121
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2222
<IncludeSymbols>true</IncludeSymbols>

src/Behavioral.Automation/Bindings/NavigationBInding.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ public NavigationBinding([NotNull] IDriverService driverService,
3333
[When("user opens URL \"(.*)\"")]
3434
public void Navigate([NotNull] string url)
3535
{
36-
_driverService.Navigate(url);
36+
if(IsAbsoluteUrl(url))
37+
{
38+
_driverService.Navigate(url);
39+
return;
40+
}
41+
_driverService.Navigate(ConfigServiceBase.BaseUrl + url);
3742
}
3843

3944
/// <summary>
@@ -136,5 +141,10 @@ public void ReloadCurrentPage()
136141
{
137142
_driverService.Refresh();
138143
}
144+
145+
private static bool IsAbsoluteUrl(string url)
146+
{
147+
return Uri.IsWellFormedUriString(url, UriKind.Absolute);
148+
}
139149
}
140150
}

0 commit comments

Comments
 (0)