Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix test 26993 iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Sep 16, 2019
1 parent 2373a68 commit 4b5c106
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.iOS/local.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<body>
<h1 id="#LocalHtmlPage">Xamarin.Forms</h1>
<p>This is a local iOS Html page</p>
<a href="https://www.google.com">Go to Google</a>
<a id="#LocalHtmlPageLink" href="https://www.google.com">Go to Google</a>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Xamarin.Forms.CustomAttributes;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
using System.Linq;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
Expand Down Expand Up @@ -101,19 +102,33 @@ public void Bugzilla26993Test()
{
RunningApp.Screenshot("I am at BZ26993");

#if __IOS__
RunningApp.WaitForElement(q => q.Class("WKWebView"));

RunningApp.Query(q => q.Class("WKWebView").Index(0).InvokeJS("document.getElementById('LinkID0').click()"));
RunningApp.Screenshot("Load local HTML");

RunningApp.WaitForNoElement(q => q.Class("WKWebView").Css("#LinkID0"));
UITest.Queries.AppWebResult[] newElem =
RunningApp.QueryUntilPresent(() => RunningApp.Query(q => q.Class("WKWebView").Css("a")));

Assert.AreEqual("#LocalHtmlPageLink", newElem[0].Id);
#elif __ANDROID__
RunningApp.WaitForElement(q => q.WebView(0).Css("#CellID0"));
RunningApp.Tap(q => q.WebView(0).Css("#LinkID0"));

RunningApp.Screenshot("Load local HTML");

RunningApp.WaitForNoElement(q => q.WebView(0).Css("#LinkID0"));

UITest.Queries.AppWebResult[] newElem =
RunningApp.QueryUntilPresent(() => RunningApp.Query(q => q.WebView(0).Css("h1")));

Assert.AreEqual("#LocalHtmlPage", newElem[0].Id);
#endif

RunningApp.Screenshot("I see the Label");
}
#endif
}
}
}
}

0 comments on commit 4b5c106

Please sign in to comment.