Exemplo n.º 1
0
        public static void CreateAnAdditionalAggregateCalculation_Number()

        {
            CreateCalculationPage createcalculationpage = new CreateCalculationPage();
            ManagePoliciesPage    managepoliciespage    = new ManagePoliciesPage();


            string newname         = "TestAggCalculationName";
            string descriptiontext = "This is a Description for: ";

            var randomSpecCalcName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["AddAggCalcName"] = randomSpecCalcName;
            managepoliciespage.CreateCalculation.Click();
            Thread.Sleep(2000);
            createcalculationpage.CalculationName.SendKeys(randomSpecCalcName);
            createcalculationpage.CalculationDescription.SendKeys(descriptiontext + randomSpecCalcName);
            Actions.CreateCalculationSpecificationpageSelectPolicyOrSubpolicyDropDown();

            var calctype      = createcalculationpage.CalculationTypeDropDown;
            var selectElement = new SelectElement(calctype);

            selectElement.SelectByValue("Number");

            createcalculationpage.SaveCalculation.Click();
            Thread.Sleep(2000);
            var    aggCalcNumName = ScenarioContext.Current["AddAggCalcName"];
            string aggCalcCreated = aggCalcNumName.ToString();

            Console.WriteLine(aggCalcCreated + " has been created successfully");
            Thread.Sleep(5000);
        }
        public static void CreateANewSpecificationSubPolicy()

        {
            ManagePoliciesPage  managepoliciespage  = new ManagePoliciesPage();
            CreateSubPolicyPage createsubpolicypage = new CreateSubPolicyPage();

            string newname         = "Test Sub Policy Name ";
            string descriptiontext = "This is a Description for: ";

            var randomSpecSubPolicyName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["SpecSubPolicyName"] = randomSpecSubPolicyName;
            managepoliciespage.CreateSubPolicy.Click();
            Thread.Sleep(2000);
            createsubpolicypage.SubPolicyName.SendKeys(randomSpecSubPolicyName);
            Actions.SelectPolicyForSubPolicyCreationDropdownOption();
            createsubpolicypage.SubPolicyDescription.Click();
            Thread.Sleep(2000);
            createsubpolicypage.SubPolicyDescription.SendKeys(descriptiontext + randomSpecSubPolicyName);
            createsubpolicypage.SaveSubPolicy.Click();
            Thread.Sleep(2000);
            var    specPolicyName       = ScenarioContext.Current["SpecSubPolicyName"];
            string specSubPolicyCreated = specPolicyName.ToString();

            Console.WriteLine(specSubPolicyCreated + " has been created successfully");
            Thread.Sleep(1000);
        }
