Skip to content

Commit 45b8f0a

Browse files
authored
Merge pull request #2 from itaibh/master
updated demo code.
2 parents 530b2d2 + b0954cb commit 45b8f0a

5 files changed

Lines changed: 30 additions & 116 deletions

File tree

ApplitoolsTutorial.sln

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio 15
3+
VisualStudioVersion = 15.0.28307.168
4+
MinimumVisualStudioVersion = 10.0.40219.1
45
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplitoolsTutorial", "ApplitoolsTutorial\ApplitoolsTutorial.csproj", "{E2A51DD0-EB96-4E33-90B3-679B912B0337}"
56
EndProject
67
Global
@@ -9,9 +10,15 @@ Global
910
Release|x86 = Release|x86
1011
EndGlobalSection
1112
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12-
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Debug|x86.ActiveCfg = Debug|x86
13-
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Debug|x86.Build.0 = Debug|x86
14-
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Release|x86.ActiveCfg = Release|x86
15-
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Release|x86.Build.0 = Release|x86
13+
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Debug|x86.ActiveCfg = Debug|Any CPU
14+
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Debug|x86.Build.0 = Debug|Any CPU
15+
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Release|x86.ActiveCfg = Release|Any CPU
16+
{E2A51DD0-EB96-4E33-90B3-679B912B0337}.Release|x86.Build.0 = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(SolutionProperties) = preSolution
19+
HideSolutionNode = FALSE
20+
EndGlobalSection
21+
GlobalSection(ExtensibilityGlobals) = postSolution
22+
SolutionGuid = {9D3ABCDC-4A7E-4485-A93C-35338E785666}
1623
EndGlobalSection
1724
EndGlobal
Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,18 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
7-
<ProjectGuid>{E2A51DD0-EB96-4E33-90B3-679B912B0337}</ProjectGuid>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<ApplicationIcon />
86
<OutputType>Exe</OutputType>
9-
<RootNamespace>ApplitoolsTutorial</RootNamespace>
10-
<AssemblyName>ApplitoolsTutorial</AssemblyName>
11-
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
7+
<StartupObject>ApplitoolsTutorial.Program</StartupObject>
128
</PropertyGroup>
13-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
14-
<DebugSymbols>true</DebugSymbols>
15-
<DebugType>full</DebugType>
16-
<Optimize>false</Optimize>
17-
<OutputPath>bin\Debug</OutputPath>
18-
<DefineConstants>DEBUG;</DefineConstants>
19-
<ErrorReport>prompt</ErrorReport>
20-
<WarningLevel>4</WarningLevel>
21-
<ExternalConsole>true</ExternalConsole>
22-
<PlatformTarget>x86</PlatformTarget>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
25-
<Optimize>true</Optimize>
26-
<OutputPath>bin\Release</OutputPath>
27-
<ErrorReport>prompt</ErrorReport>
28-
<WarningLevel>4</WarningLevel>
29-
<ExternalConsole>true</ExternalConsole>
30-
<PlatformTarget>x86</PlatformTarget>
31-
</PropertyGroup>
32-
<ItemGroup>
33-
<Reference Include="CssParser, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
34-
<HintPath>..\packages\Eyes.Selenium.2.21.15-beta\lib\net45\CssParser.dll</HintPath>
35-
</Reference>
36-
<Reference Include="Eyes.Sdk.DotNet, Version=2.21.15.0, Culture=neutral, processorArchitecture=MSIL">
37-
<HintPath>..\packages\Eyes.Sdk.2.21.15-beta\lib\net45\Eyes.Sdk.DotNet.dll</HintPath>
38-
</Reference>
39-
<Reference Include="Eyes.Selenium.DotNet, Version=2.21.15.0, Culture=neutral, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Eyes.Selenium.2.21.15-beta\lib\net45\Eyes.Selenium.DotNet.dll</HintPath>
41-
</Reference>
42-
<Reference Include="System" />
43-
<Reference Include="Ionic.Zip.Reduced">
44-
<HintPath>..\packages\DotNetZip.Reduced.1.9.1.8\lib\net20\Ionic.Zip.Reduced.dll</HintPath>
45-
</Reference>
46-
<Reference Include="Newtonsoft.Json">
47-
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
48-
</Reference>
49-
<Reference Include="System.Management" />
50-
<Reference Include="System.Web" />
51-
<Reference Include="System.Windows.Forms" />
52-
<Reference Include="WebDriver">
53-
<HintPath>..\packages\Selenium.WebDriver.3.141.0\lib\net45\WebDriver.dll</HintPath>
54-
</Reference>
55-
<Reference Include="System.Drawing" />
56-
<Reference Include="System.Runtime">
57-
<HintPath>..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll</HintPath>
58-
</Reference>
59-
<Reference Include="mscorlib" />
60-
<Reference Include="System.ComponentModel.Composition" />
61-
<Reference Include="System.Core" />
62-
</ItemGroup>
9+
6310
<ItemGroup>
64-
<Compile Include="Program.cs" />
65-
<Compile Include="Properties\AssemblyInfo.cs" />
11+
<PackageReference Include="Eyes.Selenium" Version="2.22.8" />
6612
</ItemGroup>
13+
6714
<ItemGroup>
68-
<None Include="packages.config" />
15+
<Folder Include="Properties\" />
6916
</ItemGroup>
70-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
17+
7118
</Project>

ApplitoolsTutorial/Program.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,19 @@ private void Run()
3939

4040

4141

42-
4342
//conf.SetApiKey("APPLITOOLS_API_KEY"); // Set the Applitools API KEY here or as an environment variable "APPLITOOLS_API_KEY"
4443
conf.SetTestName("C# VisualGrid demo") // Set test name
4544
.SetAppName("Demo app"); // Set app name
4645

4746
// Add browsers with different viewports
4847
conf.AddBrowser(800, 600, BrowserType.CHROME);
49-
conf.AddBrowser(700, 500, BrowserType.CHROME);
50-
conf.AddBrowser(1200, 800, BrowserType.FIREFOX);
51-
conf.AddBrowser(1600, 1200, BrowserType.FIREFOX);
52-
53-
// Add iPhone 4 device emulation in Portraig mode
54-
ChromeEmulationInfo iphone4 = new ChromeEmulationInfo(DeviceName.iPhone_4, ScreenOrientation.Portrait);
55-
conf.AddDeviceEmulation(iphone4);
48+
conf.AddBrowser(700, 500, BrowserType.FIREFOX);
49+
conf.AddBrowser(1200, 800, BrowserType.IE_10);
50+
conf.AddBrowser(1600, 1200, BrowserType.IE_11);
51+
conf.AddBrowser(1024, 768, BrowserType.EDGE);
5652

53+
// Add iPhone 4 device emulation in Portrait mode
54+
conf.AddDeviceEmulation(DeviceName.iPhone_4, ScreenOrientation.Portrait);
5755

5856

5957
// Set the configuration object to eyes
@@ -72,7 +70,8 @@ private void Run()
7270
// Close the browser
7371
webDriver.Quit();
7472

75-
eyes.Close();
73+
eyes.CloseAsync();
74+
7675
//Wait and collect all test results
7776
TestResultSummary allTestResults = runner.GetAllTestResults();
7877
System.Console.WriteLine(allTestResults);

ApplitoolsTutorial/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

ApplitoolsTutorial/packages.config

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)