public void TC44_VerifyCreateAPIKey() { try { TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); userFunctions.LogIn(TestProgressLogger, Const.USER1); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); Assert.True((userSettingsPage.SelectAPIKey()), LogMessage.CreateAPIKeyBtnIsPresent); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.CreateAPIKeyBtnIsPresent)); Assert.True((userSettingsPage.VerifyAPIKeyCheckboxesArePresent()), LogMessage.APIKeyCheckboxesArePresent); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.APIKeyCheckboxesArePresent)); Assert.True((userSettingsPage.CreateAndVerifyAPIKey()), LogMessage.APIKeyCreatedSuccessMsg); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.APIKeyCreatedSuccessMsg)); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(LogMessage.CreateAPIKeyFailed, e); throw e; } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
public void TC44_VerifyCreateAPIKey() { try { TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); userFunctions.LogIn(TestProgressLogger, Const.USER1); // Login -> navigate to User Settings and Select API Key Assert.True((userSettingsPage.SelectAPIKey()), LogMessage.CreateAPIKeyBtnIsNotPresent); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.CreateAPIKeyBtnIsPresent)); // Verify that the checkboxes are present Assert.True((userSettingsPage.VerifyAPIKeyCheckboxesArePresent()), LogMessage.APIKeyCheckboxesAreNotPresent); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.APIKeyCheckboxesArePresent)); // Create API key and verify the key is created successfully Assert.True((userSettingsPage.CreateAndVerifyAPIKey()), LogMessage.APIKeyCreatedFailureMsg); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.APIKeyCreatedSuccessMsg)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.CreateAPIKeyFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.CreateAPIKeyFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }