WebService

Learn how to use BELLATRIX iOS WebService.

Example

[TestFixture] [IOSWebAttribute(Constants.IOSNativeAppPath,     Constants.IOSDefaultVersion,     Constants.IOSDefaultDeviceName,     Lifecycle.ReuseIfStarted)] public class WebServiceTests : IOSTest {     [Test]     public void HtmlSourceContainsShop_When_OpenWebPageWithChrome()     {         App.Web.NavigationService.Navigate("http://demos.bellatrix.solutions/");         Assert.IsTrue(App.Web.BrowserService.HtmlSource.Contains("Shop"));     } } 

Explanations

BELLATRIX gives you an interface for easier work with web apps. Using it, you can access most of the features of BELLATRIX web APIs.

[TestFixture] [IOSWebAttribute(Constants.IOSNativeAppPath,     Constants.IOSDefaultVersion,     Constants.IOSDefaultDeviceName,     Lifecycle.ReuseIfStarted)] public class WebServiceTests : IOSTest 

To test web apps, you can start Chrome browser using the IOSWeb attribute.

App.Web.NavigationService.Navigate("http://demos.bellatrix.solutions/"); 

Opens Chrome browser and navigates to the mentioned page.

Assert.IsTrue(App.Web.BrowserService.HtmlSource.Contains("Shop")); 

Through Web property you can access almost all BELLATRIX Web APIs.