Exemplo n.º 1
0
        public ServiceResponse RunTest(Stream requestBody)
        {
            StreamReader reader = new StreamReader(requestBody);
            var contents = reader.ReadToEnd();

            var testSettings = JsonConvert.DeserializeObject<RemoteTestRunDetails>(contents, new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All
            });

            RemoteCommandManager processor = new RemoteCommandManager();

            try
            {
                var testDetails = RemoteCommandManager.GetRemoteCommands(testSettings);

                if (testDetails.ShowInterface)
                {
                    Messenger.Default.Send<GenericMessage<TestDetails>>(new GenericMessage<TestDetails>(testDetails));
                }
                else
                {
                    TestExecutionManager manager = new TestExecutionManager(testDetails);
                    manager.Execute();
                }
            }
            catch (Exception ex)
            {
                return new ServiceResponse { Status = "Error", Message = ex.Message };
            }

            return new ServiceResponse { Status = "Complete" };
        }
        public ServiceResponse RunTest(Stream requestBody)
        {
            StreamReader reader   = new StreamReader(requestBody);
            var          contents = reader.ReadToEnd();

            var commands = JsonConvert.DeserializeObject <List <RemoteCommandDetails> >(contents, new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All
            });

            RemoteCommandManager processor = new RemoteCommandManager();

            try
            {
                var testDetails = RemoteCommandManager.GetRemoteCommands(commands);
                Messenger.Default.Send <GenericMessage <TestDetails> >(new GenericMessage <TestDetails>(testDetails));

                //processor.Execute(new FluentAutomation.SeleniumWebDriver.AutomationProvider(), commands);
            }
            catch (Exception ex)
            {
                return(new ServiceResponse {
                    Status = "Error", Message = ex.Message
                });
            }

            return(new ServiceResponse {
                Status = "Complete"
            });
        }
        public ServiceResponse RunTest(Stream requestBody)
        {
            StreamReader reader = new StreamReader(requestBody);
            var contents = reader.ReadToEnd();

            var commands = JsonConvert.DeserializeObject<List<RemoteCommandDetails>>(contents, new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All
            });

            RemoteCommandManager processor = new RemoteCommandManager();

            try
            {
                var testDetails = RemoteCommandManager.GetRemoteCommands(commands);
                Messenger.Default.Send<GenericMessage<TestDetails>>(new GenericMessage<TestDetails>(testDetails));

                //processor.Execute(new FluentAutomation.SeleniumWebDriver.AutomationProvider(), commands);
            }
            catch (Exception ex)
            {
                return new ServiceResponse { Status = "Error", Message = ex.Message };
            }

            return new ServiceResponse { Status = "Complete" };
        }