Пример #1
0
        //Modules
        public void login(String strAccount, String strUser, String strPwd)
        {
            //Object Repositories
            landingPage jobboxLandinPage = new landingPage();
            loginPage   jobboxLoginPage  = new loginPage();
            mainPage    jobboxMainPage   = new mainPage();

            Console.WriteLine("Starting Login Module\n" + "Account: " + strAccount + "\nUserName: "******"txtAccount"))))
            {
                pvAndroid.MobileTextField_EnterText(By.XPath(jobboxLandinPage.getXpath("txtAccount")), strAccount);
                pvAndroid.MobileButton_Click(By.XPath(jobboxLandinPage.getXpath("btnNext")));
            }

            pvAndroid.MobileTextField_EnterText(By.XPath(jobboxLoginPage.getXpath("txtUserName")), strUser);
            pvAndroid.MobileTextField_EnterText(By.XPath(jobboxLoginPage.getXpath("txtPwd")), strPwd);
            pvAndroid.MobileButton_Click(By.XPath(jobboxLoginPage.getXpath("btnLogin")));

            if (pvAndroid.MobileElement_Exists(By.XPath(jobboxMainPage.getXpath("btnInbox"))))
            {
                Console.WriteLine("User: "******" is able to log in to jobbox mobile App");
            }
            else
            {
                Console.WriteLine("An Error occurr while User: "******" trying to log in to jobbox mobile App");
            }
        }
Пример #2
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            HelixGenModel theModel = ((HelixGen.App)(App.Current)).Model;

            theModel.initializationProgress += TheModel_initializationProgress;

            // Show the version.

            Version thisVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            tbVersion.Text = string.Format("CopyRight To Helixgen,Version: {0}.{1}",
                                           thisVersion.Major.ToString(),
                                           thisVersion.Minor.ToString());

            // showMainPage();
            //AnalysPage = new AnalysePage(this);

            startupPage = new StartupPage(theModel);

            setUpPage   = new setUp(this);
            idInputPage = new IDInput(this);

            Loginpage = new loginPage(this);

            AnalysPage    = new AnalysePage(this);
            runResultPage = new RunResultPage(this);
            //_mainPage = new MainPage(this);

            NavFrame.Navigate(Loginpage);

            /*
             * StartupPage startupPage = new StartupPage(theModel);
             *
             * NavFrame.Navigate(startupPage);
             * Thread.Sleep(0);
             *
             * NavFrame.LoadCompleted += NavFrame_Startup_Navigated;
             */

#if false
            OpticsControlPage opticsPage = new OpticsControlPage();
            NavFrame.Navigate(opticsPage);

            opticsPage.Initialize();
#endif
#if false
            Thread.Sleep(10000);

            Task.Factory.StartNew(() => {
                Application.Current.Dispatcher.Invoke(
                    delegate { showMainPage(); }
                    );
            }
                                  );
#endif
        }
Пример #3
0
        public void Test_Case_2_Verify_Invalid_Email_Address_Error(string browserName)
        {
            Setup(browserName);
            var homePage  = new HomePageObjects(driver);
            var loginPage = new loginPage(driver);

            homePage.clickTheSignInBtn();
            loginPage.enterIncorrectEmailAddressPassword();
            loginPage.clickSignInAndVerifyIfErrorIsDisplayed();
        }
Пример #4
0
        public void Test_Case_5_Automate_End_To_End_Order(string browserName)
        {
            Setup(browserName);

            var homePage  = new HomePageObjects(driver);
            var loginPage = new loginPage(driver);

            homePage.clickTheSignInBtn();
            loginPage.performLogin();
            homePage.hoverOverWomenClothesTab();
        }
Пример #5
0
        public void Test_Case_4_Verify_Error_Messages_For_Incorrect_Values(string browserName)
        {
            Setup(browserName);
            var homePage      = new HomePageObjects(driver);
            var loginPage     = new loginPage(driver);
            var createAccount = new AccountCreationPage(driver);

            homePage.clickTheSignInBtn();
            loginPage.clickEmailAddressFieldAndEnterEmailAddress();
            loginPage.clickCreateAnAccountButton();
            createAccount.enterIncorrectRegistrationDetailsToTriggerErrors();
            createAccount.checkThatTheExpectedErrorsAreDisplayed();
        }
Пример #6
0
        public void Test_Case_3_Verify_Error_Messages_For_Mandatory_Fields(string browserName)
        {
            Setup(browserName);
            var homePage      = new HomePageObjects(driver);
            var loginPage     = new loginPage(driver);
            var createAccount = new AccountCreationPage(driver);

            homePage.clickTheSignInBtn();
            loginPage.clickEmailAddressFieldAndEnterEmailAddress();
            loginPage.clickCreateAnAccountButton();
            createAccount.clearEmailAddressField();
            createAccount.attemptRegistrationWithoutMandatoryFields();
            createAccount.checkThatTheExpectedErrorMessagesHaveDisplayed();
        }
Пример #7
0
        protected static async Task tryToLogin(string login, string password)
        {
            StringContent queryString = new StringContent("", Encoding.UTF8, "application/json");

            response = await client.PostAsync(response.RequestMessage.RequestUri.AbsoluteUri, queryString);

            var jsonString = response.Content.ReadAsStringAsync();

            jsonString.Wait();

            item = JsonConvert.DeserializeObject <loginPage>(jsonString.Result);

            for (int i = 0; i < item.callbacks.Count; i++)
            {
                if (item.callbacks.ElementAt(i).name == "form_username")
                {
                    item.callbacks.ElementAt(i).value = login;
                }
                if (item.callbacks.ElementAt(i).name == "form_password")
                {
                    item.callbacks.ElementAt(i).value = password;
                }
                if (item.callbacks.ElementAt(i).name == "form_confirmation")
                {
                    item.callbacks.ElementAt(i).value = "0";
                }
            }
            queryString = new StringContent(
                JsonConvert.SerializeObject(item), Encoding.UTF8, "application/json");

            response = await client.PostAsync(response.RequestMessage.RequestUri.AbsoluteUri, queryString);

            refer = response.RequestMessage.RequestUri.AbsoluteUri;
            Assert.AreEqual("OK", response.StatusCode.ToString(), "Status Code is not OK");

            jsonString = response.Content.ReadAsStringAsync();
            jsonString.Wait();
            item = JsonConvert.DeserializeObject <loginPage>(jsonString.Result);
        }
Пример #8
0
        public void Test_Case_1_Automate_Registration(string browserName)
        {
            try
            {
                Setup(browserName);
                var homePage     = new HomePageObjects(driver);
                var loginPage    = new loginPage(driver);
                var registration = new AccountCreationPage(driver);

                homePage.clickTheSignInBtn();
                loginPage.clickEmailAddressFieldAndEnterEmailAddress();
                loginPage.clickCreateAnAccountButton();
                registration.completePersonalInformation();
                registration.completeAddressDetails();
                registration.clickTheRegisterButton();
                registration.checkThatTheUserIsRegistered();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                var    screenshot = new Screenshots(driver);
                string fileName   = MethodBase.GetCurrentMethod().Name;
            }
        }
Пример #9
0
        public App()
        {
            InitializeComponent();

            MainPage = new loginPage();
        }