public void TC46_VerifyDeleteAPIKey()
        {
            UserFunctions   userFunctions    = new UserFunctions(TestProgressLogger);
            UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();
                // Login as user -> Create and Delete the API Key
                userFunctions.LogIn(TestProgressLogger, Const.USER2);
                Assert.True(userSettingsPage.DeleteAPIKey(driver), LogMessage.DeleteAPIKeyFailureMsg);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.DeleteAPIKeySuccessMsg));
            }
            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(LogMessage.DeleteAPIKeyFailureMsg, ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(LogMessage.DeleteAPIKeyFailureMsg, e);
                throw e;
            }
            finally
            {
                TestProgressLogger.EndTest();
            }
        }
Beispiel #2
0
        public static void Initialize()
        {
            ResourcesCreator.Establish();
            Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0);

            socket.Connect("8.8.8.8", 65530);
            IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;

            localIP = endPoint.Address.ToString();
            socket.Close();

            //
            httpClient             = new HttpClient();
            httpClient.BaseAddress = new Uri(Route.BaseUrl);
            httpClient.DefaultRequestHeaders.Accept.Clear();
            httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));

            //
            NotificationInvalidEmailOrPassword = Application.Current.FindResource("NotificationInvalidEmailOrPassword").ToString();
            ExceptionNullFilePath = Application.Current.FindResource("ExceptionNullFilePath").ToString();
            ExceptionFileNotFound = Application.Current.FindResource("ExceptionFileNotFound").ToString();

            //
            loginPage       = new LoginPage("a");
            mainPage        = new MainPage();
            userSettingPage = new UserSettingPage();
        }
        public void TC46_VerifyDeleteAPIKey()
        {
            UserFunctions   userFunctions    = new UserFunctions(TestProgressLogger);
            UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();
                userFunctions.LogIn(TestProgressLogger, Const.USER2);
                Assert.True(userSettingsPage.DeleteAPIKey(driver), LogMessage.DeleteAPIKeySuccessMsg);
                TestProgressLogger.LogCheckPoint(String.Format(LogMessage.DeleteAPIKeySuccessMsg));
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogError(LogMessage.DeleteAPIKeyFailureMsg, 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);
         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();
     }
 }
Beispiel #5
0
 public UserSetting(UserSettingPage mainPage)
 {
     page = mainPage;
     BackToBeforePageClicked = new RelayCommand(BackToBeforePage, CanGoBack);
     RegisterClicked         = new RelayCommandWithParameter <object>(Register, CanGoBack);
     ResultVisibility        = Visibility.Collapsed;
     Registering             = false;
     CheckServerSettingFile();
 }
Beispiel #6
0
        public void VerifyDeleteAPIKey()
        {
            driver.Navigate().GoToUrl("https://apexwebqa.azurewebsites.net/exchange");
            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

            //Login as a User say XYZ
            UserFunctions objUserFunctionality = new UserFunctions(output);

            objUserFunctionality.LogIn();

            UserSettingPage usp = new UserSettingPage(driver, output);

            Assert.True(usp.DeleteAPIKey(driver));
        }
        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();
            }
        }
Beispiel #8
0
        public void VerifyAffiliateProgram()
        {
            // Admin login
            // Verify Trader has affiliate tag set up inadmin UI
            driver.Navigate().GoToUrl("https://apexwebqa.azurewebsites.net/exchange");
            driver.Manage().Window.Maximize();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

            //Login as a User say XYZ
            UserFunctions objUserFunctionality = new UserFunctions(output);

            objUserFunctionality.LogIn();

            // Note the number of affiliate programs
            UserSettingPage usp = new UserSettingPage(driver, output);

            Assert.True(usp.VerifyAffiliateProgramFunctionality(driver));
        }
        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();
            }
        }
        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();
            }
        }