// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using OpenQA.Selenium.Appium; using OpenQA.Selenium.Appium.Windows; using System.Collections.ObjectModel; namespace CalculatorUITestFramework { public class MemoryPanel { private WindowsDriver session => WinAppDriver.Instance.CalculatorSession; public WindowsElement MemoryClear => this.session.TryFindElementByAccessibilityId("ClearMemoryButton"); public WindowsElement MemRecall => this.session.TryFindElementByAccessibilityId("MemRecall"); public WindowsElement MemPlus => this.session.TryFindElementByAccessibilityId("MemPlus"); public WindowsElement MemMinus => this.session.TryFindElementByAccessibilityId("MemMinus"); public WindowsElement MemButton => this.session.TryFindElementByAccessibilityId("memButton"); public WindowsElement MemoryPane => this.session.TryFindElementByAccessibilityId("MemoryPanel"); public WindowsElement MemoryLabel => this.session.TryFindElementByAccessibilityId("MemoryLabel"); public WindowsElement MemoryListView => this.session.TryFindElementByAccessibilityId("MemoryListView"); public WindowsElement MemoryPaneEmptyLabel => this.session.TryFindElementByAccessibilityId("MemoryPaneEmpty"); /// /// Opens the Memory Pane by clicking the Memory pivot label. /// public void OpenMemoryPanel() { this.MemoryLabel.Click(); this.MemoryPane.WaitForDisplayed(); } /// /// Gets all of the memory items listed in the Memory Pane. /// /// A readonly collection of memory items. public ReadOnlyCollection GetAllMemoryListViewItems() { OpenMemoryPanel(); return this.MemoryListView.FindElementsByClassName("ListViewItem"); } } }