Beispiel #1
0
        public PersonalDetailsDataObj VerifyObj(PersonalDetailsDataObj _obj)
        {
            PersonalDetailsDataObj _object = new PersonalDetailsDataObj
            {
                Title           = _obj.Title ?? RandomTitle(),
                FirstName       = _obj.FirstName ?? RandomString(5),
                MiddleName      = _obj.MiddleName ?? RandomString(4),
                LastName        = _obj.LastName ?? RandomString(4),
                DOB             = _obj.DOB ?? GetRandomDOB(),
                DOB_Day         = _obj.DOB_Day ?? RandomDay(),
                DOB_Month       = _obj.DOB_Month ?? RandomMonth(),
                DOB_Year        = _obj.DOB_Year ?? RandomYear(),
                Email           = _obj.Email ?? RandomEmail(),
                Password        = _obj.Password ?? "password",
                ConfirmPassword = _obj.ConfirmPassword ?? "password",
                HomePhone       = _obj.HomePhone ?? "0" + RandomNumber(9),
                MobilePhone     = _obj.MobilePhone ?? "04" + RandomNumber(8),
                Address         = _obj.Address ?? "TestAddress#@",
                UnitNumber      = _obj.UnitNumber ?? RandomNumber(4),
                StreetNumber    = _obj.StreetNumber ?? RandomNumber(3),
                Rmsrvcode       = _obj.Rmsrvcode ?? " Rmsrv:0.9999",
                StreetName      = _obj.StreetName ?? "At:N Cr:A Id:100 Rr1:A Rr2:A Rr3:A Bsp:Y",
                StreetType      = _obj.StreetType ?? RandomStreeType()
            };
            int index = Convert.ToInt32(RandomNumber(2));

            _object.Suburb           = _obj.Suburb ?? RandomSubrubPostCode(index, 0);
            _object.PostCode         = _obj.PostCode ?? RandomSubrubPostCode(index, 1);
            _object.EmploymentStatus = _obj.EmploymentStatus ?? "Full Time";
            _object.UnemploymentDesc = _obj.UnemploymentDesc ?? "Student";
            _object.Have2SACCLoan    = _obj.Have2SACCLoan ?? "No";
            _object.UserType         = _obj.UserType ?? "New";

            return(_object);
        }
Beispiel #2
0
        public async void VerifyFraudEmail(PersonalDetailsDataObj _perData)
        {
            //check if object is null if not assign value
            PersonalDetailsDataObj _personalData = VerifyObj(_perData);

            _act.waitForVisibilityOfElement(_personaldetailsLoc.Title, 60);
            _act.selectByOptionText(_personaldetailsLoc.Title, _personalData.Title, "Title");
            Thread.Sleep(2000); // Required for Title select
            _act.EnterText(_personaldetailsLoc.FirstName, _personalData.FirstName);
            _act.EnterText(_personaldetailsLoc.MiddleName, _personalData.MiddleName);
            _act.EnterText(_personaldetailsLoc.LastName, _personalData.LastName);
            if (GetPlatform(_driver))
            {
                _act.selectByOptionText(_personaldetailsLoc.Dob_Day, _personalData.DOB_Day, "Day");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Month, _personalData.DOB_Month, "Month");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Year, _personalData.DOB_Year, "Year");
            }
            else
            {
                _act.EnterText(_personaldetailsLoc.DOB, _personalData.DOB);
            }
            _act.EnterText(_personaldetailsLoc.Email, _personalData.Email);

            string email = _driver.FindElement(_personaldetailsLoc.Email).GetAttribute("value");

            Console.WriteLine(email);
        }
Beispiel #3
0
        public PersonalDetailsDataObj PersonalDetailsFunction1()
        {
            PersonalDetailsDataObj _obj = PopulatePersonalDetails();

            // Click on checks out Continue Button
            //ClickCheckoutContinueBtn();
            return(_obj);
        }
