Skip to content

Commit 98060c2

Browse files
committed
update
1 parent 6d8be1f commit 98060c2

3 files changed

Lines changed: 23 additions & 22 deletions

File tree

ApplitoolsTutorial/ApplitoolsTutorial.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Eyes.Sdk.DotNet">
41-
<HintPath>..\packages\Eyes.Sdk.2.21.12-beta\lib\net45\Eyes.Sdk.DotNet.dll</HintPath>
41+
<HintPath>..\packages\Eyes.Sdk.2.21.14-beta\lib\net45\Eyes.Sdk.DotNet.dll</HintPath>
4242
</Reference>
4343
<Reference Include="System.Management" />
4444
<Reference Include="System.Web" />
@@ -54,15 +54,18 @@
5454
<Reference Include="System.ComponentModel.Composition" />
5555
<Reference Include="System.Core" />
5656
<Reference Include="CssParser">
57-
<HintPath>..\packages\Eyes.Sdk.2.21.12-beta\lib\net45\CssParser.dll</HintPath>
57+
<HintPath>..\packages\Eyes.Sdk.2.21.14-beta\lib\net45\CssParser.dll</HintPath>
5858
</Reference>
5959
<Reference Include="Eyes.Selenium.DotNet">
60-
<HintPath>..\packages\Eyes.Selenium.2.21.12-beta\lib\net45\Eyes.Selenium.DotNet.dll</HintPath>
60+
<HintPath>..\packages\Eyes.Selenium.2.21.14-beta\lib\net45\Eyes.Selenium.DotNet.dll</HintPath>
6161
</Reference>
6262
</ItemGroup>
6363
<ItemGroup>
6464
<Compile Include="Program.cs" />
6565
<Compile Include="Properties\AssemblyInfo.cs" />
6666
</ItemGroup>
67+
<ItemGroup>
68+
<None Include="packages.config" />
69+
</ItemGroup>
6770
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
6871
</Project>

ApplitoolsTutorial/Program.cs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
using Applitools.VisualGrid;
44
using OpenQA.Selenium;
55
using OpenQA.Selenium.Chrome;
6+
using static Applitools.Configuration;
7+
using static Applitools.VisualGrid.ChromeEmulationInfo;
68
using Configuration = Applitools.Selenium.Configuration;
7-
9+
using ScreenOrientation = Applitools.VisualGrid.ScreenOrientation;
810

911
namespace ApplitoolsTutorial
1012
{
@@ -34,34 +36,30 @@ private void Run()
3436
// Create Eyes object with the runner, meaning it'll be a Visual Grid eyes.
3537
Eyes eyes = new Eyes(runner);
3638

37-
//Set the Applitools API KEY here or as an environment variable "APPLITOOLS_API_KEY"
38-
eyes.ApiKey = "APPLITOOLS_API_KEY";
39-
40-
4139
// Create configuration object
4240
Configuration conf = new Configuration();
43-
4441

45-
// Set test name
46-
conf.TestName = "C# VisualGrid demo";
4742

48-
// Set app name
49-
conf.AppName = "Demo app";
5043

51-
// Add browsers with different viewports
52-
conf.AddBrowser(800, 600, Configuration.BrowserType.CHROME);
53-
conf.AddBrowser(700, 500, Configuration.BrowserType.CHROME);
54-
conf.AddBrowser(1200, 800, Configuration.BrowserType.FIREFOX);
55-
conf.AddBrowser(1600, 1200, Configuration.BrowserType.FIREFOX);
44+
// Set the Applitools API KEY here or as an environment variable "APPLITOOLS_API_KEY"
45+
conf.SetApiKey("APPLITOOLS_API_KEY")
46+
.SetTestName("C# VisualGrid demo") // Set test name
47+
.SetAppName("Demo app"); // Set app name
48+
49+
// Add different browsers with different viewports
50+
conf.AddBrowser(800, 600, BrowserType.CHROME);
51+
conf.AddBrowser(700, 500, BrowserType.CHROME);
52+
conf.AddBrowser(1200, 800, BrowserType.FIREFOX);
53+
conf.AddBrowser(1600, 1200, BrowserType.FIREFOX);
5654

5755
// Add iPhone 4 device emulation in Portraig mode
58-
EmulationInfo iphone4 = new EmulationInfo(EmulationInfo.DeviceNameEnum.iPhone_4, Applitools.VisualGrid.ScreenOrientation.Portrait);
56+
ChromeEmulationInfo iphone4 = new ChromeEmulationInfo(DeviceNameEnum.iPhone_4, ScreenOrientation.Portrait);
5957
conf.AddDeviceEmulation(iphone4);
6058

6159

6260

6361
// Set the configuration object to eyes
64-
eyes.Configuration = conf;
62+
eyes.SetConfiguration(conf);
6563

6664
// Call Open on eyes to initialize a test session
6765
eyes.Open(webDriver);

ApplitoolsTutorial/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<packages>
33
<package id="Castle.Core" version="4.3.1" targetFramework="net461" />
44
<package id="DotNetZip.Reduced" version="1.9.1.8" targetFramework="net461" />
5-
<package id="Eyes.Sdk" version="2.21.12-beta" targetFramework="net47" />
6-
<package id="Eyes.Selenium" version="2.21.12-beta" targetFramework="net47" />
5+
<package id="Eyes.Sdk" version="2.21.14-beta" targetFramework="net47" />
6+
<package id="Eyes.Selenium" version="2.21.14-beta" targetFramework="net47" />
77
<package id="log4net" version="2.0.8" targetFramework="net461" />
88
<package id="Microsoft.CodedUI.Framework" version="2.0.0" targetFramework="net461" />
99
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net47" />

0 commit comments

Comments
 (0)