Skip to content

Commit

Permalink
Merge pull request #24 from ObjectivityLtd/v3.0.4
Browse files Browse the repository at this point in the history
V3.0.4
  • Loading branch information
raczeja authored Feb 17, 2017
2 parents 4657def + 81be6cc commit df32470
Show file tree
Hide file tree
Showing 26 changed files with 183 additions and 160 deletions.
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,11 +15,11 @@
<copyright>Copyright 2015</copyright>
<tags>selenium webdriver testautomation tests nunit Objectivity.Test.Automation.Common</tags>
<dependencies>
<dependency id="NUnit" version="3.5.0" />
<dependency id="NUnit.ConsoleRunner" version="3.5.0" />
<dependency id="NUnit.Runners" version="3.5.0" />
<dependency id="NUnit" version="3.6.0" />
<dependency id="NUnit.ConsoleRunner" version="3.6.0" />
<dependency id="NUnit.Runners" version="3.6.0" />
<dependency id="NUnit.Extension.NUnitProjectLoader" version="3.5.0" />
<dependency id="NUnit.Extension.NUnitV2Driver" version="3.5.0" />
<dependency id="NUnit.Extension.NUnitV2Driver" version="3.6.0" />
<dependency id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" />
<dependency id="NUnit.Extension.VSProjectLoader" version="3.5.0" />
<dependency id="NUnit.Extension.TeamCityEventListener" version="1.0.2" />
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.0.1\lib\net40\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.0.1\lib\net40\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.xml" /></DocumentationSources>
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.1.0\lib\net40\WebDriver.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.WebDriver.3.1.0\lib\net40\WebDriver.xml" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.1.0\lib\net40\WebDriver.Support.dll" />
<DocumentationSource sourceFile="..\packages\Selenium.Support.3.1.0\lib\net40\WebDriver.Support.xml" /></DocumentationSources>
<SaveComponentCacheCapacity>100</SaveComponentCacheCapacity>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpFileFormat>Website</HelpFileFormat>
Expand Down
55 changes: 28 additions & 27 deletions Objectivity.Test.Automation.Common/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
Expand All @@ -9,30 +9,30 @@
</configSections>
<appSettings>
<!--mandatory keys-->
<add key="protocol" value="https" />
<add key="host" value="github.com" />
<add key="url" value="/ObjectivityBSS/Test.Automation" />
<add key="protocol" value="https"/>
<add key="host" value="github.com"/>
<add key="url" value="/ObjectivityBSS/Test.Automation"/>
<!--<add key="browser" value="Chrome" />-->
<!--<add key="browser" value="InternetExplorer" />-->
<!--<add key="browser" value="FirefoxPortable" />-->
<!--<add key="browser" value="Safari" />-->
<!--<add key="browser" value="PhantomJs" />-->
<!--<add key="browser" value="RemoteWebDriver" />-->
<add key="browser" value="Firefox" />
<add key="FirefoxUseLegacyImplementation" value="true" />
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe" />
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\" />
<add key="RemoteWebDriverHub" value="http://localhost:4444/wd/hub" />
<add key="DriverCapabilities" value="Firefox" />
<add key="browser" value="Firefox"/>
<add key="FirefoxUseLegacyImplementation" value="true"/>
<add key="FireFoxPath" value="\..\..\..\FirefoxPortable\FirefoxPortable.exe"/>
<add key="PhantomJsPath" value="\..\..\..\packages\PhantomJS.2.1.1\tools\phantomjs\"/>
<add key="RemoteWebDriverHub" value="http://localhost:4444/wd/hub"/>
<add key="DriverCapabilities" value="Firefox"/>
<!--<add key="proxy" value="127.0.0.1:9999" />-->
<!--Timeouts-->
<add key="longTimeout" value="30" />
<add key="mediumTimeout" value="10" />
<add key="shortTimeout" value="3" />
<add key="ImplicitlyWaitMilliseconds" value="200" />
<add key="longTimeout" value="30"/>
<add key="mediumTimeout" value="10"/>
<add key="shortTimeout" value="3"/>
<add key="ImplicitlyWaitMilliseconds" value="200"/>
<!--User credentials-->
<add key="username" value="null" />
<add key="password" value="null" />
<add key="username" value="null"/>
<add key="password" value="null"/>
<!--Downloading files-->
<add key="UseCurrentDirectory" value="true"/>
<add key="DownloadFolder" value="\TestOutput"/>
Expand All @@ -44,21 +44,22 @@
<add key="GetPageSourceEnabled" value="true"/>
<!--Use default firefox profile?-->
<add key="UseDefaultFirefoxProfile" value="false"/>
<add key="PathToFirefoxProfile" value="C:\Users\ci_objectivity\AppData\Roaming\Mozilla\Firefox\Profiles" />
<add key="PathToFirefoxProfile" value="C:\Users\ci_objectivity\AppData\Roaming\Mozilla\Firefox\Profiles"/>
</appSettings>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off"
internalLogFile="c:\temp\nlog-internal.log">
<targets>
<target name="logfile" xsi:type="File" fileName="${basedir}\Test.log" layout="${longdate}|${level}|${callsite}|${message}" />
<target name="logfile" xsi:type="File" fileName="${basedir}\Test.log" layout="${longdate}|${level}|${callsite}|${message}"/>
<target name="console" xsi:type="ColoredConsole" layout="${longdate}|${level}|${callsite}|${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logfile" />
<logger name="*" minlevel="Debug" writeTo="console" />
<logger name="*" minlevel="Trace" writeTo="logfile"/>
<logger name="*" minlevel="Debug" writeTo="console"/>
</rules>
</nlog>
<FirefoxPreferences>
Expand All @@ -73,4 +74,4 @@
<ChromeExtensions>
<!-->add key="ChromePluginName.crx" value=""/-->
</ChromeExtensions>
</configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
23 changes: 22 additions & 1 deletion Objectivity.Test.Automation.Common/BaseConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Objectivity.Test.Automation.Common
using OpenQA.Selenium.Remote;

