示例#1
0
        private void RestartApp()
        {
            // Disposing existing engine
            var previousTestExecutionEngine = ServicesCollection.Current.Resolve <Bellatrix.Mobile.TestExecutionEngine>();

            previousTestExecutionEngine.Dispose(ServicesCollection.Current);
            ServicesCollection.Current.UnregisterSingleInstance <TestExecutionEngine>();

            // Register the ExecutionEngine that should be used for the current run. Will be used in the next test as PreviousEngineType.
            var testExecutionEngine = new TestExecutionEngine();

            ServicesCollection.Current.RegisterInstance(testExecutionEngine);

            string classFullName = DetermineTestClassFullName();

            _androidBrowserStackAppConfiguration.InitializeAppiumOptions(classFullName);
            _androidCrossBrowserTestingAppConfiguration.InitializeAppiumOptions(classFullName);
            _androidSauceLabsAppConfiguration.InitializeAppiumOptions(classFullName);
            _iosBrowserStackAppConfiguration.InitializeAppiumOptions(classFullName);
            _iosCrossBrowserTestingAppConfiguration.InitializeAppiumOptions(classFullName);
            _iosSauceLabsAppConfiguration.InitializeAppiumOptions(classFullName);

            // Register the Browser type that should be used for the current run. Will be used in the next test as PreviousBrowserType.
            ServicesCollection.Current.RegisterInstance(_currentAppConfiguration);

            // Start the current engine with current browser type.
            testExecutionEngine.StartApp(_currentAppConfiguration, ServicesCollection.Current);
        }
示例#2
0
        private void ShutdownApp(ServicesCollection container)
        {
            var currentAppConfiguration = container.Resolve <AppConfiguration>("_currentAppConfiguration");

            ShutdownApp(container);

            // Register the ExecutionEngine that should be used for the current run. Will be used in the next test as PreviousEngineType.
            var testExecutionEngine = new TestExecutionEngine();

            // Register the app that should be used for the current run. Will be used in the next test as PreviousappType.
            container.RegisterInstance(currentAppConfiguration);

            // Start the current engine
            testExecutionEngine.StartApp(currentAppConfiguration, container);
        }
        private void RestartApp()
        {
            // Disposing existing engine
            var previousTestExecutionEngine = ServicesCollection.Current.Resolve <TestExecutionEngine>();

            previousTestExecutionEngine.Dispose(ServicesCollection.Current);
            ServicesCollection.Current.UnregisterSingleInstance <TestExecutionEngine>();

            // Register the ExecutionEngine that should be used for the current run. Will be used in the next test as PreviousEngineType.
            var testExecutionEngine = new TestExecutionEngine();

            ServicesCollection.Current.RegisterInstance(testExecutionEngine);

            // Register the Browser type that should be used for the current run. Will be used in the next test as PreviousBrowserType.
            ServicesCollection.Current.RegisterInstance(_currentAppConfiguration);

            // Start the current engine with current browser type.
            testExecutionEngine.StartApp(_currentAppConfiguration, ServicesCollection.Current);
        }