Skip to content

Commit 58a513e

Browse files
committed
Update CalculatorTest sample to align with the latest Calculator application update
Update CalculatorTest README.md with new running requirements and steps Update CalculatorTest to use more recent NuGet packages
1 parent 1c7455a commit 58a513e

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

Samples/C#/CalculatorTest/CalculatorSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void Setup(TestContext context)
4343
Assert.IsNotNull(session);
4444

4545
// Set implicit timeout to 1.5 seconds to make element search to retry every 500 ms for at most three times
46-
session.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1.5));
46+
session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5);
4747
}
4848
}
4949

Samples/C#/CalculatorTest/CalculatorTest.csproj

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,29 @@
3838
<WarningLevel>4</WarningLevel>
3939
</PropertyGroup>
4040
<ItemGroup>
41-
<Reference Include="appium-dotnet-driver, Version=3.0.0.1, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>packages\Appium.WebDriver.3.0.0.1\lib\net45\appium-dotnet-driver.dll</HintPath>
43-
<Private>True</Private>
41+
<Reference Include="appium-dotnet-driver, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
42+
<HintPath>packages\Microsoft.WinAppDriver.Appium.WebDriver.1.0.1-Preview\lib\net45\appium-dotnet-driver.dll</HintPath>
4443
</Reference>
4544
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
46-
<HintPath>packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
47-
<Private>True</Private>
45+
<HintPath>packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
4846
</Reference>
4947
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
5048
<HintPath>packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
51-
<Private>True</Private>
5249
</Reference>
5350
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
5451
<HintPath>packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
55-
<Private>True</Private>
5652
</Reference>
57-
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
58-
<HintPath>packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
59-
<Private>True</Private>
53+
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
54+
<HintPath>packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
6055
</Reference>
6156
<Reference Include="System" />
57+
<Reference Include="System.Configuration" />
6258
<Reference Include="System.Drawing" />
63-
<Reference Include="WebDriver, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
64-
<HintPath>packages\Selenium.WebDriver.3.0.1\lib\net40\WebDriver.dll</HintPath>
65-
<Private>True</Private>
59+
<Reference Include="WebDriver, Version=3.8.0.0, Culture=neutral, processorArchitecture=MSIL">
60+
<HintPath>packages\Selenium.WebDriver.3.8.0\lib\net45\WebDriver.dll</HintPath>
6661
</Reference>
67-
<Reference Include="WebDriver.Support, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll</HintPath>
69-
<Private>True</Private>
62+
<Reference Include="WebDriver.Support, Version=3.8.0.0, Culture=neutral, processorArchitecture=MSIL">
63+
<HintPath>packages\Selenium.Support.3.8.0\lib\net45\WebDriver.Support.dll</HintPath>
7064
</Reference>
7165
</ItemGroup>
7266
<Choose>

Samples/C#/CalculatorTest/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,23 @@ This test project highlights the following basic interactions to demonstrate how
1414

1515
## Requirements
1616

17-
- Windows 10 PC with the latest Windows 10 version (Version 1607 or later)
18-
- Microsoft Visual Studio 2015 or later
17+
- Windows 10 PC with the latest Windows 10 version (Version 1809 or later)
18+
- Microsoft Visual Studio 2017 or later
1919

2020

2121
## Getting Started
2222

23-
1. Open `CalculatorTest.sln` in Visual Studio
24-
2. Select **Test** > **Windows** > **Test Explorer**
25-
3. Select **Run All** on the test pane or through menu **Test** > **Run** > **All Tests**
23+
1. [Run](../../../README.md#installing-and-running-windows-application-driver) `WinAppDriver.exe` on the test device
24+
2. Open `CalculatorTest.sln` in Visual Studio
25+
3. Select **Build** > **Rebuild Solution**
26+
4. Select **Test** > **Windows** > **Test Explorer**
27+
5. Select **Run All** on the test pane or through menu **Test** > **Run** > **All Tests**
2628

2729
> Once the project is successfully built, you can use the **TestExplorer** to pick and choose the test scenario(s) to run
2830
31+
> If Visual Studio fail to discover and run the test scenarios:
32+
> 1. Select **Tools** > **Options...** > **Test**
33+
> 2. Under *Active Solution*, uncheck *For improved performance, only use test adapters in test assembly folder or as specified in runsettings file*
2934
3035
## Adding/Updating Test Scenario
3136

Samples/C#/CalculatorTest/ScenarioStandard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static void ClassInitialize(TestContext context)
106106
// Ensure that calculator is in standard mode
107107
if (!header.Text.Equals("Standard", StringComparison.OrdinalIgnoreCase))
108108
{
109-
session.FindElementByAccessibilityId("NavButton").Click();
109+
session.FindElementByAccessibilityId("TogglePaneButton").Click();
110110
Thread.Sleep(TimeSpan.FromSeconds(1));
111111
var splitViewPane = session.FindElementByClassName("SplitViewPane");
112112
splitViewPane.FindElementByName("Standard Calculator").Click();
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Appium.WebDriver" version="3.0.0.1" targetFramework="net45" />
4-
<package id="Castle.Core" version="4.0.0" targetFramework="net45" />
3+
<package id="Castle.Core" version="4.2.1" targetFramework="net45" />
4+
<package id="Microsoft.WinAppDriver.Appium.WebDriver" version="1.0.1-Preview" targetFramework="net45" />
55
<package id="MSTest.TestAdapter" version="1.2.0" targetFramework="net45" />
66
<package id="MSTest.TestFramework" version="1.2.0" targetFramework="net45" />
7-
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
8-
<package id="Selenium.Support" version="3.0.1" targetFramework="net45" />
9-
<package id="Selenium.WebDriver" version="3.0.1" targetFramework="net45" />
7+
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
8+
<package id="Selenium.Support" version="3.8.0" targetFramework="net45" />
9+
<package id="Selenium.WebDriver" version="3.8.0" targetFramework="net45" />
1010
</packages>

0 commit comments

Comments
 (0)