diff --git a/CHANGELOG.md b/CHANGELOG.md index cf6b88f9..c1f2280c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +[1.9.4] - 2022-05-13 +### Changed +- Improve "user opens relative URL" step + [1.9.3] - 2022-05-12 ### Changed - Fix table rows count assertion message. diff --git a/src/Behavioral.Automation/Behavioral.Automation.csproj b/src/Behavioral.Automation/Behavioral.Automation.csproj index de377920..8c8a4b71 100644 --- a/src/Behavioral.Automation/Behavioral.Automation.csproj +++ b/src/Behavioral.Automation/Behavioral.Automation.csproj @@ -16,7 +16,7 @@ The whole automation code is divided into the following parts: - UI structure descriptive code - Supportive code Quantori Inc. - 1.9.3 + 1.9.4 https://github.com/quantori/Behavioral.Automation true true diff --git a/src/Behavioral.Automation/Bindings/NavigationBInding.cs b/src/Behavioral.Automation/Bindings/NavigationBInding.cs index 2aecd74e..5cda7438 100644 --- a/src/Behavioral.Automation/Bindings/NavigationBInding.cs +++ b/src/Behavioral.Automation/Bindings/NavigationBInding.cs @@ -33,7 +33,12 @@ public NavigationBinding([NotNull] IDriverService driverService, [When("user opens URL \"(.*)\"")] public void Navigate([NotNull] string url) { - _driverService.Navigate(url); + if(IsAbsoluteUrl(url)) + { + _driverService.Navigate(url); + return; + } + _driverService.Navigate(ConfigServiceBase.BaseUrl + url); } /// @@ -136,5 +141,10 @@ public void ReloadCurrentPage() { _driverService.Refresh(); } + + private static bool IsAbsoluteUrl(string url) + { + return Uri.IsWellFormedUriString(url, UriKind.Absolute); + } } } \ No newline at end of file