/// <summary>
/// SeleniumConfiguration that consume app.config file
/// SeleniumConfiguration that consume app.config file <see href="https://github.com/ObjectivityLtd/Test.Automation/wiki/Description%20of%20App.config%20file">More details on wiki</see>
/// </summary>
public static class BaseConfiguration
{
Expand All @@ -42,6 +42,12 @@ public static class BaseConfiguration
/// <summary>
/// Gets the Driver.
/// </summary>
/// <example>How to use it: <code>
/// if (BaseConfiguration.TestBrowser == BrowserType.Firefox)
/// {
/// this.Driver.GetElement(this.fileLink.Format(fileName), "Click on file").Click();
/// };
/// </code></example>
public static BrowserType TestBrowser
{
get
Expand Down Expand Up @@ -135,6 +141,9 @@ public static string Password
/// <summary>
/// Gets the java script or ajax waiting time [seconds].
/// </summary>
/// <example>How to use it: <code>
/// this.Driver.IsElementPresent(this.statusCodeHeader, BaseConfiguration.MediumTimeout);
/// </code></example>
public static double MediumTimeout
{
get { return Convert.ToDouble(ConfigurationManager.AppSettings["mediumTimeout"], CultureInfo.CurrentCulture); }
Expand All @@ -143,6 +152,9 @@ public static double MediumTimeout
/// <summary>
/// Gets the page load waiting time [seconds].
/// </summary>
/// <example>How to use it: <code>
/// element.GetElement(locator, BaseConfiguration.LongTimeout, e => e.Displayed, customMessage);
/// </code></example>
public static double LongTimeout
{
get { return Convert.ToDouble(ConfigurationManager.AppSettings["longTimeout"], CultureInfo.CurrentCulture); }
Expand All @@ -151,6 +163,9 @@ public static double LongTimeout
/// <summary>
/// Gets the assertion waiting time [seconds].
/// </summary>
/// <example>How to use it: <code>
/// this.Driver.IsElementPresent(this.downloadPageHeader, BaseConfiguration.ShortTimeout);
/// </code></example>
public static double ShortTimeout
{
get { return Convert.ToDouble(ConfigurationManager.AppSettings["shortTimeout"], CultureInfo.CurrentCulture); }
Expand Down Expand Up @@ -359,6 +374,9 @@ public static string PageSourceFolder
/// <summary>
/// Gets the URL value 'Protocol://HostURL'.
/// </summary>
/// <example>How to use it: <code>
/// var url = BaseConfiguration.GetUrlValue;
/// </code></example>
public static string GetUrlValue
{
get
Expand All @@ -370,6 +388,9 @@ public static string GetUrlValue
/// <summary>
/// Gets the URL value with user credentials 'Protocol://Username:Password@HostURL'.
/// </summary>
/// <example>How to use it: <code>
/// var url = BaseConfiguration.GetUrlValueWithUserCredentials;
/// </code></example>
public static string GetUrlValueWithUserCredentials
{
get
Expand Down
10 changes: 5 additions & 5 deletions Objectivity.Test.Automation.Common/DriverContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public DesiredCapabilities SetCapabilities()
{
case BrowserType.Firefox:
capabilities = DesiredCapabilities.Firefox();
capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, this.FirefoxProfile);
capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, this.FirefoxProfile.ToBase64String());
break;
case BrowserType.InternetExplorer:
capabilities = DesiredCapabilities.InternetExplorer();
Expand Down Expand Up @@ -467,9 +467,9 @@ public void Start()
string.Format(CultureInfo.CurrentCulture, "Driver {0} is not supported", BaseConfiguration.TestBrowser));
}

this.driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(BaseConfiguration.LongTimeout));
this.driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(BaseConfiguration.ShortTimeout));
this.driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMilliseconds(BaseConfiguration.ImplicitlyWaitMilliseconds));
this.driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(BaseConfiguration.LongTimeout);
this.driver.Manage().Timeouts().AsynchronousJavaScript = TimeSpan.FromSeconds(BaseConfiguration.ShortTimeout);
this.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(BaseConfiguration.ImplicitlyWaitMilliseconds);
this.driver.Manage().Window.Maximize();
}

