-
Notifications
You must be signed in to change notification settings - Fork 7
Implemented JDISteps for UIElement. #334
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
Open
anna-belemenko17
wants to merge
3
commits into
master
Choose a base branch
from
Implement_BDD_steps
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{EC89BF8B-AC29-4E27-A8F4-6E356BC17778}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>JDI.BDD</RootNamespace> | ||
<AssemblyName>JDI.BDD</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
<NuGetPackageImportStamp> | ||
</NuGetPackageImportStamp> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="BoDi, Version=1.4.1.0, Culture=neutral, PublicKeyToken=ff7cd5ea2744b496, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\BoDi.1.4.1\lib\net45\BoDi.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Cucumber.Messages, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b10c5988214f940c, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Cucumber.Messages.6.0.1\lib\net45\Cucumber.Messages.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Gherkin, Version=6.0.0.0, Culture=neutral, PublicKeyToken=86496cfa5b4a5851, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Gherkin.6.0.0\lib\net45\Gherkin.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Google.Protobuf, Version=3.7.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Google.Protobuf.3.7.0\lib\net45\Google.Protobuf.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.ComponentModel.Composition" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath> | ||
<Private>True</Private> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.4.0\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="TechTalk.SpecFlow, Version=3.3.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\SpecFlow.3.3.16-beta\lib\net45\TechTalk.SpecFlow.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="StepDefs\JDISteps.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\JDI.Light\JDI.Light.csproj"> | ||
<Project>{abaf27b0-bfde-4fec-b93e-15b595fa77aa}</Project> | ||
<Name>JDI.Light</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="..\packages\SpecFlow.3.3.16-beta\build\SpecFlow.targets" Condition="Exists('..\packages\SpecFlow.3.3.16-beta\build\SpecFlow.targets')" /> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('..\packages\SpecFlow.3.3.16-beta\build\SpecFlow.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SpecFlow.3.3.16-beta\build\SpecFlow.targets'))" /> | ||
</Target> | ||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("JDI.BDD")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("EPAM Systems")] | ||
[assembly: AssemblyProduct("JDI.BDD")] | ||
[assembly: AssemblyCopyright("Copyright © EPAM Systems 2020")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("ec89bf8b-ac29-4e27-a8f4-6e356bc17778")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using JDI.Light.Elements.Init; | ||
using TechTalk.SpecFlow; | ||
using JDI.Light.Elements.Common; | ||
|
||
namespace JDI.BDD.StepDefs | ||
{ | ||
[Binding] | ||
public class CheckBoxSteps | ||
{ | ||
[When(@"I check (.*)")] | ||
public void Check(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Check(); | ||
} | ||
|
||
[When(@"I uncheck (.*)")] | ||
public void Uncheck(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Uncheck(); | ||
} | ||
|
||
[Then(@"the (.*) is checked")] | ||
public void IsChecked(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Is.Selected(); | ||
} | ||
|
||
[Then(@"the (.*) is not checked")] | ||
public void IsNotChecked(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Is.Deselected(); | ||
} | ||
|
||
[Then(@"the (.*) is enabled")] | ||
public void IsEnabled(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Is.Enabled(); | ||
} | ||
|
||
[Then(@"the (.*) is displayed")] | ||
public void IsDisplayed(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<CheckBox>(name).Is.Displayed(); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
using JDI.Light.Elements.Base; | ||
using JDI.Light.Elements.Init; | ||
using TechTalk.SpecFlow; | ||
using static JDI.Light.Jdi; | ||
using static JDI.Light.Matchers.StringMatchers.EqualToMatcher; | ||
using static JDI.Light.Matchers.StringMatchers.ContainsStringMatcher; | ||
|
||
namespace JDI.BDD.StepDefs | ||
{ | ||
[Binding] | ||
public class JDISteps | ||
{ | ||
|
||
#region WHEN | ||
[When(@"I send keys (.*) to (.*)")] | ||
public void SendKeys(string value, string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).SendKeys(value); | ||
} | ||
|
||
[When(@"I click on (.*)")] | ||
public void Click(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Click(); | ||
} | ||
|
||
[When(@"I highlight (.*)")] | ||
public void Highlight(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Highlight(); | ||
} | ||
|
||
[When(@"I set (.*) attribute (.*) with value (.*) element")] | ||
public void SetAttribute(string name, string attrName, string attrValue) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).SetAttribute(attrName, attrValue); | ||
} | ||
|
||
[When(@"I clear (.*)")] | ||
public void Clear(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Clear(); | ||
} | ||
|
||
[When(@"I submit (.*)")] | ||
public void Submit(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Submit(); | ||
} | ||
|
||
[When(@"I show (.*)")] | ||
public void Show(string name) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Show(); | ||
} | ||
|
||
#endregion | ||
|
||
[Then(@"the (.*) is disabled")] | ||
public void IsDisabled(string name) | ||
{ | ||
Assert.IsTrue(EntitiesCollection.GetWebElement<UIElement>(name).Disabled); | ||
} | ||
|
||
[Then(@"the (.*) is enabled")] | ||
public void IsEnabled(string name) | ||
{ | ||
Assert.IsTrue(EntitiesCollection.GetWebElement<UIElement>(name).Enabled); | ||
} | ||
|
||
[Then(@"the (.*) is enabled")] | ||
public void IsDisplayed(string name) | ||
{ | ||
Assert.IsTrue(EntitiesCollection.GetWebElement<UIElement>(name).Displayed); | ||
} | ||
|
||
[Then(@"the (.*) is hidden")] | ||
public void IsHidden(string name) | ||
{ | ||
Assert.IsTrue(EntitiesCollection.GetWebElement<UIElement>(name).Hidden); | ||
} | ||
|
||
[Then(@"the (.*) is selected")] | ||
public void IsSelected(string name) | ||
{ | ||
Assert.IsTrue(EntitiesCollection.GetWebElement<UIElement>(name).Selected); | ||
} | ||
|
||
[Then(@"the (.*) text equals to (.*)")] | ||
public void TextEquals(string name, string value) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Text(EqualTo(value)); | ||
} | ||
|
||
[Then(@"the (.*) text contains (.*)")] | ||
public void TextContains(string name, string value) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Text(ContainsString(value)); | ||
} | ||
|
||
[Then(@"the (.*) attribute (.*) equals to (.*)")] | ||
public void AttributeEquals(string name, string attrName, string attrValue) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Attr(attrName, EqualTo(attrValue)); | ||
} | ||
|
||
[Then(@"the (.*) attribute (.*) contains (.*)")] | ||
public void AttributeContains(string name, string attrName, string attrValue) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Attr(attrName, ContainsString(attrValue)); | ||
} | ||
|
||
[Then(@"the (.*) css (.*) equals to (.*)")] | ||
public void CssEquals(string name, string css, string cssValue) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Css(css, EqualTo(cssValue)); | ||
} | ||
|
||
[Then(@"the (.*) css (.*) contains (.*)")] | ||
public void CssContains(string name, string css, string cssValue) | ||
{ | ||
EntitiesCollection.GetWebElement<UIElement>(name).Is.Css(css, ContainsString(cssValue)); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="BoDi" version="1.4.1" targetFramework="net472" /> | ||
<package id="Cucumber.Messages" version="6.0.1" targetFramework="net472" /> | ||
<package id="Gherkin" version="6.0.0" targetFramework="net472" /> | ||
<package id="Google.Protobuf" version="3.7.0" targetFramework="net472" /> | ||
<package id="SpecFlow" version="3.3.16-beta" targetFramework="net472" /> | ||
<package id="System.IO" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Net.Http" version="4.3.4" targetFramework="net472" /> | ||
<package id="System.Reflection.Emit" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Runtime" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" /> | ||
<package id="System.Threading.Tasks.Extensions" version="4.4.0" targetFramework="net472" /> | ||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" /> | ||
</packages> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be it's better to use one .net version?