예제 #1
0
        public ApprendaTestSession(IApprendaApiClientFactory clientFactory, ISmokeTestSettings connectionSettings, TestIsolationLevel isolationLevel,
                                   ITelemetryReportingService reportingService, string testName, IUserLogin loginToUse = null)
        {
            _clientFactory     = clientFactory;
            ConnectionSettings = connectionSettings;
            _reportingService  = reportingService;
            _testName          = testName;
            _login             = loginToUse ?? connectionSettings.UserLogin;
            TestIsolationLevel = isolationLevel;

            NumberOfSessionsInUse++;
        }
예제 #2
0
        protected async Task <IApprendaTestSession> StartAdminSession(TestIsolationLevel isolationLevel = TestIsolationLevel.None, [CallerMemberName] string testName = "")
        {
            if (isolationLevel == TestIsolationLevel.CompletelyIsolated)
            {
                await WaitUntilNoOtherTestsAreRunnning();
            }

            var connectionProperties = await _connectionSettingsFactory.GetSmokeTestSettings();

            if (connectionProperties.AdminUserLogin == null)
            {
                connectionProperties.AdminUserLogin = _userLoginRepository.GetAdminUserLogin();
            }
            var session = new ApprendaTestSession(_apiClientFactory, connectionProperties, isolationLevel, _reportingService, testName, connectionProperties.AdminUserLogin);

            //ping that we've started!
            _reportingService?.ReportInfo($"Starting test {testName} as admin", new List <string> {
                "teststart", testName
            });

            return(session);
        }
예제 #3
0
        protected async Task <IApprendaTestSession> StartSession(string userName, string password, TestIsolationLevel isolationLevel = TestIsolationLevel.None, [CallerMemberName] string testName = "")
        {
            if (isolationLevel == TestIsolationLevel.CompletelyIsolated)
            {
                await WaitUntilNoOtherTestsAreRunnning();
            }

            var connectionProperties = await _connectionSettingsFactory.GetSmokeTestSettings();

            connectionProperties.UserLogin = new UserLogin
            {
                UserName = userName,
                Password = password
            };

            return(new ApprendaTestSession(_apiClientFactory, connectionProperties, isolationLevel, _reportingService, testName));
        }