public void AppiumServiceShouldNotStartIfLocalExecutionIsFalse() { TestEnvironmentParameters parameters = new TestEnvironmentParameters { RS_LocalExecution = "false", RS_LocalExecutionAsService = "true" }; AppiumServer.Start(parameters); Assert.False(MobileTestContext.ContainsKey(Constants.AppiumServiceKey), "Service should not have started"); }
public void TearDown() { if (MobileTestContext.ContainsKey(Constants.AppiumServerLogFileKey)) { if (File.Exists(Constants.AppiumServerLogFileKey)) { File.Delete(Constants.AppiumServerLogFileKey); } } MobileTestContext.Dispose(); }
public void SecondAppiumServiceStartsIfLocalExecutionAndLocalExecutionAsServiceAreTrue() { TestEnvironmentParameters parameters = new TestEnvironmentParameters { RS_LocalExecution = "true", RS_LocalExecutionAsService = "true", RS_ServerHost = "127.0.0.1", RS_NodeExePath = Constants.RS_NodeExePath, RS_AppiumJSPath = Constants.RS_AppiumJSPath, RS_ServerPort = "0000" }; AppiumServer.Start(parameters); Uri serviceUri = parameters.ServerUri; Assert.True(MobileTestContext.ContainsKey(Constants.AppiumServiceKey), "Service should have started"); Assert.NotNull(serviceUri, "Service should not be null."); Assert.AreEqual(serviceUri, $"http://{Constants.RS_ServerHost}:{parameters.RS_ServerPort}{Constants.RS_ServerResource}", "Service Url does not match default Url"); Assert.AreNotEqual(parameters.RS_ServerPort, firstTestPortNumber, "Service should start on different port numbers"); Console.WriteLine(serviceUri.AbsoluteUri); }