//This test creates a self-approved licence and returns user to dashboard public void CreateAwaitingApprovalSkillsLicenceTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue1 + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("5555.55"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.QuoteADiscountBox(driver).Click(); AlterSkillsLicencePage.QuoteADiscountBox(driver).SendKeys("99"); AlterSkillsLicencePage.QuoteADiscountBox(driver).SendKeys(Keys.Tab); string actualValue7 = AlterSkillsLicencePage.getHierarchyWarning(driver); Assert.IsTrue(actualValue7.Contains("Over Sales Director"), actualValue7 + " doesn't contain 'Over Sales Director'"); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue8 = ManagerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue8.Contains("MANAGER APPROVAL"), actualvalue8 + " doesn't contain 'MANAGER APPROVAL'"); ManagerApprovalPage.clickOnManagerNameTickbox(driver); ManagerApprovalPage.clickOnSendToManagerButton(driver); string actualvalue9 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue9.Contains("SKILLS LICENCES"), actualvalue9 + " doesn't contain 'SKILLS LICENCES'"); } }
//This test creates a self-approved licence and returns user to dashboard public void CreateApprovedButSuspendedSkillsLicenceSmokeTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("3333.33"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue7 = CustomerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue7.Contains("SEND SKILLS LICENCE TO CUSTOMER"), actualvalue7 + " doesn't contain 'Skills Licence To Customer'"); HeaderPage.quotationsMenuOption(driver).Click(); HeaderPage.salesPortalMenuOption(driver).Click(); string actualvalue8 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue8.Contains("SKILLS LICENCES"), actualvalue8 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.approved(driver).Click(); DashboardWithMeApprovedPage.clickSuspendApprovedLicence(driver).Click(); string actualvalue9 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue9.Contains("SKILLS LICENCES"), actualvalue9 + " doesn't contain 'SKILLS LICENCES'"); } }
//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() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.userCircle(driver).Click(); DashboardPage.changeUserFreeTextBox(driver).SendKeys(ConfigurationWrapper.SalspersonUserName()); DashboardPage.changeTheUserButton(driver).Click(); string actualValue1 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); string actualValue2 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SKILLS LICENCES"), actualValue2 + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue3 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT COMPANY"), actualValue3 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue4 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("SELECT CONTACT"), actualValue4 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue5 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue5.Contains("SELECT TEMPLATE"), actualValue5 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue6.Contains("IN DRAFT"), actualValue6 + " doesn't contain 'IN DRAFT'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("2222.22"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue7 = CustomerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue7.Contains("SEND SKILLS LICENCE TO CUSTOMER"), actualvalue7 + " doesn't contain 'Skills Licence To Customer'"); CustomerApprovalPage.getBAPSSection(driver).Click(); string subHeadingText = CustomerApprovalPage.getTextForBAPSSubHeading(driver); Assert.IsTrue(subHeadingText.Contains("BAPS"), subHeadingText + "doesn't contain 'BAPS'"); CustomerApprovalPage.selectQuoteA(driver).Click(); CustomerApprovalPage.selectCreateButton(driver).Click(); string dashboardHeader = DashboardPage.getTextForHeader(driver); Assert.IsTrue(dashboardHeader.Contains("SKILLS LICENCES"), dashboardHeader + " doesn't contain 'SKILLS LICENCES'"); } }
//This test creates a self-approved licence and returns user to dashboard public void CreateSkillsLicenceSmokeTest() { using (IWebDriver driver = WebDriverManager.WebDriverManager.GetWebDriverForConfig()) { string page = EnvironmentConfig.ConfigurationWrapper.GetURLFromEnvironmentKey(); string actualValue = DashboardPage.getTextForHeader(driver); while (actualValue == null) { driver.Url = page; } Assert.IsTrue(actualValue.Contains("SKILLS LICENCES"), actualValue + " doesn't contain 'SKILLS LICENCES'"); DashboardPage.createSkillsLicenceButton(driver).Click(); string actualValue1 = GetMyCustomersPage.getTextForHeader(driver); Assert.IsTrue(actualValue1.Contains("SELECT COMPANY"), actualValue1 + " doesn't contain 'SELECT COMPANY'"); GetMyCustomersPage.customerSearchBox(driver).SendKeys("TEST QC CUSTOMER"); GetMyCustomersPage.customerSelect(driver).Click(); string actualValue2 = GetMyCustomerContactsPage.getTextForHeader(driver); Assert.IsTrue(actualValue2.Contains("SELECT CONTACT"), actualValue2 + " doesn't contain 'SELECT CONTACT'"); GetMyCustomerContactsPage.delegateButton(driver).Click(); GetMyCustomerContactsPage.contactSelect(driver).Click(); string actualValue3 = GetMylicencesPage.getTextForHeader(driver); Assert.IsTrue(actualValue3.Contains("SELECT TEMPLATE"), actualValue3 + " doesn't contain 'SELECT TEMPLATE'"); GetMylicencesPage.blankTemplate(driver).Click(); string actualValue4 = AlterSkillsLicencePage.getTextForHeader(driver); Assert.IsTrue(actualValue4.Contains("IN DRAFT"), actualValue4 + " doesn't contain 'IN DRAFT'"); string actualValue5 = AlterSkillsLicencePage.getTextForNewCustomerCheckboxUnticked(driver); Assert.IsTrue(actualValue5.Contains("Additional discounts for being a new customer not applied"), actualValue5 + " doesn't contain 'Additional discounts for being a new customer not applied'"); AlterSkillsLicencePage.getNewCustomerCheckbox(driver).Click(); string actualValue6 = AlterSkillsLicencePage.getTextForNewCustomerCheckboxTicked(driver); Assert.IsTrue(actualValue6.Contains("Additional discounts for being a new customer applied"), actualValue6 + " doesn't contain 'Additional discounts for being a new customer applied'"); AlterSkillsLicencePage.quoteATextBox(driver).SendKeys("5000"); AlterSkillsLicencePage.itPracticeSelect(driver).Click(); AlterSkillsLicencePage.itAllVendors(driver).Click(); AlterSkillsLicencePage.agileAndScrumPremium(driver).Click(); AlterSkillsLicencePage.clickOnSaveAndSendButton(driver); string actualvalue7 = CustomerApprovalPage.getTextForHeader(driver); Assert.IsTrue(actualvalue7.Contains("SEND SKILLS LICENCE TO CUSTOMER"), actualvalue7 + " doesn't contain 'Skills Licence To Customer'"); HeaderPage.quotationsMenuOption(driver).Click(); HeaderPage.salesPortalMenuOption(driver).Click(); string actualvalue8 = DashboardPage.getTextForHeader(driver); Assert.IsTrue(actualvalue8.Contains("SKILLS LICENCES"), actualvalue8 + " doesn't contain 'SKILLS LICENCES'"); } }