Beispiel #4
0
        public async void PopulatePersonalDetails(PersonalDetailsDataObj _perData)
        {
            //check if object is null if not assign value
            PersonalDetailsDataObj _personalData = VerifyObj(_perData);

            _act.waitForVisibilityOfElement(_personaldetailsLoc.Title, 60);
            _act.selectByOptionText(_personaldetailsLoc.Title, _personalData.Title, "Title");
            Thread.Sleep(2000); // Required for Title select
            _act.EnterText(_personaldetailsLoc.FirstName, _personalData.FirstName);
            _act.EnterText(_personaldetailsLoc.MiddleName, _personalData.MiddleName);
            _act.EnterText(_personaldetailsLoc.LastName, _personalData.LastName);
            if (GetPlatform(_driver))
            {
                _act.selectByOptionText(_personaldetailsLoc.Dob_Day, _personalData.DOB_Day, "Day");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Month, _personalData.DOB_Month, "Month");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Year, _personalData.DOB_Year, "Year");
            }
            else
            {
                _act.EnterText(_personaldetailsLoc.DOB, _personalData.DOB);
            }
            _act.EnterText(_personaldetailsLoc.Email, _personalData.Email);
            _act.EnterText(_personaldetailsLoc.Password, _personalData.Password);
            _act.EnterText(_personaldetailsLoc.ConfirmPassword, _personalData.ConfirmPassword);
            // string email = _driver.FindElement(_personaldetailsLoc.Email).GetAttribute("value");
            Console.WriteLine(_personalData.Email);
            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Next2Button, "clickContinueButtonAfterEmail");
            }
            _act.EnterText(_personaldetailsLoc.Homephone, _personalData.HomePhone);
            _act.EnterText(_personaldetailsLoc.Mobilephone, _personalData.MobilePhone);
            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Address, "Address");
                _act.waitForVisibilityOfElement(_personaldetailsLoc.AddressSearch, 60);
                _act.EnterText(_personaldetailsLoc.AddressSearch, "TestAddress#");
                IWebElement addressAutofill = _driver.FindElement(_personaldetailsLoc.AddressAutoFillBtn);
                // if(_act.isElementDisplayed(AddressAutofill))
                if (_act.isElementPresent(_personaldetailsLoc.AddressAutoFillBtn))
                {
                    _act.click(_personaldetailsLoc.AddressAutoFillBtn, "AddressAutoFillBtn");
                }
            }
            else
            {
                _act.EnterText(_personaldetailsLoc.Address, "TestAddress#");
                _act.waitForVisibilityOfElement(_personaldetailsLoc.AddressAutoFillBtn, 120);
                IWebElement addressAutofill = _driver.FindElement(_personaldetailsLoc.AddressAutoFillBtn);
                if (_act.isElementDisplayed(addressAutofill))
                {
                    _act.click(_personaldetailsLoc.AddressAutoFillBtn, "AddressAutoFillBtn");
                }
            }
            _act.waitForVisibilityOfElement(_personaldetailsLoc.Unitnumber, 60);
            _act.EnterText(_personaldetailsLoc.Unitnumber, _personalData.UnitNumber);
            Thread.Sleep(1000);
            _act.Sync(_personaldetailsLoc.Streetnumber);
            _act.EnterText(_personaldetailsLoc.Streetnumber, _personalData.StreetNumber);
            Thread.Sleep(1000);
            _act.EnterText(_personaldetailsLoc.StreetName, _personalData.StreetName + _personalData.Rmsrvcode);
            _act.EnterText(_personaldetailsLoc.Streettype, _personalData.StreetType);
            _act.EnterText(_personaldetailsLoc.Suburbtype, _personalData.Suburb);
            _act.EnterText(_personaldetailsLoc.Postcode, _personalData.PostCode);

            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Next3Button, "clickContinueButtonAfterStreetName");
            }
            _act.selectByOptionText(_personaldetailsLoc.EmploymentStatus, _personalData.EmploymentStatus, "EmploymentStatus");

            if (_personalData.EmploymentStatus == "Unemployed")
            {
                _act.selectByOptionText(_personaldetailsLoc.UnemploymentDesc, _personalData.UnemploymentDesc, "UnEmploymentDesc");
            }

            if (_personalData.Have2SACCLoan == "Yes")
            {
                _act.click(_personaldetailsLoc.ShortTermLoanStatusYes, "ShortTermLoanStatusYes");
            }
            else
            {
                _act.click(_personaldetailsLoc.ShortTermLoanStatusNo, "ShortTermLoanStatusNo");
            }
            CheckReadPrivacyBtn(_personalData.UserType);
            CheckReadCreditBtn(_personalData.UserType);

            _act.click(_personaldetailsLoc.personaldetailscontinuebutton, "personaldetailscontinuebutton");

            TestUtility _testut    = new TestUtility();
            string      strbuilder = DateTime.Now.ToString("MM-dd-yy HH:mm") + " " + TestContext.CurrentContext.Test.Name + "*" + _personalData.Email + Environment.NewLine;

            EmailID = _personalData.Email;
            await _testut.WriteToFile(strbuilder);
        }
