예제 #1
0
        public void clickOnYesToNewCustomerDiscountsPopUp()
        {
            //The Yes element cannot be accessed like normal elements because it is in a separate popup window
            //So you need to switch to that windon before you attempt to access it.
            //It won't wait for the element until the switch is complete, so I have used a loop to allow it to try again
            //Once the Yes element has been clicked on, you then need to wait for it to disappear before the focus is back on
            //the main window.

            string yesLocatorString = "//*[@id='toast']/ul/li/span[2]";

            switchWindowLast();
            for (int i = 0; i < 10; i++)
            {
                try
                {
                    IWebElement yes = MyDriverManager.waitForAndReturnElementByXpath(yesLocatorString);
                    DataEntryHelper.ClickOn(yes);

                    MyDriverManager.waitForElementToDisappearByXpath(yesLocatorString);
                    break;
                }
                catch (Exception e)
                {
                    //This should loop back to try again
                    MyDriverManager.pause(1000);
                }
            }
        }
예제 #2
0
        public void EndTest()
        {
            //Write to file


            MyDriverManager.cleanUp();
        }
예제 #3
0
        //This tests uses the app.config value to pick a manager and change SP to use that salesperson to login.  It then checks user has landed on a manager version of the dashboard page.
        public void ChangeUserToAManagerTest()
        {
            //Setup reporting for this test
            ExtentTest test = MyDriverManager.report.CreateTest("ChangeUserToAManagerTest");

            //Setup Page(s)
            NewDashboardPage        theDashboardPage        = new NewDashboardPage(MyDriverManager.driver);
            NewManagerDashboardPage theManagerDashboardPage = new NewManagerDashboardPage(MyDriverManager.driver);

            //Go to the the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.ManagerUserName());
            theDashboardPage.clickOnChangeTheUserBtn();

            //Check we are on manager version of Dashboard
            theManagerDashboardPage.waitForPageToLoad();


            //Set reporting info
            test.Pass("User successfully changed to manager");
            test.Log(Status.Pass, "ChangeUserToAManagerTest passed");
        }
예제 #4
0
        //This tests uses the app.config value to pick a salesperson and change SP to use that salesperson to login
        public void ChangeUserToAStandardUserTest()
        {
            //Setup Page(s)
            NewDashboardPage theDashboardPage = new NewDashboardPage(MyDriverManager.driver);

            //Go to the the intial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();
        }
예제 #5
0
        public void waitForPageToLoad()
        {
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    MyDriverManager.waitForElement(header);
                    break;
                }
                catch (Exception e)
                {
                    //this should loop back and try again if it fails to find the element
                }
            }
            string actualText = getHeaderText();

            Assert.IsTrue(actualText.Equals("MANAGER APPROVAL"), actualText + "'does NOT equal MANAGER APPROVAL'");
        }
예제 #6
0
        public void waitForPageToLoadacp()
        {
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    MyDriverManager.waitForElement(header);
                }
                catch (Exception e)
                {
                    //This should loop back to try again
                }
            }

            string actualHeaderText = getHeaderText();

            Assert.IsTrue(actualHeaderText.Contains("SEND CUSTOMER ADVANCED PRICING TO CUSTOMER"), actualHeaderText + "does NOT contain 'SEND CUSTOMER ADVANCED PRICING TO CUSTOMER'");
        }
예제 #7
0
        public void waitForPageToLoad()
        {
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    MyDriverManager.waitForElement(header);
                }
                catch (Exception e)
                {
                    //This should loop back to try again
                }
            }

            string actualHeaderText = getHeaderText();

            Assert.IsTrue(actualHeaderText.Contains("IN DRAFT"), actualHeaderText + "does NOT contain 'In Draft'");
        }
예제 #8
0
        public void selectCustomerEmail(string email)
        {
            string emailLocatorString = "//*[contains(text(),'" + email + "')]";

            for (int i = 0; i < 10; i++)
            {
                try
                {
                    MyDriverManager.pause(1000);
                    IWebElement theCustomerEmail =
                        MyDriverManager.driver.FindElement(By.XPath(emailLocatorString));
                    DataEntryHelper.ClickOn(theCustomerEmail);
                    break;
                }
                catch (Exception e)
                {
                    //This should allow the for loop to continue so it tries again
                }
            }
        }
