Menus and panels
A drop-down menu, a panel that opens and closes, and tabs. What is closed is in the page but not visible.
2. A panel that opens and closes
These are the details. They are in the page all the time, but visible only while the panel is open.
3. Tabs
A small product to practise on.
Weight 1 kg, width 20 cm.
No reviews yet.
What to practise
- Open the menu, choose an item and read the result; the items are not visible until the menu is open.
- Open the panel and read it; close it again and check that it is not visible.
- Switch tabs and read the pane; check that "Archive" is disabled; count the tabs.
In VAF: AsMenu(), AsPane(), AsSection() — guide, section 2.
Tested in VAF-Demo
A test of this page from VAF-Demo: the whole VAF chain, from the page to the element, is in the test.
[Test]
public void MenuItemIsChosen()
{
// A closed menu: the item is in the page, but not shown.
SharedContext.App.Should().HaveSection<NavigationPage.AccountMenu>()
.That.Should().NotHaveElement<NavigationPage.AccountMenu.Settings>();
SharedContext.App.Should().HaveSection<NavigationPage.AccountMenu>()
.That.Should().HaveElement<NavigationPage.AccountMenu.Open>()
.That.AsMenu().LetsClick()
.AndAlso().Should().HaveElement<NavigationPage.AccountMenu.Settings>()
.That.AsMenu().LetsClick()
.AndAlso().Should().HaveElement<NavigationPage.AccountMenu.Result>()
.That.AsLabelText().Should().HaveValue("Settings");
}
On GitHub (opens in a new tab)
-
Page object
—
NavigationPage.cs: the locators of this page -
Native tests
—
NavigationTests.cs: the whole VAF chain in each test - The whole project and its README Latest test run (GitHub Actions)