Exemplo n.º 3
0
        public static void CreateANewProviderDataset()

        {
            ManageSpecificationPage       managespecficationpage        = new ManageSpecificationPage();
            CreateSpecificationPage       createspecificationpage       = new CreateSpecificationPage();
            ManagePoliciesPage            managepoliciespage            = new ManagePoliciesPage();
            ChooseDatasetRelationshipPage choosedatasetrelationshippage = new ChooseDatasetRelationshipPage();

            string newname         = "TestDatasetName";
            string descriptiontext = "This is a Datset Description for: ";

            managepoliciespage.datasetsTab.Click();
            managepoliciespage.Createdatatyperelationship.Should().NotBeNull();
            managepoliciespage.Createdatatyperelationship.Click();
            Thread.Sleep(2000);
            Actions.SelectDatasetDataSchemaDropDown();
            var randomDatasetName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["DatasetSchemaName"] = randomDatasetName;
            choosedatasetrelationshippage.datasetSchemaRelationshipName.SendKeys(randomDatasetName);
            choosedatasetrelationshippage.datasetSchemaRelationshipDescription.SendKeys(descriptiontext + randomDatasetName);
            choosedatasetrelationshippage.createDatasetSetAsDataProvider.Click();
            choosedatasetrelationshippage.datasetSchemaRelationshipSaveButton.Click();
            Thread.Sleep(2000);
            managepoliciespage.datasetsTab.Should().NotBeNull();
            Console.WriteLine(randomDatasetName + " has been created successfully");
        }
        public void WhenIHaveEnteredATestNameForMyQATest()
        {
            var randomQATestName = qatestname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["QATestName"] = randomQATestName;
            createqatestpage.createQATestName.Click();
            createqatestpage.createQATestName.SendKeys(randomQATestName);
        }
 public void GivenIHaveCompletedTheRequiredQATestScenarioFields()
 {
     Actions.SelectSpecificationCreateQATestPage();
     createqatestpage.createQATestName.Click();
     createqatestpage.createQATestName.SendKeys(qatestname + TestDataUtils.RandomString(6));
     createqatestpage.createQATestDescription.Click();
     createqatestpage.createQATestDescription.SendKeys(qatestdescription);
     Thread.Sleep(2000);
 }
        public void WhenIUpdateTheExistingTestDescription()
        {
            string editeddesc = "This is an Updated Test Description ";

            var randomQAEditDesc = editeddesc + TestDataUtils.RandomString(6);

            ScenarioContext.Current["QAEditedDesc"] = randomQAEditDesc;

            IWebElement testName = editqatestpage.editQATestDescription;

            testName.SendKeys(OpenQA.Selenium.Keys.Control + "A");
            testName.SendKeys(randomQAEditDesc + " Edited");
            Thread.Sleep(2000);
        }
        public void WhenIUpdateTheExistingTestName()
        {
            string editedname = "QA Test Name ";

            var randomQAEditName = editedname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["QAEditedName"] = randomQAEditName;

            IWebElement testName = editqatestpage.editQATestName;

            testName.SendKeys(OpenQA.Selenium.Keys.Control + "A");
            testName.SendKeys(randomQAEditName + " Edited");
            Thread.Sleep(2000);
        }
        public static void CreateANewSpecification_VarYr()

        {
            ManageSpecificationPage managespecficationpage  = new ManageSpecificationPage();
            CreateSpecificationPage createspecificationpage = new CreateSpecificationPage();
            CreateCalculationPage   createcalculationpage   = new CreateCalculationPage();
            HomePage homepage = new HomePage();

            string newname         = "Test Spec Name ";
            string descriptiontext = "This is a Description for: ";
            string fundingStreams  = "all";

            NavigateTo.CreatetheSpecfication();
            Assert.IsNotNull(createcalculationpage.CalculationName);
            Thread.Sleep(2000);
            var randomSpecName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["SpecificationName"] = randomSpecName;

            createspecificationpage.SpecName.SendKeys(randomSpecName);
            createspecificationpage.SpecDescription.SendKeys(descriptiontext + randomSpecName);
            var selectYear = createspecificationpage.SpecFundingPeriod;

            var    specYear      = ScenarioContext.Current["SpecificationYear"];
            string specAcYear    = specYear.ToString();
            var    selectElement = new SelectElement(selectYear);

            selectElement.SelectByValue(specAcYear);
            //createspecificationpage.FundingStream.Click();
            //createspecificationpage.FundingStream.SendKeys(OpenQA.Selenium.Keys.Enter);
            Actions.CreateSpecificationChooseAllFundingStreams(fundingStreams);
            Thread.Sleep(2000);
            createspecificationpage.SaveSpecification.Click();
            Thread.Sleep(2000);

            homepage.Header.Click();
            Thread.Sleep(2000);
            homepage.ManagetheSpecification.Click();
            Thread.Sleep(2000);

            var    specName    = ScenarioContext.Current["SpecificationName"];
            string specCreated = specName.ToString();

            Console.WriteLine(specCreated + " has been created successfully");
            Driver._driver.FindElement(By.LinkText(specCreated)).Click();
            Thread.Sleep(1000);
        }
        public static void ValidateANewQATest()

        {
            HomePage             homepage             = new HomePage();
            TestScenarioListPage testscenariolistpage = new TestScenarioListPage();
            CreateQATestPage     createqatestpage     = new CreateQATestPage();

            string newname         = "QA Test Name ";
            string descriptiontext = "This is a Description for: ";

            var    specName    = ScenarioContext.Current["SpecificationName"];
            string specCreated = specName.ToString();

            var    datasetName    = ScenarioContext.Current["DatasetSchemaName"];
            string datasetCreated = datasetName.ToString();

            var    specCalcName    = ScenarioContext.Current["SpecCalcName"];
            string specCalcCreated = specCalcName.ToString();

            var randomQATestName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["QATestName"] = randomQATestName;

            homepage.Header.Click();
            Thread.Sleep(2000);

            NavigateTo.CreateQATestPage();
            Thread.Sleep(2000);
            createqatestpage.createQATestName.Should().NotBeNull();

            createqatestpage.createQATestName.SendKeys(randomQATestName);
            createqatestpage.createQATestDescription.SendKeys(descriptiontext + randomQATestName);

            Actions.SelectSpecifiedSpecificationCreateQATestPage();
            createqatestpage.createQATestDescription.Click();
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys(OpenQA.Selenium.Keys.Control + "A");
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys("Given the result for '" + specCalcCreated + "' is greater than '10'");
            //createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys(OpenQA.Selenium.Keys.Enter);
            //createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys("Then the result for 'Total Grant for Academies' is greater than '0'");
            Thread.Sleep(2000);
            createqatestpage.createQATestValidateQATestButton.Click();
            Thread.Sleep(6000);
        }