Beispiel #5
0
        public PersonalDetailsDataObj PopulatePersonalDetails()
        {
            PersonalDetailsDataObj _obj = new PersonalDetailsDataObj
            {
                FirstName = RandomString(5),
                Email     = RandomEmail()
            };

            string Password = "******";

            _act.waitForVisibilityOfElement(_personaldetailsLoc.Title, 30);
            _act.selectByOptionText(_personaldetailsLoc.Title, RandomTitle(), "Title");
            Thread.Sleep(2000); //required for title select
            _act.EnterText(_personaldetailsLoc.FirstName, _obj.FirstName);
            _act.EnterText(_personaldetailsLoc.MiddleName, RandomString(4));
            _act.EnterText(_personaldetailsLoc.LastName, RandomString(4));
            if (GetPlatform(_driver))
            {
                _act.selectByOptionText(_personaldetailsLoc.Dob_Day, RandomDay(), "Day");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Month, RandomMonth(), "Month");
                _act.selectByOptionText(_personaldetailsLoc.Dob_Year, RandomYear(), "Year");
            }
            else
            {
                _act.EnterText(_personaldetailsLoc.DOB, GetRandomDOB());
            }
            _act.EnterText(_personaldetailsLoc.Email, _obj.Email);
            _act.EnterText(_personaldetailsLoc.Password, Password);
            _act.EnterText(_personaldetailsLoc.ConfirmPassword, Password);

            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Next2Button, "clickContinueButtonAfterEmail");
            }
            _act.EnterText(_personaldetailsLoc.Homephone, "0" + RandomNumber(9));
            _act.EnterText(_personaldetailsLoc.Mobilephone, "04" + RandomNumber(8));
            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Address, "Address");
                _act.waitForVisibilityOfElement(_personaldetailsLoc.AddressSearch, 30);
                _act.EnterText(_personaldetailsLoc.AddressSearch, "TestAddress#");
                _act.waitForVisibilityOfElement(_personaldetailsLoc.AddressAutoFillBtn, 60);
                if (_act.isElementPresent(_personaldetailsLoc.AddressAutoFillBtn))
                {
                    _act.click(_personaldetailsLoc.AddressAutoFillBtn, "AddressAutoFillBtn");
                }
            }
            else
            {
                _act.EnterText(_personaldetailsLoc.Address, "TestAddress#");
                _act.waitForVisibilityOfElement(_personaldetailsLoc.AddressAutoFillBtn, 60);
                IWebElement addressAutofill = _driver.FindElement(_personaldetailsLoc.AddressAutoFillBtn);
                if (_act.isElementDisplayed(addressAutofill))
                {
                    _act.JSClick(_personaldetailsLoc.AddressAutoFillBtn, "AddressAutoFillBtn");
                }
            }
            _act.waitForVisibilityOfElement(_personaldetailsLoc.Unitnumber, 60);
            Thread.Sleep(100);
            _act.EnterText(_personaldetailsLoc.Unitnumber, RandomNumber(3));
            Thread.Sleep(1000);
            _act.Sync(_personaldetailsLoc.Streetnumber);
            _act.EnterText(_personaldetailsLoc.Streetnumber, RandomNumber(3));
            Thread.Sleep(100);
            _act.EnterText(_personaldetailsLoc.StreetName, "At:N Cr:A Id:100 Rr1:A Rr2:A Rr3:A Bsp:Y Rmsrv:0.9999"); //At:N Cr:A Id:100 Rr1:A Rr2:A Rr3:A Rr:A Rt:8 Bsp:Y Rmsrv:0.9999
            _act.EnterText(_personaldetailsLoc.Streettype, RandomStreeType());
            int index = Convert.ToInt32(RandomNumber(2));

            _act.EnterText(_personaldetailsLoc.Suburbtype, RandomSubrubPostCode(index, 0));
            _act.EnterText(_personaldetailsLoc.Postcode, RandomSubrubPostCode(index, 1));
            if (GetPlatform(_driver))
            {
                _act.click(_personaldetailsLoc.Next3Button, "clickContinueButtonAfterStreetName");
            }
            _act.waitForVisibilityOfElement(_personaldetailsLoc.EmploymentStatus, 30);
            _act.selectByOptionText(_personaldetailsLoc.EmploymentStatus, "Full Time", "EmploymentStatus");
            _act.click(_personaldetailsLoc.ShortTermLoanStatusNo, "ShortTermLoanStatusNo");
            CheckReadPrivacyBtn("New");
            CheckReadCreditBtn("New");
            _act.click(_personaldetailsLoc.personaldetailscontinuebutton, "personaldetailscontinuebutton");


            TestUtility testut     = new TestUtility();
            string      strbuilder = DateTime.Now.ToString("MM-dd-yy HH:mm") + " " + TestContext.CurrentContext.Test.Name + "*" + _obj.Email + Environment.NewLine;

            EmailID = _obj.Email;
            Console.WriteLine(_obj.Email);
            testut.WriteToFile(strbuilder);

            return(_obj);
        }