예제 #9
0
        public void waitForPageToLoad()
        {
            //Waits for the time specified in AppConfig for the header to appear (currently 20 seconds)
            //To allow for slow performance, it will try twice before failing.
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    MyDriverManager.waitForElement(header);
                    break;
                }

                catch (Exception e)
                {
                    //This should allow the for loop to continue so it tries again
                }
            }
            string actualHeaderText = getHeaderText();

            Assert.IsTrue(actualHeaderText.Contains("SELECT COMPANY"), actualHeaderText + " doesn't contain 'SELECT COMPANY'");
        }
예제 #10
0
        //This test creates a self-approved licence and returns user to dashboard
        public void CreateManagerDeclinedSkillsLicenceTest()
        {
            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";
            string quoteValue           = "1000.00";
            string discountValue        = "99";

            //Setup Page(s)
            NewDashboardPage                theDashboardPage          = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage           theGetMyCustomersPage     = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage    theCustomerContactsPage   = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage            theGetMyLicencesPage      = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage       theAlterSkillsLicencePage = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewManagerApprovalPage          theManagerApprovalPage    = new NewManagerApprovalPage(MyDriverManager.driver);
            NewManagerDashboardPage         theManagerDashboardPage   = new NewManagerDashboardPage(MyDriverManager.driver);
            NewShowManagerSkillsLicencePage theShowManagerSkillsLicencePage
                = new NewShowManagerSkillsLicencePage(MyDriverManager.driver);

            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial Declined Skills Licence Count
            string declinedCountSL     = theDashboardPage.getDeclinedCount_SL();
            int    declinedCountSL_int = int.Parse(declinedCountSL);


            //Create Skill Licence
            theDashboardPage.clickOnCreateSkillsLicenceButton();

            //Select customer
            theGetMyCustomersPage.waitForPageToLoad();
            theGetMyCustomersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustomersPage.selectCustomerByNumber(customerNumber);

            //Select contact
            theCustomerContactsPage.waitForPageToLoad();
            theCustomerContactsPage.clickOnBothButton();
            theCustomerContactsPage.populateContactsSearchBox(contactSurname);
            theCustomerContactsPage.selectCustomerEmail(customerEmailAddress);

            //Select licence template
            theGetMyLicencesPage.waitForPageToLoad();
            theGetMyLicencesPage.clickOnBankTemplate();

            //Enter quote details
            theAlterSkillsLicencePage.waitForPageToLoad();
            theAlterSkillsLicencePage.populateQuoteATextBox(quoteValue);
            theAlterSkillsLicencePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicencePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");

            //Enter a discount and check for hierarchy warning text
            theAlterSkillsLicencePage.enterDiscountForAmazonQuoteA(discountValue);
            string warningText = theAlterSkillsLicencePage.getHierarchyWarningText();

            Assert.IsTrue(warningText.Equals("Over Sales Director"), warningText + " does NOT equal 'Over Sales Director'");
            theAlterSkillsLicencePage.clickOnSaveAndSendButton();

            //Select manager and send for approval
            theManagerApprovalPage.waitForPageToLoad();
            theManagerApprovalPage.selectAnotherManager(ConfigurationWrapper.ManagerFullName());
            theManagerApprovalPage.clickOnSubmitForManagerApprovalButton();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User to manager
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.ManagerUserName());
            theDashboardPage.clickOnChangeTheUserBtn();

            //Check contact in manager dashboard page
            theManagerDashboardPage.waitForPageToLoad();
            string contactName = theManagerDashboardPage.getContactText();

            Assert.IsTrue(contactName.Contains(ConfigurationWrapper.ContactUserName()), contactName + " does NOT contain contact's username");
            theManagerDashboardPage.clickOnSkillsLicenceContact();

            //Decline the SKills Licence via Manager Dashboard Page
            theShowManagerSkillsLicencePage.waitForPageToLoad();
            theShowManagerSkillsLicencePage.clickOnDeclineSkillsLicenceButton();


            // Set User back to salesperson
            theManagerDashboardPage.waitForPageToLoad();
            theManagerDashboardPage.clickOnUserCircle();
            theManagerDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theManagerDashboardPage.clickOnChangeTheUserButton();

            theDashboardPage.waitForDashboardPageToLoad();


            // Check Declined Skills Licence Count increased by 1
            int expectedValue_int          = declinedCountSL_int + 1;
            int updatedDeclinedCountSL_int = int.Parse(theDashboardPage.getDeclinedCount_SL());

            Assert.IsTrue(updatedDeclinedCountSL_int == expectedValue_int,
                          "Expected declinedCountSL= " + expectedValue_int + " actually got " + updatedDeclinedCountSL_int);
        }
