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: developing UI test for radio button. #1067

Merged
merged 8 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion Uno.Gallery/Uno.Gallery.UITest/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Uno.Gallery.UITests
{
public class Constants
{
public readonly static string WebAssemblyDefaultUri = "http://localhost:56745/";
public readonly static string WebAssemblyDefaultUri = "https://localhost:55643/";
public readonly static string iOSAppName = "com.nventive.uno.gallery";
public readonly static string AndroidAppName = "com.nventive.uno.ui.demo";
public readonly static string iOSDeviceNameOrId = "iPad Pro (12.9-inch) (5th generation)";
Expand Down
81 changes: 81 additions & 0 deletions Uno.Gallery/Uno.Gallery.UITest/Given_RadioButton_02_Fluent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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_RadioButton_02_Fluent : TestBase
{
/* This one is used to test the Unchecked option which we have in fluent */

[Test]
public void WhenRadioButtonFluentClick_01_Unchecked()
{
NavigateToSample("RadioButton", "Fluent");

TakeScreenshot("Before Tap");
var FluentUncheckRadioButton = new QueryEx(x => x.All().Marked("RadioButton_Fluent_Unchecked"));
Darsh0307 marked this conversation as resolved.
Show resolved Hide resolved

App.ScrollDownTo("RadioButton_Fluent_Unchecked");

FluentUncheckRadioButton.Tap();
TakeScreenshot("After Tap");
Assert.IsTrue(FluentUncheckRadioButton.GetDependencyPropertyValue<bool>("IsChecked"));

}
[Test]

public void WhenRadioButtonFluentClick_02_Checked()
Darsh0307 marked this conversation as resolved.
Show resolved Hide resolved
{
NavigateToSample("RadioButton", "Fluent");

TakeScreenshot("Before Tap");
var FluentCheckedRadioButton = new QueryEx(x => x.All().Marked("RadioButton_Fluent_Checked"));

App.ScrollDownTo("RadioButton_Fluent_Checked");

FluentCheckedRadioButton.Tap();
TakeScreenshot("After Tap");
Assert.IsTrue(FluentCheckedRadioButton.GetDependencyPropertyValue<bool>("IsChecked"));

}
[Test]
public void WhenRadioButtonFluentClick_03_DisabledUnchecked()
{
NavigateToSample("RadioButton", "Fluent");

TakeScreenshot("Before Tap");
var FluentDisabledUnCheckedRadioButton = new QueryEx(x => x.All().Marked("RadioButton_Fluent_Disabled_Unchecked"));

App.ScrollDownTo("RadioButton_Fluent_Disabled_Unchecked");

FluentDisabledUnCheckedRadioButton.Tap();
TakeScreenshot("After Tap");
Assert.IsFalse(FluentDisabledUnCheckedRadioButton.GetDependencyPropertyValue<bool>("IsEnabled"));
Assert.IsFalse(FluentDisabledUnCheckedRadioButton.GetDependencyPropertyValue<bool>("IsChecked"));

}
[Test]
public void WhenRadioButtonFluentClick_04_DisabledChecked()
{
NavigateToSample("RadioButton", "Fluent");

TakeScreenshot("Before Tap");
var FluentDisabledCheckedRadioButton = new QueryEx(x => x.All().Marked("RadioButton_Material_Disabled_Checked"));

App.ScrollDownTo("RadioButton_Material_Disabled_Checked");

FluentDisabledCheckedRadioButton.Tap();
TakeScreenshot("After Tap");
Assert.IsFalse(FluentDisabledCheckedRadioButton.GetDependencyPropertyValue<bool>("IsEnabled"));
Assert.IsTrue(FluentDisabledCheckedRadioButton.GetDependencyPropertyValue<bool>("IsChecked"));

}
}
}
Loading