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

Fixed IsEnabled Property not works on Tabs #26728

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "Modified test cases"
This reverts commit 369097d.
  • Loading branch information
Dhivya-SF4094 committed Dec 20, 2024
commit 6dba59040d0657e3a17aadd19038be7314579af7
14 changes: 0 additions & 14 deletions .vscode/launch.json

This file was deleted.

39 changes: 5 additions & 34 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue5161.cs
Original file line number Diff line number Diff line change
@@ -75,8 +75,7 @@ public SecondPage()
{
new Label
{
Text="This is second Page",
AutomationId="SecondPageLabel"
Text = "This is Second Page",
}
}
};
@@ -86,46 +85,18 @@ public class ThirdPage : ContentPage
{
public ThirdPage()
{
var label = new Label
{
Text = "This is Third Page",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
};

var button = new Button
{
Text = "Enable SecondTab",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
};
button.AutomationId="Button";
button.Clicked += OnButtonClicked;
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
Children =
{
label,
button
new Label
{
Text = "This is Third Page",
}
}
};

}
private void OnButtonClicked(object sender, EventArgs e)
{
if (Application.Current?.Windows.Count > 0 &&
Application.Current.Windows[0].Page is Shell shell)
{
var secondTab = shell.CurrentItem?.Items[1];
if (secondTab is not null)
secondTab.IsEnabled = true;
}
else
{
System.Diagnostics.Debug.WriteLine("Shell not found!");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -18,9 +18,6 @@ public void CheckIsEnabled()
App.WaitForElement("ThirdPage");
App.Tap("ThirdPage");
App.Tap("SecondPage");
App.WaitForNoElement("SecondPageLabel");
App.Tap("Button");
App.Tap("SecondPage");
App.WaitForElement("SecondPageLabel");
App.WaitForElement("This is Third Page");
}
}