Skip to content

Commit

Permalink
Merge pull request #90 from ObjectivityLtd/RemoveDesiredCapabilities
Browse files Browse the repository at this point in the history
Remove desired capabilities
  • Loading branch information
raczeja authored Dec 17, 2018
2 parents 3d4b3d2 + 85df536 commit b9d3045
Show file tree
Hide file tree
Showing 34 changed files with 1,220 additions and 1,130 deletions.
141 changes: 57 additions & 84 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,26 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>

<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
</PropertyGroup>

<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://www.nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
</PropertyGroup>

<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>

<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>

<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>

<NuGetExePath>$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<PackageSources>""</PackageSources>

<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
<RestoreCommand>"$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" > NUL</RestoreCommand>
<BuildCommand>"$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
Expand All @@ -79,36 +35,18 @@
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>

<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition="!Exists('$(NuGetExePath)')" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
Condition="Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
LogStandardErrorAsError="true" />
</Target>

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
Expand All @@ -117,28 +55,63 @@
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.IO.Packaging" />
<Using Namespace="System.Linq" />
<Using Namespace="System.Net" />
<Using Namespace="System.Xml" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
string zipTempPath = null;
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
if (File.Exists(OutputFilename)) {
return true;
}
Log.LogMessage("Determining latest version of NuGet.CommandLine...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
XmlDocument xml = new XmlDocument();
xml.LoadXml(webClient.DownloadString("http://nuget.org/v1/FeedService.svc/Packages()?$filter=tolower(Id)%20eq%20'nuget.commandline'&$top=1&$orderby=Version%20desc"));
XmlNamespaceManager xns = new XmlNamespaceManager(xml.NameTable);
xns.AddNamespace("atom", "http://www.w3.org/2005/Atom");
xns.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices");
xns.AddNamespace("m", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
string version = xml.SelectSingleNode("//atom:entry/m:properties/d:Version", xns).InnerText;
string zipUrl = xml.SelectSingleNode("//atom:entry/atom:content", xns).Attributes["src"].Value;
Log.LogMessage("Downloading NuGet.CommandLine v{0}...", version);
zipTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
webClient.DownloadFile(zipUrl, zipTempPath);
Log.LogMessage("Copying to {0}...", OutputFilename);
using (Package package = Package.Open(zipTempPath)) {
PackagePart exePart = package.GetParts().Where(p => p.Uri.ToString().ToLowerInvariant() == "/tools/nuget.exe").Single();
using (Stream inputStream = exePart.GetStream(FileMode.Open, FileAccess.Read))
using (Stream outputStream = File.Create(OutputFilename)) {
byte[] buffer = new byte[16384];
while (true) {
int read = inputStream.Read(buffer, 0, buffer.Length);
if (read == 0) {
break;
}
outputStream.Write(buffer, 0, read);
}
}
}
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
finally {
if (zipTempPath != null) File.Delete(zipTempPath);
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
</Project>
4 changes: 2 additions & 2 deletions .nuspec/Objectivity.Test.Automation.Features.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<tags>selenium webdriver testautomation tests specflow Objectivity.Test.Automation.Common template</tags>
<dependencies>
<dependency id="SpecFlow" version="2.2.0"/>
<dependency id="NUnit" version="3.10.1" />
<dependency id="NUnit.ConsoleRunner" version="3.7.0" />
<dependency id="NUnit" version="3.11.0" />
<dependency id="NUnit.ConsoleRunner" version="3.9.0" />
</dependencies>
</metadata>
<files>
Expand Down
8 changes: 4 additions & 4 deletions .nuspec/Objectivity.Test.Automation.Nunit.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
<copyright>Copyright 2015</copyright>
<tags>selenium webdriver testautomation tests nunit Objectivity.Test.Automation.Common</tags>
<dependencies>
<dependency id="NUnit" version="3.10.1" />
<dependency id="NUnit.ConsoleRunner" version="3.8.0" />
<dependency id="NUnit.Runners" version="3.8.0" />
<dependency id="NUnit" version="3.11.0" />
<dependency id="NUnit.ConsoleRunner" version="3.9.0" />
<dependency id="NUnit.Runners" version="3.9.0" />
<dependency id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" />
<dependency id="NUnit.Extension.NUnitV2Driver" version="3.7.0" />
<dependency id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" />
<dependency id="NUnit.Extension.VSProjectLoader" version="3.7.0" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="1.0.3" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="1.0.4" />
<dependency id="NPOI" version="2.3.0" />
<dependency id="SharpZipLib" version="0.86.0" />
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<HeaderText>Framework to automate tests using Selenium WebDriver</HeaderText>
<FeedbackEMailAddress>TestAutomationGroup%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.objectivity.co.uk/</CopyrightHref>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2017.12.30.2\tools\</HtmlHelp1xCompilerPath>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2018.7.8.1\tools\</HtmlHelp1xCompilerPath>
<ComponentPath>..\packages\</ComponentPath>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<PlugInConfigurations>
Expand All @@ -76,7 +76,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- NOTE: Update the version number in the path (YYYY.M.D.R) to match the package version -->
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2017.12.30.2\tools\</SHFBROOT>
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2018.7.8.1\tools\</SHFBROOT>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<Argument Key="maxVersionParts" Value="" xmlns="" />
</TransformComponentArguments>
<DocumentationSources>
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.12.1\lib\net45\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.12.1\lib\net45\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.12.1\lib\net45\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.12.1\lib\net45\WebDriver.Support.xml" /></DocumentationSources>
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.141.0\lib\net45\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.141.0\lib\net45\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.141.0\lib\net45\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.141.0\lib\net45\WebDriver.Support.xml" /></DocumentationSources>
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpFileFormat>Website</HelpFileFormat>
Expand All @@ -53,14 +53,14 @@
<HeaderText>Framework to automate tests using Selenium WebDriver</HeaderText>
<FeedbackEMailAddress>TestAutomationGroup%40objectivity.co.uk</FeedbackEMailAddress>
<CopyrightHref>http://www.objectivity.co.uk/</CopyrightHref>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2017.12.30.2\tools\</HtmlHelp1xCompilerPath>
<HtmlHelp1xCompilerPath>..\packages\EWSoftware.SHFB.2018.7.8.1\tools\</HtmlHelp1xCompilerPath>
<ComponentPath>..\packages\</ComponentPath>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<WarnOnMissingSourceContext>True</WarnOnMissingSourceContext>
</PropertyGroup>
<PropertyGroup>
<!-- NOTE: Update the version number in the path (YYYY.M.D.R) to match the package version -->
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2017.12.30.2\tools\</SHFBROOT>
<SHFBROOT Condition=" '$(SHFBROOT)' == '' ">$(MSBuildThisFileDirectory)..\packages\EWSoftware.SHFB.2018.7.8.1\tools\</SHFBROOT>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EWSoftware.SHFB" version="2017.12.30.2" targetFramework="net40" />
<package id="EWSoftware.SHFB.NETFramework" version="4.6" targetFramework="net40" />
</packages>
10 changes: 10 additions & 0 deletions Objectivity.Test.Automation.Common/BrowserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ public enum BrowserType
/// </summary>
CloudProvider,

/// <summary>
/// Browser type to run test on Android with CloudProviders
/// </summary>
Android,

/// <summary>
/// Browser type to run test on Iphone with CloudProviders
/// </summary>
Iphone,

/// <summary>
/// Not supported browser
/// </summary>
Expand Down
47 changes: 0 additions & 47 deletions Objectivity.Test.Automation.Common/CapabilitiesSetEventArgs.cs

This file was deleted.

Loading

0 comments on commit b9d3045

Please sign in to comment.