예제 #11
0
        //This test creates a self-approved licence and returns user to dashboard
        public void CreateDraftSkillsLicenceSmokeTest()
        {
            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";
            string quoteValue           = "1000.00";


            //Setup Page(s)
            NewDashboardPage             theDashboardPage            = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage        theGetMyCustomersPage       = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage theGetMyCustomerContactPage = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage         theGetMyLicencesPage        = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage    theAlterSkillsLicencePage   = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewSendToCustomerPage        theSendToCustomerPage       = new NewSendToCustomerPage(MyDriverManager.driver);

            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial Draft Skills Licence Count
            string draftCountSL     = theDashboardPage.getDraftCount_SL();
            int    draftCountSL_int = int.Parse(draftCountSL);


            //Select Skills Licence
            theDashboardPage.clickOnCreateSkillsLicenceButton();

            //Select Customer
            theGetMyCustomersPage.waitForPageToLoad();
            theGetMyCustomersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustomersPage.selectCustomerByNumber(customerNumber);

            //Select Contact
            theGetMyCustomerContactPage.waitForPageToLoad();
            theGetMyCustomerContactPage.clickOnBothButton();
            theGetMyCustomerContactPage.populateContactsSearchBox(contactSurname);
            theGetMyCustomerContactPage.selectCustomerEmail(customerEmailAddress);

            //Select licence
            theGetMyLicencesPage.waitForPageToLoad();
            theGetMyLicencesPage.clickOnBankTemplate();

            //Enter Quote Details
            theAlterSkillsLicencePage.waitForPageToLoad();
            theAlterSkillsLicencePage.populateQuoteATextBox(quoteValue);
            theAlterSkillsLicencePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicencePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");

            //Save Skills Licence as a Draft
            theAlterSkillsLicencePage.clickOnSaveDraftButton();
            theDashboardPage.waitForDashboardPageToLoad();

            // Check Draft Skills Licence Count increased by 1
            int expectedValue_int       = draftCountSL_int + 1;
            int updatedDraftCountSL_int = int.Parse(theDashboardPage.getDraftCount_SL());

            Assert.IsTrue(updatedDraftCountSL_int == expectedValue_int,
                          "Expected draftCountSL= " + expectedValue_int + " actually got " + updatedDraftCountSL_int);
        }
