Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        public void HostNameEmptyThrows()
        {
            TestEnvironmentParameters parameters = new TestEnvironmentParameters {
                RS_LocalExecution          = "true",
                RS_LocalExecutionAsService = "true",
                RS_ServerHost   = "",
                RS_NodeExePath  = Constants.RS_NodeExePath,
                RS_AppiumJSPath = Constants.RS_AppiumJSPath
            };

            Assert.Throws <ArgumentNullException>(() => AppiumServer.Start(parameters), "Empty Hostname should throw.");
        }
Exemplo n.º 3
0
        public void InitSession()
        {
            server.Start();

            // Start session to desktop
            desktop.Start();
            SystemDriver = desktop.Driver;

            // Start session to app under test
            client.Start();
            Driver = client.Driver;
        }
Exemplo n.º 4
0
        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);
        }