public void TC011_VerifyWhenAutomationCreatesRITM(string strmobiledevice)
        {
            starttime  = DateTime.Now;
            strMessage = string.Format("\r\n\t " + TestContext.CurrentContext.Test.Name + " Starts");

            _driver      = _testengine.TestSetup(strmobiledevice);
            _homescreen1 = new HomeScreen1(_driver, "NR");
            _asknowpage  = new AskNowPage(_driver, "NR");

            DataTable AddReturnInPerson = ExcelReader.ReadExcelFile("EquipmentReturn", "AutomationExist", true);
            int       rowcount          = AddReturnInPerson.Rows.Count;

            string[] empId       = new string[rowcount];
            string[] isvalidRITM = new string[rowcount];

            for (int j = 0; j < rowcount; j++)
            {
                Dictionary <string, string> AddUserTestData = AddReturnInPerson.Columns
                                                              .Cast <DataColumn>().ToDictionary(col => col.ColumnName, col => AddReturnInPerson.Rows[j][col].ToString());
                empId[j]       = AddUserTestData["EmpId"];
                isvalidRITM[j] = AddUserTestData["isvalidRITM"];
            }

            for (int i = 0; i < rowcount; i++)
            {
                _driver.Url = WebuiURL;
                bool flag = false;
                do
                {
                    _homescreen1.EnterEmpID(empId[i]);

                    _homescreen1.PressTabonEmpID();

                    if (isvalidRITM[i] == "True")
                    {
                        Assert.IsFalse(_homescreen1.VerifyOracleIDNotFoundPopUp());

                        Assert.IsNotEmpty(_homescreen1.GetFirstNameText());

                        Assert.IsNotEmpty(_homescreen1.GetLastNameText());

                        Assert.IsNotEmpty(_homescreen1.GetEmailText());

                        Assert.IsNotEmpty(_homescreen1.GetPhoneNumberText());
                    }
                    else if (isvalidRITM[i] == "False")
                    {
                        Assert.IsTrue(_homescreen1.VerifyOracleIDNotFoundPopUp());
                    }

                    string ReqNumber = _homescreen1.FetchREQNumber();

                    _asknowpage.FetchRITMParameters(ReqNumber, 1, "Non-Responder - Returner");
                } while (flag);
            }
        }
