Skip to content

Commit

Permalink
remove bodi dependancy
Browse files Browse the repository at this point in the history
  • Loading branch information
DeLaphante committed Sep 2, 2023
1 parent d962c92 commit 7b3f9d1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
15 changes: 6 additions & 9 deletions CynkyAutomation/Configuration/Hooks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BoDi;
using CynkyHook;
using CynkyHook;
using CynkyUtilities.ZephyrScale;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Drawing;
Expand All @@ -15,14 +14,12 @@ class Hooks
ZephyrClient _ZephyrClient;
FeatureContext _FeatureContext;
ScenarioContext _ScenarioContext;
IObjectContainer _IObjectContainer;

Hooks(IObjectContainer objectContainer)
Hooks(ScenarioContext scenarioContext)
{
_IObjectContainer = objectContainer;
_FeatureContext = objectContainer.Resolve<FeatureContext>();
_ScenarioContext = objectContainer.Resolve<ScenarioContext>();
_Config = objectContainer.Resolve<Config>();
_FeatureContext = scenarioContext.ScenarioContainer.Resolve<FeatureContext>();
_ScenarioContext = scenarioContext.ScenarioContainer.Resolve<ScenarioContext>();
_Config = scenarioContext.ScenarioContainer.Resolve<Config>();
_ZephyrClient = new ZephyrClient(ConfigManager.ZephyrBearerToken, ConfigManager.ZephyrServiceUrl, ConfigManager.ZephyrProjectKey);
}

Expand All @@ -35,7 +32,7 @@ static void InitializeReport()
[BeforeScenario]
void Launch()
{
_Config.Launch(_IObjectContainer, _FeatureContext, _ScenarioContext,
_Config.Launch(_FeatureContext, _ScenarioContext,
ConfigManager.RS_User, ConfigManager.RS_Key, new Size());
}

Expand Down
7 changes: 3 additions & 4 deletions CynkyAutomation/CynkyAutomation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BoDi" Version="1.5.0" />
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand All @@ -34,15 +33,15 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.ML" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MongoDB.Bson" Version="2.21.0" />
<PackageReference Include="MongoDB.Driver" Version="2.21.0" />
<PackageReference Include="MongoDB.Driver.Core" Version="2.21.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="RazorEngine.NetCore" Version="3.1.0" />
<PackageReference Include="Selenium.Support" Version="4.11.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.11.0" />
<PackageReference Include="Selenium.Support" Version="4.12.2" />
<PackageReference Include="Selenium.WebDriver" Version="4.12.2" />
<PackageReference Include="SpecFlow" Version="3.9.74" />
<PackageReference Include="SpecFlow.MsTest" Version="3.9.74" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
Expand Down
Binary file modified CynkyAutomation/CynkyHook.dll
Binary file not shown.
11 changes: 5 additions & 6 deletions CynkyAutomation/StepDefinitions/API/Booking_APISteps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using BoDi;
using CynkyAutomation.EndpointBuilder;
using CynkyAutomation.JsonBuilder.BookingService;
using CynkyAutomation.Models.API.Request;
Expand All @@ -19,12 +18,12 @@ public class BookingStepDefinitions
Headers _Headers;
ScenarioContext _ScenarioContext;

public BookingStepDefinitions(IObjectContainer objectContainer)
public BookingStepDefinitions(ScenarioContext scenarioContext)
{
_Request = objectContainer.Resolve<Request>();
_Response = objectContainer.Resolve<Response>();
_Headers = objectContainer.Resolve<Headers>();
_ScenarioContext = objectContainer.Resolve<ScenarioContext>();
_Request = scenarioContext.ScenarioContainer.Resolve<Request>();
_Response = scenarioContext.ScenarioContainer.Resolve<Response>();
_Headers = scenarioContext.ScenarioContainer.Resolve<Headers>();
_ScenarioContext = scenarioContext.ScenarioContainer.Resolve<ScenarioContext>();
}

[StepDefinition(@"an auth token is received")]
Expand Down
7 changes: 3 additions & 4 deletions CynkyAutomation/StepDefinitions/UI/Common/Common_UISteps.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BoDi;
using CynkyAutomation.PageObjects.CommonPages;
using CynkyAutomation.PageObjects.CommonPages;
using TechTalk.SpecFlow;

namespace CynkyAutomation.StepDefinitions.UI.Common
Expand All @@ -9,9 +8,9 @@ public class Common_UISteps
{
Navigation _Navigation;

public Common_UISteps(IObjectContainer objectContainer)
public Common_UISteps(ScenarioContext scenarioContext)
{
_Navigation = objectContainer.Resolve<Navigation>();
_Navigation = scenarioContext.ScenarioContainer.Resolve<Navigation>();
}

[StepDefinition(@"user is on the Orange HRM homepage")]
Expand Down
15 changes: 7 additions & 8 deletions CynkyAutomation/StepDefinitions/UI/OrangeHRM_UISteps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using BoDi;
using CynkyAutomation.Models.UI;
using CynkyAutomation.PageObjects.OrangeHRM;
using FluentAssertions;
Expand All @@ -18,14 +17,14 @@ public class OrangeHRM_UISteps
SideNavBar _SideNavBar;
ScenarioContext _ScenarioContext;

public OrangeHRM_UISteps(IObjectContainer objectContainer)
public OrangeHRM_UISteps(ScenarioContext scenarioContext)
{
_MyInfoPage = objectContainer.Resolve<MyInfoPage>();
_HRMLoginPage = objectContainer.Resolve<HRMLoginPage>();
_PIMPage = objectContainer.Resolve<PIMPage>();
_TopNavBar = objectContainer.Resolve<TopNavBar>();
_SideNavBar = objectContainer.Resolve<SideNavBar>();
_ScenarioContext = objectContainer.Resolve<ScenarioContext>();
_MyInfoPage = scenarioContext.ScenarioContainer.Resolve<MyInfoPage>();
_HRMLoginPage = scenarioContext.ScenarioContainer.Resolve<HRMLoginPage>();
_PIMPage = scenarioContext.ScenarioContainer.Resolve<PIMPage>();
_TopNavBar = scenarioContext.ScenarioContainer.Resolve<TopNavBar>();
_SideNavBar = scenarioContext.ScenarioContainer.Resolve<SideNavBar>();
_ScenarioContext = scenarioContext.ScenarioContainer.Resolve<ScenarioContext>();
}

[StepDefinition(@"user with the following details logs in:")]
Expand Down

0 comments on commit 7b3f9d1

Please sign in to comment.