Slider
A range from 0 to 100 in steps of 1. The number next to it follows the slider.
Volume
What to practise
- Move the slider to a percentage of its width; read the value.
- Set an exact value (e.g. 73) and check both the slider and the number.
In VAF: AsSlideBar().LetsSetValue(73), LetsMoveToPercentage(25).
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 ExactValueIsSet()
{
SharedContext.App.Should().HaveSection<SliderPage.Volume>()
.That.Should().HaveElement<SliderPage.Volume.Slider>()
.That.AsSlideBar().LetsSetValue(73);
SharedContext.App.Should().HaveSection<SliderPage.Volume>()
.That.Should().HaveElement<SliderPage.Volume.Slider>()
.That.AsSlideBar().Should().HaveValue("73")
.AndAlso().Should().HaveElement<SliderPage.Volume.Value>()
.That.AsLabelText().Should().HaveValue("73");
}
On GitHub (opens in a new tab)
-
Page object
—
SliderPage.cs: the locators of this page -
Native tests
—
SliderTests.cs: the whole VAF chain in each test - The whole project and its README Latest test run (GitHub Actions)