Expand Down Expand Up @@ -498,7 +498,7 @@ public void SaveScreenshot(ErrorDetail errorDetail, string folder, string title)

try
{
errorDetail.Screenshot.SaveAsFile(filePath, ImageFormat.Png);
errorDetail.Screenshot.SaveAsFile(filePath, ScreenshotImageFormat.Png);
Logger.Error(CultureInfo.CurrentCulture, "Test failed: screenshot saved to {0}.", filePath);
Logger.Info(CultureInfo.CurrentCulture, "##teamcity[publishArtifacts '{0}']", filePath);
}
Expand Down
2 changes: 1 addition & 1 deletion Objectivity.Test.Automation.Common/Helpers/FilesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Objectivity.Test.Automation.Common.Helpers
using Objectivity.Test.Automation.Common;

/// <summary>
/// Class for handling downloading files
/// Class for handling downloading files <see href="https://github.com/ObjectivityLtd/Test.Automation/wiki/Downloading%20files">More details on wiki</see>
/// </summary>
public static class FilesHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Objectivity.Test.Automation.Common.Helpers
using Objectivity.Test.Automation.Common.Types;

/// <summary>
/// Class which support performance tests.
/// Class which support performance tests. <see href="https://github.com/ObjectivityLtd/Test.Automation/wiki/Performance%20measures">More details on wiki</see>
/// </summary>
public class PerformanceHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Objectivity.Test.Automation.Common</RootNamespace>
<AssemblyName>Objectivity.Test.Automation.Common</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand All @@ -35,6 +35,7 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
<DocumentationFile>bin\Debug\Objectivity.Test.Automation.Common.XML</DocumentationFile>
<CodeAnalysisRuleSet>..\fxcop-sonarqube.tests.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -50,6 +51,7 @@
<StyleCopTreatErrorsAsWarnings>False</StyleCopTreatErrorsAsWarnings>
<CodeAnalysisRuleSet>..\fxcop-sonarqube.tests.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Objectivity.Test.Automation.Common.XML</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
Expand Down Expand Up @@ -111,7 +113,7 @@
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.5\lib\net40\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.5\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -121,12 +123,12 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WebDriver, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.1\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.1.0\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll</HintPath>
<Reference Include="WebDriver.Support, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.1.0\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down Expand Up @@ -173,11 +175,11 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable 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('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.8\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.Firefox.WebDriver.0.13.0\build\Selenium.Firefox.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.Firefox.WebDriver.0.13.0\build\Selenium.Firefox.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.27.0\build\Selenium.WebDriver.ChromeDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.ChromeDriver.2.27.0\build\Selenium.WebDriver.ChromeDriver.targets'))" />
</Target>
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.11.1\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.8\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.25.0.0\build\Selenium.WebDriver.ChromeDriver.targets')" />
<Import Project="..\packages\Selenium.Firefox.WebDriver.0.13.0\build\Selenium.Firefox.WebDriver.targets" Condition="Exists('..\packages\Selenium.Firefox.WebDriver.0.13.0\build\Selenium.Firefox.WebDriver.targets')" />
<Import Project="..\packages\Selenium.WebDriver.ChromeDriver.2.27.0\build\Selenium.WebDriver.ChromeDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.ChromeDriver.2.27.0\build\Selenium.WebDriver.ChromeDriver.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion Objectivity.Test.Automation.Common/Verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Objectivity.Test.Automation.Common
using Objectivity.Test.Automation.Common.Types;

/// <summary>
/// Class for assert without stop tests
/// Class for assert without stop tests <see href="https://github.com/ObjectivityLtd/Test.Automation/wiki/Verify-asserts-without-stop-tests">More details on wiki</see>
/// </summary>
public static class Verify
{
Expand Down
Loading

0 comments on commit df32470

Please sign in to comment.