예제 #12
0
        //This test creates a self-approved licence and returns user to dashboard
        public void CreateAdvancedCustomerPricingQuoteViaPortalSmokeTest()
        {
            //Setup reporting for this test
            ExtentTest test = MyDriverManager.report.CreateTest("CreateAdvancedCustomerPricingQuoteViaPortalSmokeTest");

            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";


            //Setup Page(s)
            NewDashboardPage             theDashboardPage            = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage        theGetMyCustomersPage       = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage theGetMyCustomerContactPage = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage         theGetMyLicencesPage        = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage    theAlterSkillsLicencePage   = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewSendToCustomerPage        theSendToCustomerPage       = new NewSendToCustomerPage(MyDriverManager.driver);

            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial Approved ACP Count
            string approvedCountACP     = theDashboardPage.getApprovedCount_ACP();
            int    approvedCountACP_int = int.Parse(approvedCountACP);

            //Select ACP
            theDashboardPage.clickOnManageCustomerContractPricingButton();

            //Select Customer
            theGetMyCustomersPage.waitForPageToLoad();
            theGetMyCustomersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustomersPage.selectCustomerByNumber(customerNumber);

            //Select Contact
            theGetMyCustomerContactPage.waitForPageToLoad();
            theGetMyCustomerContactPage.clickOnBothButton();
            theGetMyCustomerContactPage.populateContactsSearchBox(contactSurname);
            theGetMyCustomerContactPage.selectCustomerEmail(customerEmailAddress);

            //Select licence
            theGetMyLicencesPage.waitForPageToLoad();
            theGetMyLicencesPage.clickOnManageExistingACP();

            theAlterSkillsLicencePage.waitForPageToLoad();

            //Check correct text displayed for New Customer Check Box for both ticked and unticked conditions
            string actualTickBoxUntickedText = theAlterSkillsLicencePage.getNewCustomerCheckBoxUntickedText();

            try
            {
                Assert.IsTrue(actualTickBoxUntickedText.Equals("Additional discounts for being a new customer not applied"),
                              actualTickBoxUntickedText + " does NOT equal 'Additional discounts for being a new customer not applied'");
            }
            catch (Exception e)
            {
                //Set reporting info
                test.Fail("Tickbox unticked text does NOT equal 'Additional discounts for being a new customer not applied");
                test.Log(Status.Fail, "CreateAdvancedCustomerPricingQuoteViaPortalSmokeTest Failed");
                throw;
            }


            theAlterSkillsLicencePage.clickOnNewCustomerCheckboxUnticked();
            theAlterSkillsLicencePage.clickOnYesToNewCustomerDiscountsPopUp();

            string actualTickBoxTickedText = theAlterSkillsLicencePage.getNewCustomerCheckBoxTickedText();

            Assert.IsTrue(actualTickBoxTickedText.Equals("Additional discounts for being a new customer applied"),
                          actualTickBoxTickedText + " does NOT equal 'Additional discounts for being a new customer applied'");


            //Enter ACP Details
            theAlterSkillsLicencePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicencePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");
            theAlterSkillsLicencePage.clickOnSaveAndSendButton();

            //Send ACP to customer via Portal
            theSendToCustomerPage.waitForPageToLoadacp();
            theSendToCustomerPage.clickOnSendUsingPortalButton();
            Assert.IsTrue(theSendToCustomerPage.getsubHeadingPortalText().Equals("PORTAL"), "Portal Subheading does NOT equal 'Portal' ");
            theSendToCustomerPage.clickOnSendtoCustomerButton_Portal();

            theDashboardPage.waitForDashboardPageToLoad();

            //Check Approved ACP Count increased by 1
            int expectedValue_int           = approvedCountACP_int + 1;
            int updatedApprovedCountACP_int = int.Parse(theDashboardPage.getApprovedCount_ACP());

            Assert.IsTrue(updatedApprovedCountACP_int == expectedValue_int,
                          "Expected ApprovedCountACP= " + expectedValue_int + " actually got " + updatedApprovedCountACP_int);

            //Set reporting info
            test.Pass("ACP successfully created via portal");
            test.Log(Status.Pass, "CreateAdvancedCustomerPricingQuoteViaPortalSmokeTest passed");
        }
예제 #13
0
        //This test clicks dashboard approved then hit save into baps area, select quote A and save into BAPS.  Checks user returned to dashboard.
        public void SendApprovedQuotesViaBAPS()
        {
            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";
            string quoteValue           = "1000.00";

            //Setup Page(s)
            NewDashboardPage             theDashboardPage          = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage        theGetMyCustomersPage     = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage theCustomerContactsPage   = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage         theGetMyLicencesPage      = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage    theAlterSkillsLicencePage = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewSendToCustomerPage        theSendtoCustomerPage     = new NewSendToCustomerPage(MyDriverManager.driver);


            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial Booking Provisional Skills Licence Count
            string provisionalCountSL     = theDashboardPage.getBookingProvisional_SL();
            int    provisionalCountSL_int = int.Parse(provisionalCountSL);

            //Select Skills Licence.
            theDashboardPage.clickOnCreateSkillsLicenceButton();

            //Select customer
            theGetMyCustomersPage.waitForPageToLoad();
            theGetMyCustomersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustomersPage.selectCustomerByNumber(customerNumber);

            //Select contact
            theCustomerContactsPage.waitForPageToLoad();
            theCustomerContactsPage.clickOnBothButton();
            theCustomerContactsPage.populateContactsSearchBox(contactSurname);
            theCustomerContactsPage.selectCustomerEmail(customerEmailAddress);

            //Select licence template
            theGetMyLicencesPage.waitForPageToLoad();
            theGetMyLicencesPage.clickOnBankTemplate();

            //Enter quote details
            theAlterSkillsLicencePage.waitForPageToLoad();
            theAlterSkillsLicencePage.populateQuoteATextBox(quoteValue);
            theAlterSkillsLicencePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicencePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");
            theAlterSkillsLicencePage.clickOnSaveAndSendButton();

            //Create skills licence in BAPs
            theSendtoCustomerPage.waitForPageToLoadSkillsLicence();
            theSendtoCustomerPage.clickOnSkillsLicenceCreateInBAPSbutton();
            Assert.IsTrue(theSendtoCustomerPage.getsubHeadingBAPS_SLText().Equals("BAPS"), "BAPS Subheading does NOT equal 'BAPS' ");

            theSendtoCustomerPage.clickOnBapsCheckBoxQuoteA();
            theSendtoCustomerPage.clickOnSendtoCustomerButton_BAPS();

            theDashboardPage.waitForDashboardPageToLoad();


            // Check Provisional Skills Licence Count increased by 1
            int expectedValue_int             = provisionalCountSL_int + 1;
            int updatedProvisionalCountSL_int = int.Parse(theDashboardPage.getBookingProvisional_SL());

            Assert.IsTrue(updatedProvisionalCountSL_int == expectedValue_int,
                          "Expected provisionalCountSL= " + expectedValue_int + " actually got " + updatedProvisionalCountSL_int);
        }
