maui-linux/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issu.../Issue2289.xaml.cs

103 строки
2.7 KiB
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using System.Windows.Input;
using System.Diagnostics;
Add more UWP automated testing capabilities (#1252) * Implement Clear(marked) method * For Windows tests where we need to query a value we can't get, mark inconclusive * Fix queries for multi-line "marked" values * Force frames with text in them to be "tappable" * Actually rerun queries during retry * Update images for package deployment * Allow the tests to restart the Control Gallery if it crashes * UWP tests can now activate context menus * Make double-tap (really double click) work for UWP desktop * Get some basic scroll up/down functions working * ScrollTo functions * Modify ListViewRenderer automation peer to prevent freezing on ListViews * Allow automation to find tabs * Temporarily ignore some of the tests which don't do much * Make ListViews with string/value type lists work * Add note about 29257/60478 * Use toggle button for test 30353 for UWP * Handle getting screen bounds consistently * Make test for G2414 use ActivateContextMenu extension method * Simplify UI test for 31330 and make it runnable on Windows * Add notes on failing tests * Add query for MoreButton on G2809 test * Ignore ActivityIndicator IsRunning test for UWP * Use ScrollDownTo instead of ScrollForElement method on Windows * CellsGalleryTestCellList now working on UWP * Cells tests working on UWP * Re-add Tap to ScrollAndTap * Get rid of custom automation peer stuff and just fix the tests * Viewport caching and multi-monitor support for scroll * Modified scroll values to hopefully get this running correctly on high density screen * Clear messages so Appearing tests don't freeze up automation on UWP * Make test for 32230 compatible with UWP * Make test 32615 compatible with UWP * Use ActivateContextMenu to simplify 34561 test * Add notes for 34912 failure * Make 36171 test compatible with UWP tests Add directions for running the tests locally * PR cleanup
2017-11-10 13:52:25 +03:00
using Xamarin.Forms.Internals;
2016-03-22 23:02:25 +03:00
#if UITEST
Add more UWP automated testing capabilities (#1252) * Implement Clear(marked) method * For Windows tests where we need to query a value we can't get, mark inconclusive * Fix queries for multi-line "marked" values * Force frames with text in them to be "tappable" * Actually rerun queries during retry * Update images for package deployment * Allow the tests to restart the Control Gallery if it crashes * UWP tests can now activate context menus * Make double-tap (really double click) work for UWP desktop * Get some basic scroll up/down functions working * ScrollTo functions * Modify ListViewRenderer automation peer to prevent freezing on ListViews * Allow automation to find tabs * Temporarily ignore some of the tests which don't do much * Make ListViews with string/value type lists work * Add note about 29257/60478 * Use toggle button for test 30353 for UWP * Handle getting screen bounds consistently * Make test for G2414 use ActivateContextMenu extension method * Simplify UI test for 31330 and make it runnable on Windows * Add notes on failing tests * Add query for MoreButton on G2809 test * Ignore ActivityIndicator IsRunning test for UWP * Use ScrollDownTo instead of ScrollForElement method on Windows * CellsGalleryTestCellList now working on UWP * Cells tests working on UWP * Re-add Tap to ScrollAndTap * Get rid of custom automation peer stuff and just fix the tests * Viewport caching and multi-monitor support for scroll * Modified scroll values to hopefully get this running correctly on high density screen * Clear messages so Appearing tests don't freeze up automation on UWP * Make test for 32230 compatible with UWP * Make test 32615 compatible with UWP * Use ActivateContextMenu to simplify 34561 test * Add notes for 34912 failure * Make 36171 test compatible with UWP tests Add directions for running the tests locally * PR cleanup
2017-11-10 13:52:25 +03:00
using Xamarin.Forms.Core.UITests;
2016-03-22 23:02:25 +03:00
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.iOS;
#endif
namespace Xamarin.Forms.Controls.Issues
2016-03-22 23:02:25 +03:00
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2289, "TextCell IsEnabled property not disabling element in TableView", PlatformAffected.iOS)]
public partial class Issue2289 : TestContentPage
{
#if APP
public Issue2289 ()
{
InitializeComponent ();
}
#endif
protected override void Init ()
{
MoreCommand = new Command<MenuItem> ((menuItem) => {
Debug.WriteLine ("More! Command Called!");
});
DeleteCommand = new Command<MenuItem> ((menuItem) => {
Debug.WriteLine ("Delete Command Called!");
});
BindingContext = this;
}
public ICommand MoreCommand { get; protected set; }
public ICommand DeleteCommand { get; protected set; }
#if UITEST && __IOS__
2016-03-22 23:02:25 +03:00
[Test]
[Ignore("Fails sometimes on XTC")]
public void TestIsEnabledFalse ()
{
var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisable1")) [0];
Assert.IsFalse (disable1.Enabled);
var disable2 = RunningApp.Query (c => c.Marked ("txtCellDisable2")) [0];
Assert.IsFalse (disable2.Enabled);
2016-03-22 23:02:25 +03:00
}
[Test]
[Ignore("Fails sometimes on XTC")]
public void TestIsEnabledFalseContextActions ()
{
var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisableContextActions1")) [0];
Assert.IsFalse (disable1.Enabled);
Add more UWP automated testing capabilities (#1252) * Implement Clear(marked) method * For Windows tests where we need to query a value we can't get, mark inconclusive * Fix queries for multi-line "marked" values * Force frames with text in them to be "tappable" * Actually rerun queries during retry * Update images for package deployment * Allow the tests to restart the Control Gallery if it crashes * UWP tests can now activate context menus * Make double-tap (really double click) work for UWP desktop * Get some basic scroll up/down functions working * ScrollTo functions * Modify ListViewRenderer automation peer to prevent freezing on ListViews * Allow automation to find tabs * Temporarily ignore some of the tests which don't do much * Make ListViews with string/value type lists work * Add note about 29257/60478 * Use toggle button for test 30353 for UWP * Handle getting screen bounds consistently * Make test for G2414 use ActivateContextMenu extension method * Simplify UI test for 31330 and make it runnable on Windows * Add notes on failing tests * Add query for MoreButton on G2809 test * Ignore ActivityIndicator IsRunning test for UWP * Use ScrollDownTo instead of ScrollForElement method on Windows * CellsGalleryTestCellList now working on UWP * Cells tests working on UWP * Re-add Tap to ScrollAndTap * Get rid of custom automation peer stuff and just fix the tests * Viewport caching and multi-monitor support for scroll * Modified scroll values to hopefully get this running correctly on high density screen * Clear messages so Appearing tests don't freeze up automation on UWP * Make test for 32230 compatible with UWP * Make test 32615 compatible with UWP * Use ActivateContextMenu to simplify 34561 test * Add notes for 34912 failure * Make 36171 test compatible with UWP tests Add directions for running the tests locally * PR cleanup
2017-11-10 13:52:25 +03:00
var screenBounds = RunningApp.RootViewRect();
RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY);
RunningApp.Screenshot ("Not showing context menu");
RunningApp.WaitForNoElement (c => c.Marked ("More"));
RunningApp.TapCoordinates (screenBounds.CenterX, screenBounds.CenterY);
2016-03-22 23:02:25 +03:00
}
[Test]
[Ignore("Fails sometimes on XTC")]
public void TestIsEnabledTrue ()
{
var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnable1")) [0];
Assert.IsTrue (disable1.Enabled);
var disable2 = RunningApp.Query (c => c.Marked ("txtCellEnable2")) [0];
Assert.IsTrue (disable2.Enabled);
2016-03-22 23:02:25 +03:00
}
[Test]
[Ignore("Fails sometimes on XTC")]
public void TestIsEnabledTrueContextActions ()
{
var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnabledContextActions1")) [0];
Assert.IsTrue (disable1.Enabled);
2016-03-22 23:02:25 +03:00
Add more UWP automated testing capabilities (#1252) * Implement Clear(marked) method * For Windows tests where we need to query a value we can't get, mark inconclusive * Fix queries for multi-line "marked" values * Force frames with text in them to be "tappable" * Actually rerun queries during retry * Update images for package deployment * Allow the tests to restart the Control Gallery if it crashes * UWP tests can now activate context menus * Make double-tap (really double click) work for UWP desktop * Get some basic scroll up/down functions working * ScrollTo functions * Modify ListViewRenderer automation peer to prevent freezing on ListViews * Allow automation to find tabs * Temporarily ignore some of the tests which don't do much * Make ListViews with string/value type lists work * Add note about 29257/60478 * Use toggle button for test 30353 for UWP * Handle getting screen bounds consistently * Make test for G2414 use ActivateContextMenu extension method * Simplify UI test for 31330 and make it runnable on Windows * Add notes on failing tests * Add query for MoreButton on G2809 test * Ignore ActivityIndicator IsRunning test for UWP * Use ScrollDownTo instead of ScrollForElement method on Windows * CellsGalleryTestCellList now working on UWP * Cells tests working on UWP * Re-add Tap to ScrollAndTap * Get rid of custom automation peer stuff and just fix the tests * Viewport caching and multi-monitor support for scroll * Modified scroll values to hopefully get this running correctly on high density screen * Clear messages so Appearing tests don't freeze up automation on UWP * Make test for 32230 compatible with UWP * Make test 32615 compatible with UWP * Use ActivateContextMenu to simplify 34561 test * Add notes for 34912 failure * Make 36171 test compatible with UWP tests Add directions for running the tests locally * PR cleanup
2017-11-10 13:52:25 +03:00
var screenBounds = RunningApp.RootViewRect();
2016-03-22 23:02:25 +03:00
RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY);
2016-03-22 23:02:25 +03:00
RunningApp.Screenshot ("Showing context menu");
RunningApp.WaitForElement (c => c.Marked ("More"));
2016-03-22 23:02:25 +03:00
}
#endif
}
}