Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: toggle Switch content for fluent #1078

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
<StackPanel Spacing="20">

<ToggleSwitch Header="OFF"
AutomationProperties.AutomationId="fluent_Off"
Foreground="{ThemeResource OnBackgroundBrush}" />
<ToggleSwitch Header="ON"
AutomationProperties.AutomationId="fluent_On"
Foreground="{ThemeResource OnBackgroundBrush}"
IsOn="True" />

<ToggleSwitch Header="DISABLED OFF"
AutomationProperties.AutomationId="fluent_Disabled_Off"
IsEnabled="False" />
<ToggleSwitch Header="DISABLED ON"
AutomationProperties.AutomationId="fluent_Disabled_On"
IsEnabled="False"
IsOn="True" />
</StackPanel>
Expand Down
35 changes: 35 additions & 0 deletions Uno.Gallery/Uno.Gallery.UITest/Given_ToggleSwitch_Fluent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Uno.UITest.Helpers.Queries;
using Uno.UITests.Helpers;

namespace Uno.Gallery.UITests
{

public class Given_ToggleSwitch_Fluent : TestBase
{

[Test]
public void WhenToggleSwitchOff()
{
NavigateToSample("ToggleSwitch", "Fluent");

TakeScreenshot("Before On");
var offToggleSwitch = new QueryEx(x => x.All().Marked("fluent_Off"));
App.ScrollDownTo("fluent_Off");
offToggleSwitch.Tap();
TakeScreenshot("After On");
Assert.IsTrue(offToggleSwitch.GetDependencyPropertyValue<bool>("IsOn"));





}

}
}
Loading