예제 #14
0
 void GlobalTearDown()
 {
     //Do teardown stuff from Hooks here
     MyDriverManager.cleanUp();
 }
예제 #15
0
 void GlobalSetup()
 {
     //Do setup stuff from Hooks here
     MyDriverManager.NewGetWebDriverFromConfig();
 }
예제 #16
0
파일: DummyTest.cs 프로젝트: Iona777/QA2
        public void DummyMethodTest()
        {
            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";
            string quoteValue           = "1000.00";


            //Setup Page(s)
            NewDashboardPage             theDashboardPage          = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage        theGetMyCustumersPage     = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage theContactsPAge           = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage         theSkillLicencePage       = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage    theAlterSkillsLicensePage = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewSendToCustomerPage        theSendPAge = new NewSendToCustomerPage(MyDriverManager.driver);


            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial Approved Skills Licence Count
            string appCountSL     = theDashboardPage.getApprovedCount_SL();
            int    appCountSL_int = int.Parse(appCountSL);

            //Select Skills Licence
            theDashboardPage.clickOnCreateSkillsLicenceButton();



            //Select customer
            theGetMyCustumersPage.waitForPageToLoad();
            theGetMyCustumersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustumersPage.selectCustomerByNumber(customerNumber);

            //Select Contact
            theContactsPAge.waitForPageToLoad();
            theContactsPAge.clickOnBothButton();
            theContactsPAge.populateContactsSearchBox(contactSurname);
            theContactsPAge.selectCustomerEmail(customerEmailAddress);

            //Select licence
            theSkillLicencePage.waitForPageToLoad();
            theSkillLicencePage.clickOnBankTemplate();


            //Enter quote details
            theAlterSkillsLicensePage.waitForPageToLoad();
            theAlterSkillsLicensePage.populateQuoteATextBox(quoteValue);
            theAlterSkillsLicensePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicensePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");

            theAlterSkillsLicensePage.clickOnSaveAndSendButton();

            //Send Skills Licence to customer via Portal
            theSendPAge.waitForPageToLoadacp();
            theSendPAge.clickOnSendUsingPortalButton();
            Assert.IsTrue(theSendPAge.getsubHeadingPortalText().Equals("PORTAL"));

            theSendPAge.clickOnSendtoCustomerButton_Portal();



            // Check approvedSL Count increased by 1
            int expectedValue_int          = approvedCountSL_int + 1;
            int updatedApprovedCountSL_int = int.Parse(theDashboardPage.getApprovedCount_SL());

            Assert.IsTrue(updatedApprovedCountSL_int == expectedValue_int,
                          "Expected approvedCountSL= " + expectedValue_int + " actually got " + updatedApprovedCountSL_int);
        }
예제 #17
0
 public static void EnterText(string input, IWebElement element)
 {
     MyDriverManager.waitForElement(element);
     element.SendKeys(input);
 }
예제 #18
0
 public void Initialize()
 {
     //Consider adding code here so that it sets the environment value in AppConfig so that you can have a suite
     //of tests per environment.
     MyDriverManager.NewGetWebDriverFromConfig();
 }
