Add support for popover menus (for copy, paste etc)
Opened this issue · 2 comments
KaneCheshire commented
struct PopoverMenu: Element {
let id: String? = nil // There is only one menu shared across the app, and it has no ID.
let index: Int = 0
let type: XCUIElement.ElementType = .menu
let parent: Element
var numberOfItems: Int { return underlyingXCUIElement.descendants(matching: .menuItem).count }
init(parent: Element = App.shared) {
self.parent = parent
}
var copy: Item { return item(withID: "Copy") }
func item(withID id: String) -> Item {
return Item(id: id, parent: self)
}
}
extension PopoverMenu {
struct Item: Element, Tappable {
let id: String?
let type: XCUIElement.ElementType = .menuItem
let parent: Element
init(id: String, parent: PopoverMenu) {
self.id = id
self.parent = parent
}
}
}
KaneCheshire commented
These are actually called EditMenus in the HIGs: https://developer.apple.com/design/human-interface-guidelines/ios/controls/edit-menus/
KaneCheshire commented
Disregard that mention ^ as far as I can see that wasn't added so I'm not sure why I mentioned it here. Perhaps I meant to reference a different issue.