public void TC45_VerifyAffiliateProgram() { string userByID = TestData.GetData("TC45_UserByID"); string affiliateTagID = TestData.GetData("TC45_AffiliateTagID"); string verificationLevel = TestData.GetData("TC45_VerificationLevel"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); try { TestProgressLogger.StartTest(); // Login as admin objAdminFunctions.AdminLogIn(TestProgressLogger); // Select user by entering UserID objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UserByIDText(userByID); objAdminCommonFunctions.OpenUserButton(); // Create Affiliate tag for the user objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); // Login as the user mentioned above and verify Affiliate program functionality userFunctions.LogIn(TestProgressLogger, Const.USER12); Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel), LogMessage.AffiliateProgramFailureMsg); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e); throw e; } finally { TestProgressLogger.EndTest(); } }
public void TC45_VerifyAffiliateProgram() { string userByID = TestData.GetData("TC45_UserByID"); string affiliateTagID = TestData.GetData("TC45_AffiliateTagID"); string verificationLevel = TestData.GetData("TC45_VerificationLevel"); TestProgressLogger.StartTest(); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); try { objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UserByIDText(userByID); objAdminCommonFunctions.OpenUserButton(); objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); userFunctions.LogIn(TestProgressLogger, Const.USER12); Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg)); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e); throw e; } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }