예제 #1
0
        //This test creates a self-approved licence and returns user to dashboard
        public void CreateApprovedButSuspendedSkillsLicenceSmokeTest()
        {
            //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);
            NewHeaderPage theHeaderPage = new NewHeaderPage(MyDriverManager.driver);
            NewDashBoardWithMeApprovedPage theDashboardWithMeApprovedPage = new NewDashBoardWithMeApprovedPage(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 Suspended Skills Licence Count
            string suspendedCountSL     = theDashboardPage.getSuspendedCount_SL();
            int    suspendedCountSL_int = int.Parse(suspendedCountSL);

            //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 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();

            //Select Sales Portal via menu
            theSendToCustomerPage.waitForPageToLoadSkillsLicence();
            theHeaderPage.clickOnquotationsMenuOption();
            theHeaderPage.clickOnsalesPortalMenuOption();

            //Find approved Skills Licence and suspend it.
            theDashboardPage.waitForDashboardPageToLoad();
            theDashboardPage.clickOnApproved_SL();
            theDashboardWithMeApprovedPage.waitForPageToLoad();
            theDashboardWithMeApprovedPage.clickOnSuspendButton();

            theDashboardPage.waitForDashboardPageToLoad();


            //Check Suspended Skills Licence Count increased by 1
            int expectedValue_int           = suspendedCountSL_int + 1;
            int updatedSuspendedCountSL_int = int.Parse(theDashboardPage.getSuspendedCount_SL());

            Assert.IsTrue(updatedSuspendedCountSL_int == expectedValue_int,
                          "Expected suspendedCountSL= " + expectedValue_int + " actually got " + updatedSuspendedCountSL_int);
        }
예제 #2
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");
        }
예제 #3
0
        //This test creates a self-approved licence and returns user to dashboard
        public void SendApprovedQuotesViaCustomerPortalTest()
        {
            //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 theGetMyCustomerContactsPage = 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 Skills Licence Count
            string approvedCountSL     = theDashboardPage.getApprovedCount_SL();
            int    approvedCountSL_int = int.Parse(approvedCountSL);

            //Select Skills Licence
            theDashboardPage.clickOnCreateSkillsLicenceButton();

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

            //Select Contact
            theGetMyCustomerContactsPage.waitForPageToLoad();
            theGetMyCustomerContactsPage.clickOnBothButton();
            theGetMyCustomerContactsPage.populateContactsSearchBox(contactSurname);
            theGetMyCustomerContactsPage.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 Portal
            theSendToCustomerPage.waitForPageToLoadSkillsLicence();
            theSendToCustomerPage.clickOnSendUsingPortalButton();
            Assert.IsTrue(theSendToCustomerPage.getsubHeadingPortalText().Equals("PORTAL"), "Portal Subheading does NOT equal 'PORTAL' ");
            theSendToCustomerPage.clickOnSendtoCustomerButton_Portal();

            theDashboardPage.waitForDashboardPageToLoad();

            // 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);
        }