Exemple #2
0
        private void loginBtn_Click(object sender, EventArgs e)
        {
            Key obj = new Key();

            if (obj.CheckValidity("2MUCC5DCCP98AY8V84MM742FR", DateTime.Now))
            {
                //---User name---
                if (Usernametxt.Text == "")
                {
                    UnameErrorLabel.Visible = true;
                }
                else
                {
                    UnameErrorLabel.Visible = false;
                }
                //---password---
                if (Passwordtxt.Text == "")
                {
                    passErrorLabell.Visible = true;
                }
                else
                {
                    passErrorLabell.Visible = false;
                }

                if (UnameErrorLabel.Visible || passErrorLabell.Visible)
                {
                    MainClass.ShowMSG("Fields * are Mandatory", "Stop", "Unsuccessfully");
                }
                else
                {
                    if (retrival.getUserDetails(Usernametxt.Text, Passwordtxt.Text))
                    {
                        if (Usernametxt.Text == "Admin" || Usernametxt.Text == "admin")
                        {
                            HomeScreen hm = new HomeScreen();
                            MainClass.showWindows(hm, this, MDI.ActiveForm);
                        }
                        else
                        {
                            HomeScreen1 hm1 = new HomeScreen1();
                            MainClass.showWindows(hm1, this, MDI.ActiveForm);
                        }
                    }
                    else
                    {
                    }
                }
            }
            else
            {
                MainClass.ShowMSG("Software Key has been expired \nPlease Contact Software Developer", "Stop", "Unsuccessfully");
            }
        }
        public void TC002_VerifyingEmptyEmployeeOracleID(string strmobiledevice)
        {
            starttime  = DateTime.Now;
            strMessage = string.Format("\r\n\t " + TestContext.CurrentContext.Test.Name + " Starts");

            try
            {
                _driver      = _testengine.TestSetup(strmobiledevice);
                _homescreen1 = new HomeScreen1(_driver, "NR");

                ResultDbHelper _resul = new ResultDbHelper();

                // enter FirstName
                //_homescreen1.EnterFirstName();

                bool attrvalueempID = _homescreen1.GetEmployeeIDFieldStyle();
                Assert.IsTrue(attrvalueempID);

                bool attrvaluefName = _homescreen1.GetFirstNameFieldStyle();
                Assert.IsTrue(attrvaluefName);

                bool attrvaluelName = _homescreen1.GetLastNameFieldStyle();
                Assert.IsTrue(attrvaluelName);

                bool attrvalueemail = _homescreen1.GetEmailFieldStyle();
                Assert.IsTrue(attrvalueemail);

                bool attrvaluephone = _homescreen1.GetPhoneFieldStyle();
                Assert.IsTrue(attrvaluephone);

                bool attrvaluereturnoption = _homescreen1.GetReturnOptionFieldStyle();
                Assert.IsTrue(attrvaluereturnoption);

                // click on Next button
                _homescreen1.ClickNextBtn();

                ExtentReport.ReportPass(TestContext.CurrentContext.Test.FullName);
            }
            catch (Exception ex)
            {
                strMessage += ex.Message;
                ExtentReport.ReportFail(ex.Message);
                _xml.FailureTests(TestContext.CurrentContext.Test.FullName);
                _xml.FailurePlaylist(TestContext.CurrentContext.Test.FullName);
                Assert.Fail(ex.Message);
            }
        }
        public void TC008_VerifyingRequiredFieldValidator(string strmobiledevice)
        {
            starttime  = DateTime.Now;
            strMessage = string.Format("\r\n\t " + TestContext.CurrentContext.Test.Name + " Starts");

            _driver      = _testengine.TestSetup(strmobiledevice);
            _homescreen1 = new HomeScreen1(_driver, "NR");
            _homescreen2 = new HomeScreen2(_driver, "NR");

            DataTable AddReturnInPerson = ExcelReader.ReadExcelFile("EquipmentReturn", "VerifyRequiredFields", true);
            int       rowcount          = AddReturnInPerson.Rows.Count;

            string[] empId         = new string[rowcount];
            string[] isvalidEmpId  = new string[rowcount];
            string[] popupContinue = new string[rowcount];
            string[] popupCorrect  = new string[rowcount];
            string[] empId2        = new string[rowcount];
            string[] isvalidEmpId2 = new string[rowcount];
            string[] firstName     = new string[rowcount];
            string[] lastName      = new string[rowcount];
            string[] personalEmail = new string[rowcount];
            string[] phoneumber    = new string[rowcount];
            string[] returnType    = new string[rowcount];
            string[] site          = new string[rowcount];
            string[] date          = new string[rowcount];
            string[] time          = new string[rowcount];
            string[] packMaterial  = new string[rowcount];
            string[] addressLine1  = new string[rowcount];
            string[] addressLine2  = new string[rowcount];
            string[] city          = new string[rowcount];
            string[] state         = new string[rowcount];
            string[] country       = new string[rowcount];
            string[] zipcode       = new string[rowcount];

            for (int j = 0; j < rowcount; j++)
            {
                Dictionary <string, string> AddUserTestData = AddReturnInPerson.Columns
                                                              .Cast <DataColumn>().ToDictionary(col => col.ColumnName, col => AddReturnInPerson.Rows[j][col].ToString());
                empId[j]         = AddUserTestData["EmpId"];
                isvalidEmpId[j]  = AddUserTestData["IsValidEmpId"];
                popupContinue[j] = AddUserTestData["PopupContinue"];
                popupCorrect[j]  = AddUserTestData["PopupCorrect"];
                empId2[j]        = AddUserTestData["EmpId2"];
                isvalidEmpId2[j] = AddUserTestData["IsValidEmpId2"];
                firstName[j]     = AddUserTestData["FirstName"];
                lastName[j]      = AddUserTestData["LastName"];
                personalEmail[j] = AddUserTestData["PersonalEmail"];
                phoneumber[j]    = AddUserTestData["Phoneumber"];
                returnType[j]    = AddUserTestData["ReturnType"];
                site[j]          = AddUserTestData["Site"];
                date[j]          = AddUserTestData["Date"];
                time[j]          = AddUserTestData["Time"];
                packMaterial[j]  = AddUserTestData["PackMaterial"];
                addressLine1[j]  = AddUserTestData["AddressLine1"];
                addressLine2[j]  = AddUserTestData["AddressLine2"];
                city[j]          = AddUserTestData["City"];
                state[j]         = AddUserTestData["State"];
                country[j]       = AddUserTestData["Country"];
                zipcode[j]       = AddUserTestData["Zipcode"];
            }

            for (int i = 0; i < rowcount; i++)
            {
                _driver.Url = WebuiURL;
                bool flag = false;
                do
                {
                    _homescreen1.EnterEmpID(empId[i]);

                    _homescreen1.PressTabonEmpID();

                    if (isvalidEmpId[i] == "True")
                    {
                        Assert.IsFalse(_homescreen1.VerifyOracleIDNotFoundPopUp());
                    }
                    else
                    {
                        Assert.IsTrue(_homescreen1.VerifyOracleIDNotFoundPopUp());

                        if (popupContinue[i] == "True")
                        {
                            if (_homescreen1.ClickpopupContinueBtn())
                            {
                                _homescreen1.EnterFirstName(firstName[i]);

                                _homescreen1.EnterLastName(lastName[i]);
                            }
                            flag = false;
                        }

                        if (popupCorrect[i] == "True")
                        {
                            _homescreen1.ClickpopupCorrectBtn();
                            empId[i]        = empId2[i];
                            isvalidEmpId[i] = isvalidEmpId2[i];
                            flag            = true;
                        }
                    }
                } while (flag);

                // Screen 1

                _homescreen1.EnterPersonalEmail(personalEmail[i]);

                _homescreen1.EnterPhoneNumber(phoneumber[i]);

                _homescreen1.ClickVerifyPhnBtn();

                // explicitly waiting until OTP sent
                Thread.Sleep(10000);

                string VerificationCode = _homescreen1.FetchVerificationCode();

                _homescreen1.ClickVerifyPhnBtn();

                _homescreen1.EnterOTP(VerificationCode);

                _homescreen1.ClickSubmitOTPBtn();

                if (returnType[i] == "Return In Person")
                {
                    _homescreen1.SelectReturnType(returnType[i]);

                    _homescreen1.SelectSiteLocation(site[i]);

                    _homescreen1.EnterDate(date[i]);

                    _homescreen1.SelectTime(time[i]);
                }
                else if (returnType[i] == "FedEx Shipping")
                {
                    _homescreen1.SelectReturnType(returnType[i]);

                    if (packMaterial[i] == "Yes")
                    {
                        _homescreen1.ClickPackMaterialYes();
                    }
                    else
                    {
                        _homescreen1.ClickPackMaterialNo();
                    }

                    _homescreen1.EnterAddressLine1(addressLine1[i]);

                    _homescreen1.EnterAddressLine2(addressLine2[i]);

                    _homescreen1.EnterCity(city[i]);

                    _homescreen1.SelectState(state[i]);

                    _homescreen1.SelectCountry(country[i]);

                    _homescreen1.EnterZipcode(zipcode[i]);
                }

                //click on captch manually --> need to automate
                Thread.Sleep(5000);

                _homescreen1.ClickNextBtn();

                // Screen 2

                _homescreen2.VerifyThankYouLabel();

                string InPersonConfirmMsg = "We have received your appointment confirmation, we look forward to your equipment drop off." +
                                            "If you need to reschedule your return for any reason Please email [email protected] and provide your full name, Oracle ID, phone number, personal email and confirmation number, if possible.";

                string FedExConfirmMsg = "We have received your request, you will receive an email from FedEx with further instruction to complete your drop off." +
                                         "Please note it may take up to 24 hours for the email with your shipping details from FedEx to be delivered.";

                if (returnType[i] == "Return In Person")
                {
                    string ActualConfirmMsg = _homescreen2.GetConfirmationMsg();

                    Assert.AreEqual(InPersonConfirmMsg, ActualConfirmMsg);
                }
                else
                {
                    string ActualConfirmMsg = _homescreen2.GetConfirmationMsg();

                    Assert.AreEqual(FedExConfirmMsg, ActualConfirmMsg);
                }

                _homescreen2.VerifyRequestNumber();

                // if want to return REQ Number
                //_homescreen2.GetReqNumber();
            }
        }
        public void TC006_VerifyingEndToEndFlowwithReturnInPerson(string strmobiledevice)
        {
            starttime  = DateTime.Now;
            strMessage = string.Format("\r\n\t " + TestContext.CurrentContext.Test.Name + " Starts");

            _driver      = _testengine.TestSetup(strmobiledevice);
            _homescreen1 = new HomeScreen1(_driver, "NR");
            _homescreen2 = new HomeScreen2(_driver, "NR");

            DataTable AddReturnInPerson = ExcelReader.ReadExcelFile("EquipmentReturn", "ReturnInPerson", true);
            int       rowcount          = AddReturnInPerson.Rows.Count;

            string[] empId         = new string[rowcount];
            string[] isvalidEmpId  = new string[rowcount];
            string[] popupContinue = new string[rowcount];
            string[] popupCorrect  = new string[rowcount];
            string[] empId2        = new string[rowcount];
            string[] isvalidEmpId2 = new string[rowcount];
            string[] firstName     = new string[rowcount];
            string[] lastName      = new string[rowcount];
            string[] personalEmail = new string[rowcount];
            string[] phoneumber    = new string[rowcount];
            string[] returnType    = new string[rowcount];
            string[] site          = new string[rowcount];
            string[] date          = new string[rowcount];
            string[] time          = new string[rowcount];

            for (int j = 0; j < rowcount; j++)
            {
                Dictionary <string, string> AddUserTestData = AddReturnInPerson.Columns
                                                              .Cast <DataColumn>().ToDictionary(col => col.ColumnName, col => AddReturnInPerson.Rows[j][col].ToString());
                empId[j]         = AddUserTestData["EmpId"];
                isvalidEmpId[j]  = AddUserTestData["IsValidEmpId"];
                popupContinue[j] = AddUserTestData["PopupContinue"];
                popupCorrect[j]  = AddUserTestData["PopupCorrect"];
                empId2[j]        = AddUserTestData["EmpId2"];
                isvalidEmpId2[j] = AddUserTestData["IsValidEmpId2"];
                firstName[j]     = AddUserTestData["FirstName"];
                lastName[j]      = AddUserTestData["LastName"];
                personalEmail[j] = AddUserTestData["PersonalEmail"];
                phoneumber[j]    = AddUserTestData["Phoneumber"];
                returnType[j]    = AddUserTestData["ReturnType"];
                site[j]          = AddUserTestData["Site"];
                date[j]          = AddUserTestData["Date"];
                time[j]          = AddUserTestData["Time"];
            }

            for (int i = 0; i < rowcount; i++)
            {
                _driver.Url = WebuiURL;
                bool flag = false;
                do
                {
                    _homescreen1.EnterEmpID(empId[i]);

                    _homescreen1.PressTabonEmpID();

                    if (isvalidEmpId[i] == "True")
                    {
                        Assert.IsFalse(_homescreen1.VerifyOracleIDNotFoundPopUp());
                    }
                    else
                    {
                        Assert.IsTrue(_homescreen1.VerifyOracleIDNotFoundPopUp());

                        if (popupContinue[i] == "True")
                        {
                            if (_homescreen1.ClickpopupContinueBtn())
                            {
                                _homescreen1.EnterFirstName(firstName[i]);

                                _homescreen1.EnterLastName(lastName[i]);
                            }
                            flag = false;
                        }

                        if (popupCorrect[i] == "True")
                        {
                            _homescreen1.ClickpopupCorrectBtn();
                            empId[i]        = empId2[i];
                            isvalidEmpId[i] = isvalidEmpId2[i];
                            flag            = true;
                        }
                    }
                } while (flag);

                // Screen 1

                _homescreen1.EnterPersonalEmail(personalEmail[i]);

                _homescreen1.EnterPhoneNumber(phoneumber[i]);

                _homescreen1.ClickVerifyPhnBtn();

                // explicitly waiting until OTP sent
                Thread.Sleep(10000);

                string VerificationCode = _homescreen1.FetchVerificationCodeTab();

                _homescreen1.ClickVerifyPhnBtn();

                _homescreen1.EnterOTP(VerificationCode);

                _homescreen1.ClickSubmitOTPBtn();

                _homescreen1.SelectReturnType(returnType[i]);

                _homescreen1.SelectSiteLocation(site[i]);

                _homescreen1.EnterDate(date[i]);

                _homescreen1.SelectTime(time[i]);

                //click on captch manually --> need to automate
                Thread.Sleep(5000);

                _homescreen1.ClickNextBtn();

                // Screen 2

                _homescreen2.VerifyThankYouLabel();

                string InPersonConfirmMsg1 = "We have received your appointment confirmation, we look forward to your equipment drop off.";

                string InpersonConfirmMsg2 = "\r\nIf you need to reschedule your return for any reason Please email [email protected] and provide your full name, Oracle ID, phone number, personal email and confirmation number, if possible.";

                string InPersonConfirmMsg = string.Concat(InPersonConfirmMsg1, InpersonConfirmMsg2);

                string ActualConfirmMsg = _homescreen2.GetConfirmationMsg();

                Assert.IsTrue(InPersonConfirmMsg.Contains(ActualConfirmMsg));

                _homescreen2.VerifyRequestNumber();
            }
        }