Skip to content

Commit 71e8c9d

Browse files
marcelwgnkarkarl
authored andcommitted
Refactor tests
1 parent 7822b3f commit 71e8c9d

16 files changed

Lines changed: 72 additions & 9 deletions

UITests/AxeHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
using Axe.Windows.Automation;
1818
using Axe.Windows.Core.Enums;
19-
using Axe.Windows.Rules;
19+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2020
using System.Diagnostics;
2121
using System.Linq;
2222

@@ -42,7 +42,7 @@ public static void AssertNoAccessibilityErrors()
4242
.Where(rule => rule.Rule.ID != RuleId.NameIsInformative)
4343
.Where(rule => rule.Rule.ID != RuleId.NameExcludesControlType)
4444
.Where(rule => rule.Rule.ID != RuleId.NameExcludesLocalizedControlType);
45-
if (testResult.Count() != 0)
45+
if (testResult.Any())
4646
{
4747
var mappedResult = testResult.Select(result => "Element " + result.Element.Properties["ControlType"] + " violated rule '" + result.Rule.Description + "'.");
4848
Assert.Fail("Failed with the following accessibility errors \r\n" + string.Join("\r\n", mappedResult));

UITests/GlobalUsings.cs

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

UITests/SampleTestTemplate.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1-
using System.Threading;
1+
//******************************************************************************
2+
//
3+
// Copyright (c) 2023 Microsoft Corporation. All rights reserved.
4+
//
5+
// This code is licensed under the MIT License (MIT).
6+
//
7+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
13+
// THE SOFTWARE.
14+
//
15+
//******************************************************************************
16+
17+
using System.Threading;
18+
using Microsoft.VisualStudio.TestTools.UnitTesting;
219
using OpenQA.Selenium.Appium.Windows;
20+
321
namespace UITests
422
{
523
[TestClass]

UITests/SessionManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
1718
using OpenQA.Selenium.Appium;
19+
using OpenQA.Selenium.Appium.Windows;
1820
using System;
1921
using System.Diagnostics;
2022
using System.IO;
@@ -27,8 +29,8 @@ public class SessionManager
2729
{
2830
private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723";
2931
private static string[] WinUIGalleryAppIDs = new string[]{
30-
"Microsoft.WinUI3ControlsGallery.Debug_s9y1p3hwd5qda!App",
31-
"Microsoft.WinUI3ControlsGallery_s9y1p3hwd5qda!App"
32+
"Microsoft.WinUI3ControlsGallery.Debug_grv3cx5qrw0gp!App",
33+
"Microsoft.WinUI3ControlsGallery_grv3cx5qrw0gp!App"
3234
};
3335

3436
private static uint appIdIndex = 0;

UITests/TestBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using OpenQA.Selenium.Appium.Windows;
1719
using OpenQA.Selenium.Interactions;
1820
using System.Threading;
1921

UITests/Tests/Button.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using OpenQA.Selenium.Appium.Windows;
19+
1720
namespace UITests.Tests
1821
{
1922
[TestClass]

UITests/Tests/CheckBox.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using OpenQA.Selenium.Appium.Windows;
19+
1720
namespace UITests.Tests
1821
{
1922
[TestClass]

UITests/Tests/ComboBox.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using OpenQA.Selenium.Appium.Windows;
19+
1720
namespace UITests.Tests
1821
{
1922
[TestClass]

UITests/Tests/DatePicker.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//
1515
//******************************************************************************
1616

17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using OpenQA.Selenium.Appium.Windows;
19+
1720
using System.Threading;
1821

1922
namespace UITests.Tests

UITests/Tests/PersonPicture.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
using System.Threading;
1+
//******************************************************************************
2+
//
3+
// Copyright (c) 2023 Microsoft Corporation. All rights reserved.
4+
//
5+
// This code is licensed under the MIT License (MIT).
6+
//
7+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
13+
// THE SOFTWARE.
14+
//
15+
//******************************************************************************
16+
17+
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using System.Threading;
219

320
namespace UITests.Tests
421
{

0 commit comments

Comments
 (0)