Remove ICustomPropertyProviders (#1229)

* Remove unused ICustomPropertyProviders
* Modify UI tests to not use Customproperties
This commit is contained in:
Rudy Huyn
2020-08-12 08:22:49 -07:00
committed by GitHub
parent 6299ec2303
commit 1c8b642376
11 changed files with 112 additions and 75 deletions

View File

@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using OpenQA.Selenium.Appium;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{
public class HistoryItem
{
public AppiumWebElement Item { get; }
public HistoryItem(AppiumWebElement item)
{
Item = item;
}
public string GetValue()
{
return Item.FindElementByAccessibilityId("HistoryItemValue")?.Text;
}
public string GetExpression()
{
return Item.FindElementByAccessibilityId("HistoryItemExpression")?.Text;
}
}
}

View File

@@ -5,8 +5,10 @@ using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Interactions;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;
namespace CalculatorUITestFramework
{
@@ -34,10 +36,10 @@ namespace CalculatorUITestFramework
/// Gets all of the history items listed in the History Pane.
/// </summary>
/// <returns>A readonly collection of history items.</returns>
public ReadOnlyCollection<AppiumWebElement> GetAllHistoryListViewItems()
public List<HistoryItem> GetAllHistoryListViewItems()
{
OpenHistoryPanel();
return this.HistoryListView.FindElementsByClassName("ListViewItem");
return (from item in this.HistoryListView.FindElementsByClassName("ListViewItem") select new HistoryItem(item)).ToList();
}
/// <summary>
@@ -92,10 +94,10 @@ namespace CalculatorUITestFramework
/// Gets all of the History items listed in the History Flyout.
/// </summary>
/// <returns> A read only collection of History items.</returns>
public ReadOnlyCollection<AppiumWebElement> GetAllHistoryFlyoutListViewItems()
public List<HistoryItem> GetAllHistoryFlyoutListViewItems()
{
OpenHistoryFlyout();
return this.HistoryListView.FindElementsByClassName("ListViewItem");
return (from item in this.HistoryListView.FindElementsByClassName("ListViewItem") select new HistoryItem(item)).ToList();
}
/// <summary>

View File

@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using OpenQA.Selenium.Appium;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{
public class MemoryItem
{
public AppiumWebElement Item { get; }
public MemoryItem(AppiumWebElement item)
{
Item = item;
}
public string GetValue()
{
return Item.FindElementByAccessibilityId("MemoryItemValue")?.Text;
}
}
}

View File

@@ -6,8 +6,10 @@ using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Interactions;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;
namespace CalculatorUITestFramework
{
@@ -43,10 +45,10 @@ namespace CalculatorUITestFramework
/// Gets all of the memory items listed in the Memory Pane.
/// </summary>
/// <returns>A read-only collection of memory items.</returns>
public ReadOnlyCollection<AppiumWebElement> GetAllMemoryListViewItems()
public List<MemoryItem> GetAllMemoryListViewItems()
{
OpenMemoryPanel();
return this.MemoryListView.FindElementsByClassName("ListViewItem");
return (from item in this.MemoryListView.FindElementsByClassName("ListViewItem") select new MemoryItem(item)).ToList();
}
/// <summary>
@@ -119,10 +121,10 @@ namespace CalculatorUITestFramework
/// Gets all of the memory items listed in the Memory Flyout.
/// </summary>
/// <returns> A read only collection of memory items.</returns>
public ReadOnlyCollection<AppiumWebElement> GetAllMemoryFlyoutListViewItems()
public List<MemoryItem> GetAllMemoryFlyoutListViewItems()
{
OpenMemoryFlyout();
return this.MemoryListView.FindElementsByClassName("ListViewItem");
return (from item in this.MemoryListView.FindElementsByClassName("ListViewItem") select new MemoryItem(item)).ToList();
}
/// <summary>