예제 #19
0
 public static void ClickOn(IWebElement element)
 {
     MyDriverManager.waitForElement(element);
     element.Click();
 }
        //This test creates a self-approved licence and sends via Echosign
        public void SendApprovedLicenceViaEchosignTest()
        {
            //Constants
            string customerCompanyName  = "TEST QC CUSTOMER";
            string customerNumber       = "3402211";
            string contactSurname       = "Marshall";
            string customerEmailAddress = "*****@*****.**";
            string quoteValue           = "1000.00";


            //Setup Page(s)
            NewDashboardPage             theDashboardPage            = new NewDashboardPage(MyDriverManager.driver);
            NewGetMyCustomersPage        theGetMyCustomersPage       = new NewGetMyCustomersPage(MyDriverManager.driver);
            NewGetMyCustomerContactsPage theGetMyCustomerContactPage = new NewGetMyCustomerContactsPage(MyDriverManager.driver);
            NewGetMyLicencesPage         theGetMyLicencesPage        = new NewGetMyLicencesPage(MyDriverManager.driver);
            NewAlterSkillsLicencePage    theAlterSkillsLicencePage   = new NewAlterSkillsLicencePage(MyDriverManager.driver);
            NewSendToCustomerPage        theSendToCustomerPage       = new NewSendToCustomerPage(MyDriverManager.driver);

            //Go to the initial page
            MyDriverManager.goToDashboardPage();
            theDashboardPage.waitForDashboardPageToLoad();

            //Set User
            theDashboardPage.clickOnUserCircle();
            theDashboardPage.populateUserFreeTextBox(ConfigurationWrapper.SalespersonUserName());
            theDashboardPage.clickOnChangeTheUserBtn();
            theDashboardPage.waitForDashboardPageToLoad();

            //Get Initial With Customer Skills Licence Count
            string withCustomerCountSL     = theDashboardPage.getWithCustomerCount_SL();
            int    withCustomerCountSL_int = int.Parse(withCustomerCountSL);

            //Select Skills Licence
            theDashboardPage.clickOnCreateSkillsLicenceButton();

            //Select Customer
            theGetMyCustomersPage.waitForPageToLoad();
            theGetMyCustomersPage.populateCustomerSearchBox(customerCompanyName);
            theGetMyCustomersPage.selectCustomerByNumber(customerNumber);

            //Select Contact
            theGetMyCustomerContactPage.waitForPageToLoad();
            theGetMyCustomerContactPage.clickOnBothButton();
            theGetMyCustomerContactPage.populateContactsSearchBox(contactSurname);
            theGetMyCustomerContactPage.selectCustomerEmail(customerEmailAddress);

            //Select licence
            theGetMyLicencesPage.waitForPageToLoad();
            theGetMyLicencesPage.clickOnBankTemplate();

            //Enter quote details
            theAlterSkillsLicencePage.waitForPageToLoad();
            theAlterSkillsLicencePage.populateQuoteATextBox(quoteValue);
            theAlterSkillsLicencePage.enterAmazonAsVendor();
            Assert.IsTrue(theAlterSkillsLicencePage.isTechTypeAmazonSpecialistDisplayed(), "Tech Type Specialist not displayed for vendor Amazon");

            theAlterSkillsLicencePage.clickOnSaveAndSendButton();

            //Send Skills Licence to customer via Echosign
            theSendToCustomerPage.waitForPageToLoadSkillsLicence();
            theSendToCustomerPage.clickOnSendUsingAdobeSignButton();
            Assert.IsTrue(theSendToCustomerPage.getsubHeadingAdobeText().Equals("ADOBE SIGN"), "Portal Subheading does NOT equal 'ADOBE SIGN' ");
            theSendToCustomerPage.clickOnAdobeCheckBoxQuoteA();
            theSendToCustomerPage.clickOnSendtoCustomerButton_Adobe();;

            theDashboardPage.waitForDashboardPageToLoad();

            // Check WithCustomer Count increased by 1
            int expectedValue_int = withCustomerCountSL_int + 1;
            int updatedWithCustomerCountSL_int = int.Parse(theDashboardPage.getWithCustomerCount_SL());

            Assert.IsTrue(updatedWithCustomerCountSL_int == expectedValue_int,
                          "Expected withCustomerCountSL= " + expectedValue_int + " actually got " + updatedWithCustomerCountSL_int);
        }