Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/design/ots/appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ drive the same application on all three desktop platforms through a common
otherwise-inaccessible base constructor.
- **`AutomationProperties.AutomationId`** — added to `MainWindowView.axaml`'s
menu items and dock control, and to the interactive controls of the About
dialog, Workspace panel, and Predefined Views panel, giving
`MobileBy.AccessibilityId` lookups a stable, Appium-reliable target
dialog, Query dialog (shared `ElementFilterView`'s type-filter controls plus
the dialog's own close button), Workspace panel, and Predefined Views panel,
giving `MobileBy.AccessibilityId` lookups a stable, Appium-reliable target
independent of `Name`/`x:Name`.
- **`MobileBy.Name`/`MobileBy.AccessibilityId`** — locate top-level menus and
automation-id-tagged controls in the real accessibility tree.
Expand Down
1 change: 1 addition & 0 deletions docs/reqstream/ots/appium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ sections:
- 'DesktopApp_ViewMenu_DiagnosticsMenuItem_IsDiscoverableAndEnabled'
- 'DesktopApp_ViewMenu_ViewBuilderDialogMenuItem_IsDiscoverableAndEnabled'
- 'DesktopApp_QueryMenu_QueryDialogMenuItem_IsDiscoverableAndEnabled'
- 'DesktopApp_QueryMenu_QueryDialogMenuItem_OpensAndClosesQueryDialog'
- 'DesktopApp_HelpMenu_AboutMenuItem_OpensAndClosesAboutDialog'
- 'DesktopApp_FileMenu_CloseAllMenuItem_IsDiscoverableAndEnabled'
19 changes: 16 additions & 3 deletions docs/verification/ots/appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,29 @@ one child menu item by automation id, asserting it is both displayed and
enabled, then closes the menu via Escape without clicking the item. These
extend automation-id coverage breadth-first across every subsystem's
top-level entry point (workspace panel, predefined views, diagnostics,
custom view builder, query dialog, close-all) without needing to click
through to a dialog or native OS surface that this tier cannot yet reliably
tear down.
custom view builder, query dialog, close-all). The View menu's toggle items
and the Query dialog now also have dedicated click-through round-trip
tests (see below); the others are not yet clicked because they open a
dialog whose controls don't carry automation ids yet
(`ViewBuilderDialogMenuItem`) or a native OS surface outside Avalonia's own
accessibility tree (`AddFileSourceMenuItem`/`AddFolderSourceMenuItem`), or
because a menu item click here would leave the shared `AppFixture` session
in a different state for whichever test runs next (`CloseAllMenuItem`).

**DesktopApp_HelpMenu_AboutMenuItem_OpensAndClosesAboutDialog**: Opens the
Help menu, clicks "About" (`AboutMenuItem`), confirms the modal About
dialog's `AboutDialogOkButton` becomes visible, then dismisses it - proving
a full menu-click-to-modal-dialog round trip works end-to-end through the
real windowed application.

**DesktopApp_QueryMenu_QueryDialogMenuItem_OpensAndClosesQueryDialog**: The
same open/click/assert/close round-trip shape as the About dialog test
above, applied to the Query dialog - opens the Query menu, clicks "Run
Query..." (`QueryDialogMenuItem`), confirms the dialog's own
`AddTypeFilterButton` (part of the shared `ElementFilterView`) becomes
visible, then dismisses it via `QueryDialogCloseButton`, reusing the same
close button already exercised by the inspection-screenshot tests below.

**DesktopApp_ViewMenu_WorkspacePanelMenuItem_TogglesWorkspacePanel**,
**DesktopApp_ViewMenu_PredefinedViewsMenuItem_TogglesPredefinedViewsPanel**, and
**DesktopApp_ViewMenu_DiagnosticsMenuItem_TogglesDiagnosticsPanel**: Unlike the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,55 @@ public void DesktopApp_ViewMenu_ViewBuilderDialogMenuItem_IsDiscoverableAndEnabl

/// <summary>
/// Validates that the Query menu's "Run Query..." item, found by the <c>QueryDialogMenuItem</c>
/// automation id, is discoverable and enabled. Not clicked, for the same reason as
/// <see cref="DesktopApp_ViewMenu_ViewBuilderDialogMenuItem_IsDiscoverableAndEnabled" />.
/// automation id, is discoverable and enabled. Not clicked here (see
/// <see cref="DesktopApp_QueryMenu_QueryDialogMenuItem_OpensAndClosesQueryDialog" /> for the full
/// open/close round trip through the real dialog).
/// </summary>
[Fact]
public void DesktopApp_QueryMenu_QueryDialogMenuItem_IsDiscoverableAndEnabled()
{
AssertMenuItemIsDiscoverableAndEnabled("Query", "QueryDialogMenuItem");
}

/// <summary>
/// Validates that clicking the Query menu's "Run Query..." item, found by the
/// <c>QueryDialogMenuItem</c> automation id, opens the modal Query dialog, discoverable by its own
/// <c>AddTypeFilterButton</c> automation id (part of the shared <c>ElementFilterView</c>), and that
/// dismissing it via its <c>QueryDialogCloseButton</c> actually closes the dialog again (confirmed by
/// waiting for <c>AddTypeFilterButton</c> to disappear from the accessibility tree) - the same
/// open/click/assert/close round-trip shape as
/// <see cref="DesktopApp_HelpMenu_AboutMenuItem_OpensAndClosesAboutDialog" />, using the close button
/// already exercised by <see cref="DesktopApp_QueryDialog_AddTypeFilterButton_CapturesInspectionScreenshot" />.
/// </summary>
[Fact]
public void DesktopApp_QueryMenu_QueryDialogMenuItem_OpensAndClosesQueryDialog()
{
// Arrange
var queryMenu = _session.FindElement(MobileBy.Name("Query"));
queryMenu.Click();
var queryDialogMenuItem = _session.FindElement(MobileBy.AccessibilityId("QueryDialogMenuItem"));
queryDialogMenuItem.Click();

try
{
// Act
var addTypeFilterButton = _session.FindElement(MobileBy.AccessibilityId("AddTypeFilterButton"));

// Assert
Assert.True(addTypeFilterButton.Displayed);

_session.FindElement(MobileBy.AccessibilityId("QueryDialogCloseButton")).Click();

var closed = WaitUntil(() => _session.FindElements(MobileBy.AccessibilityId("AddTypeFilterButton")).Count == 0);
Assert.True(closed, "The Query dialog's 'AddTypeFilterButton' was still present after closing it via 'QueryDialogCloseButton'.");
}
catch
{
TryCloseAnyOpenDialogWithEscape();
throw;
}
}

/// <summary>
/// Opens the named top-level menu, locates the child item by automation id, asserts it is displayed and
/// enabled, then closes the menu via Escape without clicking the item itself - proving the item is
Expand Down
Loading