Exemplo n.º 10
0
        public static void CreateANewSpecificationPolicy_Baseline()

        {
            CreateCalculationPage createcalculationpage = new CreateCalculationPage();
            ManagePoliciesPage    managepoliciespage    = new ManagePoliciesPage();


            string newname         = "TestBaselineCalculationName";
            string descriptiontext = "This is a Description for: ";

            var randomSpecCalcName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["SpecCalcName"] = randomSpecCalcName;
            managepoliciespage.CreateCalculation.Click();
            Thread.Sleep(2000);
            createcalculationpage.CalculationName.SendKeys(randomSpecCalcName);
            createcalculationpage.CalculationDescription.SendKeys(descriptiontext + randomSpecCalcName);
            Actions.CreateCalculationSpecificationpageSelectPolicyOrSubpolicyDropDown();

            var calctype      = createcalculationpage.CalculationTypeDropDown;
            var selectElement = new SelectElement(calctype);

            selectElement.SelectByValue("Baseline");

            var allocation      = createcalculationpage.CalculationAllocationLine;
            var selectElement01 = new SelectElement(allocation);

            selectElement01.SelectByValue("YPM07");

            createcalculationpage.SaveCalculation.Click();
            Thread.Sleep(2000);
            var    specCalcNumName    = ScenarioContext.Current["SpecCalcName"];
            string numSpecCalcCreated = specCalcNumName.ToString();

            Console.WriteLine(numSpecCalcCreated + " has been created successfully");
            Thread.Sleep(5000);
        }
        public static void CreateAddNewSpecificationPolicy()

        {
            ManagePoliciesPage managepoliciespage = new ManagePoliciesPage();
            CreatePolicyPage   createpolicypage   = new CreatePolicyPage();

            string newname         = "Additional Test Policy Name ";
            string descriptiontext = "This is a Description for: ";

            var randomSpecPolicyName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["AddSpecPolicyName"] = randomSpecPolicyName;
            managepoliciespage.CreatePolicyButton.Click();
            Thread.Sleep(2000);
            createpolicypage.PolicyName.SendKeys(randomSpecPolicyName);
            createpolicypage.PolicyDescription.SendKeys(descriptiontext + randomSpecPolicyName);
            createpolicypage.SavePolicy.Click();
            Thread.Sleep(2000);
            var    addSpecPolicyName    = ScenarioContext.Current["AddSpecPolicyName"];
            string addSpecPolicyCreated = addSpecPolicyName.ToString();

            Console.WriteLine(addSpecPolicyCreated + " has been created successfully");
            Thread.Sleep(1000);
        }
        public static void CreateANewQATest()

        {
            HomePage             homepage             = new HomePage();
            TestScenarioListPage testscenariolistpage = new TestScenarioListPage();
            CreateQATestPage     createqatestpage     = new CreateQATestPage();

            string newname         = "QA Test Name ";
            string descriptiontext = "This is a Description for: ";

            var    specName    = ScenarioContext.Current["SpecificationName"];
            string specCreated = specName.ToString();

            var    datasetName    = ScenarioContext.Current["DatasetSchemaName"];
            string datasetCreated = datasetName.ToString();

            var    specCalcName    = ScenarioContext.Current["SpecCalcName"];
            string specCalcCreated = specCalcName.ToString();

            var randomQATestName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["QATestName"] = randomQATestName;

            homepage.Header.Click();
            Thread.Sleep(2000);

            NavigateTo.CreateQATestPage();
            Thread.Sleep(2000);
            createqatestpage.createQATestName.Should().NotBeNull();

            createqatestpage.createQATestName.SendKeys(randomQATestName);
            createqatestpage.createQATestDescription.SendKeys(descriptiontext + randomQATestName);

            Actions.SelectSpecifiedSpecificationCreateQATestPage();
            createqatestpage.createQATestDescription.Click();
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys(OpenQA.Selenium.Keys.Control + "A");
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys("Given the result for '" + specCalcCreated + "' is greater than '25'");
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys(OpenQA.Selenium.Keys.Enter);
            createqatestpage.createQATestBuildMonacoEditorTextbox.SendKeys("Then the result for '" + specCalcCreated + "' is greater than '100'");
            Thread.Sleep(2000);
            createqatestpage.createQATestValidateQATestButton.Click();
            Thread.Sleep(6000);
            IWebElement validatingtext        = createqatestpage.createQATestBuildBuildOutputText;
            string      validatingtextmessage = validatingtext.Text;

            Console.WriteLine("The Build Output validation completed message shows is " + validatingtextmessage);
            Thread.Sleep(4000);
            createqatestpage.createQATestCreateQATestButton.Click();
            Thread.Sleep(4000);
            //IAlert alert = Driver._driver.SwitchTo().Alert();
            //alert.Accept();
            //Thread.Sleep(4000);
            createqatestpage.createQATestBackButton.Click();
            Thread.Sleep(4000);
            testscenariolistpage.testScenarioPageCreateQATestButton.Should().NotBeNull();
            var    qaTestName    = ScenarioContext.Current["QATestName"];
            string qaTestcreated = qaTestName.ToString();

            Thread.Sleep(2000);
            Driver._driver.FindElement(By.LinkText(qaTestcreated)).Should().NotBeNull();
            Console.WriteLine("QA Test " + qaTestcreated + " has been created successfully");
            Thread.Sleep(1000);
        }