コード例 #1
0
ファイル: ViewUITests.cs プロジェクト: lhx11187/maui
        public virtual void _IsEnabled()
        {
            //var propName = Test.VisualElement.IsEnabled.ToString ();
            var remote = new StateViewContainerRemote(App, Test.VisualElement.IsEnabled, PlatformViewType);

            remote.GoTo();

            var enabled = remote.GetProperty <bool>(View.IsEnabledProperty);

            Assert.IsTrue(enabled);

            remote.TapStateButton();

            enabled = remote.GetProperty <bool>(View.IsEnabledProperty);
            Assert.IsFalse(enabled);

            remote.TapStateButton();

            var isEnabled = remote.GetStateLabel().ReadText();

            Assert.AreEqual("True", isEnabled);

            remote.TapStateButton();

            var isDisabled = remote.GetStateLabel().ReadText();

            Assert.AreEqual("False", isDisabled);
        }
コード例 #2
0
        public void ClearButtonVisibility()
        {
            var remote = new StateViewContainerRemote(App, Test.Entry.ClearButtonVisibility, PlatformViewType);

            remote.GoTo();

            App.WaitForElement(q => q.Marked("Toggle ClearButtonVisibility"));
            App.Tap(q => q.Marked("Toggle ClearButtonVisibility"));
        }
コード例 #3
0
ファイル: EntryUITests.cs プロジェクト: yy520a/Xamarin.Forms
        public override void _Focus()
        {
            var remote = new StateViewContainerRemote(App, Test.VisualElement.Focus, PlatformViewType);

            remote.GoTo();

            Assert.IsFalse(IsFocused());
            remote.TapView();
            Assert.IsTrue(IsFocused());
            App.Tap("Go");             // Won't do anything, we just need to take focus away from the Entry
            Assert.IsFalse(IsFocused());
        }
コード例 #4
0
        public override void _Focus()
        {
            var remote = new StateViewContainerRemote(App, Test.VisualElement.Focus, PlatformViewType);

            remote.GoTo();
            bool isFocused = System.Convert.ToBoolean(App.Query("FocusStateLabel")[0].ReadText());

            Assert.IsFalse(isFocused);
            remote.TapView();
            isFocused = System.Convert.ToBoolean(App.Query("FocusStateLabel")[0].ReadText());
            Assert.IsTrue(isFocused);
            App.Tap("FocusStateLabel");
            isFocused = System.Convert.ToBoolean(App.Query("FocusStateLabel")[0].ReadText());
            Assert.IsFalse(isFocused);
        }
コード例 #5
0
        public virtual void _IsVisible()
        {
            var remote = new StateViewContainerRemote(App, Test.VisualElement.IsVisible, PlatformViewType);

            remote.GoTo();

            var viewPre = remote.GetViews();

            Assert.AreEqual(1, viewPre.Length);

            remote.TapStateButton();

            var viewPost = remote.GetViews();

            Assert.AreEqual(0, viewPost.Length);
        }
コード例 #6
0
		public virtual void _IsEnabled ()
		{
			//var propName = Test.VisualElement.IsEnabled.ToString ();
			var remote = new StateViewContainerRemote (App, Test.VisualElement.IsEnabled, PlatformViewType);
			remote.GoTo ();

			var enabled = remote.GetProperty<bool> (View.IsEnabledProperty);
			Assert.IsTrue (enabled);

			remote.TapStateButton ();

			enabled = remote.GetProperty<bool> (View.IsEnabledProperty);
			Assert.IsFalse (enabled);

			remote.TapStateButton ();

			var isEnabled = remote.GetStateLabel ().Text;
			Assert.AreEqual ("True", isEnabled);

			remote.TapStateButton ();

			var isDisabled = remote.GetStateLabel ().Text;
			Assert.AreEqual ("False", isDisabled);
		}
コード例 #7
0
		public virtual void _IsVisible ()
		{
			var remote = new StateViewContainerRemote (App, Test.VisualElement.IsVisible, PlatformViewType);
			remote.GoTo ();

			var viewPre = remote.GetViews ();

			Assert.AreEqual (1, viewPre.Length);

			remote.TapStateButton ();

			var viewPost = remote.GetViews ();
	
			Assert.AreEqual (0, viewPost.Length);
		}