diff --git a/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx b/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx index 225adf7b5f..6581f0b657 100644 Binary files a/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx and b/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx differ diff --git a/testing/PIMS.Tests.Automation/Features/Leases.feature b/testing/PIMS.Tests.Automation/Features/Leases.feature index 8d51a52b2f..3080dcadf0 100644 --- a/testing/PIMS.Tests.Automation/Features/Leases.feature +++ b/testing/PIMS.Tests.Automation/Features/Leases.feature @@ -39,11 +39,11 @@ Scenario: 06. Lease and License Deposits And I update a Lease's Deposits from row number 2 Then A new lease is created successfully -Scenario: 07. Lease and License Payments - Given I create a new minimum Lease from row number 1 - When I add Payments to the Lease - And I update a Lease's Payments from row number 2 - Then A new lease is created successfully +#Scenario: 07. Lease and License Payments +# Given I create a new minimum Lease from row number 1 +# When I add Payments to the Lease +# And I update a Lease's Payments from row number 2 +# Then A new lease is created successfully Scenario: 08. Lease and License Documents Given I create a new minimum Lease from row number 1 diff --git a/testing/PIMS.Tests.Automation/Features/Leases.feature.cs b/testing/PIMS.Tests.Automation/Features/Leases.feature.cs index 53d736e3ef..fe335ad6f3 100644 --- a/testing/PIMS.Tests.Automation/Features/Leases.feature.cs +++ b/testing/PIMS.Tests.Automation/Features/Leases.feature.cs @@ -286,40 +286,6 @@ public void _06_LeaseAndLicenseDeposits() this.ScenarioCleanup(); } - [Xunit.SkippableFactAttribute(DisplayName="07. Lease and License Payments")] - [Xunit.TraitAttribute("FeatureTitle", "Leases and Licenses")] - [Xunit.TraitAttribute("Description", "07. Lease and License Payments")] - public void _07_LeaseAndLicensePayments() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("07. Lease and License Payments", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 42 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 43 - testRunner.Given("I create a new minimum Lease from row number 1", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line hidden -#line 44 - testRunner.When("I add Payments to the Lease", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden -#line 45 - testRunner.And("I update a Lease\'s Payments from row number 2", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden -#line 46 - testRunner.Then("A new lease is created successfully", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - [Xunit.SkippableFactAttribute(DisplayName="08. Lease and License Documents")] [Xunit.TraitAttribute("FeatureTitle", "Leases and Licenses")] [Xunit.TraitAttribute("Description", "08. Lease and License Documents")] diff --git a/testing/PIMS.Tests.Automation/Features/SmokeTest.feature b/testing/PIMS.Tests.Automation/Features/SmokeTest.feature index 06d5f3d230..e2fa5a5839 100644 --- a/testing/PIMS.Tests.Automation/Features/SmokeTest.feature +++ b/testing/PIMS.Tests.Automation/Features/SmokeTest.feature @@ -33,10 +33,10 @@ Scenario: 06. Lease and License Deposits When I add Deposits to the Lease Then A new lease is created successfully -Scenario: 07. Lease and License Payments - Given I create a new minimum Lease from row number 5 - When I add Payments to the Lease - Then A new lease is created successfully +#Scenario: 07. Lease and License Payments +# Given I create a new minimum Lease from row number 5 +# When I add Payments to the Lease +# Then A new lease is created successfully Scenario: 08. Research File Properties Given I create a basic Research File from row number 10 diff --git a/testing/PIMS.Tests.Automation/Features/SmokeTest.feature.cs b/testing/PIMS.Tests.Automation/Features/SmokeTest.feature.cs index ee0638e6e2..4d463d4af6 100644 --- a/testing/PIMS.Tests.Automation/Features/SmokeTest.feature.cs +++ b/testing/PIMS.Tests.Automation/Features/SmokeTest.feature.cs @@ -268,37 +268,6 @@ public void _06_LeaseAndLicenseDeposits() this.ScenarioCleanup(); } - [Xunit.SkippableFactAttribute(DisplayName="07. Lease and License Payments")] - [Xunit.TraitAttribute("FeatureTitle", "SmokeTest")] - [Xunit.TraitAttribute("Description", "07. Lease and License Payments")] - public void _07_LeaseAndLicensePayments() - { - string[] tagsOfScenario = ((string[])(null)); - System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("07. Lease and License Payments", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 36 -this.ScenarioInitialize(scenarioInfo); -#line hidden - if ((TagHelper.ContainsIgnoreTag(tagsOfScenario) || TagHelper.ContainsIgnoreTag(featureTags))) - { - testRunner.SkipScenario(); - } - else - { - this.ScenarioStart(); -#line 37 - testRunner.Given("I create a new minimum Lease from row number 5", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line hidden -#line 38 - testRunner.When("I add Payments to the Lease", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden -#line 39 - testRunner.Then("A new lease is created successfully", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - } - this.ScenarioCleanup(); - } - [Xunit.SkippableFactAttribute(DisplayName="08. Research File Properties")] [Xunit.TraitAttribute("FeatureTitle", "SmokeTest")] [Xunit.TraitAttribute("Description", "08. Research File Properties")] diff --git a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs index 6f812138c8..13887a62c9 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs @@ -412,7 +412,7 @@ public void VerifyAcquisitionFileView(AcquisitionFile acquisition) AssertTrueContentEquals(acquisitionFileScheduleAssignedDateContent, TransformDateFormat(acquisition.AssignedDate)); else { - AssertTrueContentEquals(acquisitionFileScheduleAssignedDateContent, DateTime.Now.ToString("MMM dd, yyyy")); + AssertTrueContentEquals(acquisitionFileScheduleAssignedDateContent, DateTime.Now.ToString("MMM d, yyyy")); } AssertTrueIsDisplayed(acquisitionFileScheduleDeliveryDateLabel); diff --git a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionTakes.cs b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionTakes.cs index 5ee8d84b29..f9f1f802ef 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionTakes.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionTakes.cs @@ -417,23 +417,25 @@ public void VerifyCreatedTakeViewForm(Take take) //Highway Dedication AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new highway dedication?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-newRightOfWayToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new highway dedication')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsNewHighwayDedication)); + if (take.IsNewHighwayDedication.Equals("true") && take.IsNewHighwayDedicationArea != "") AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new highway dedication?')]/parent::div/parent::div/parent::div/div/div/div/div/div/div/div[contains(text(),'sq. metres')]/preceding-sibling::div"), TransformNumberFormat(take.IsNewHighwayDedicationArea)); //MoTI Inventory AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is this being acquired for MoTI inventory?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-addPropertyToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is this being acquired for MoTI inventory')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsMotiInventory)); //Interest in Land AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new registered interest in land (SRW, Easement or Covenant)')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-newInterestInSrwToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new registered interest in land (SRW, Easement or Covenant)')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsNewInterestLand)); + if (take.IsNewInterestLand.Equals("true") && take.IsNewInterestLandArea != "") AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new registered interest in land (SRW, Easement or Covenant)')]/parent::div/parent::div/parent::div/div/div/div/div/div/div/div[contains(text(),'sq. metres')]/preceding-sibling::div"), TransformNumberFormat(take.IsNewInterestLandArea)); //Land Acture Tenure AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Land Act tenure?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-landActToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Land Act tenure?')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsLandActTenure)); if (take.IsLandActTenure.Equals("true")) { AssertTrueContentEquals(By.XPath("(//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Land Act tenure?')]/parent::div/parent::div/parent::div/div/div/label[contains(text(),'Land Act')]/parent::div/following-sibling::div)[2]"), take.IsLandActTenureDetail); @@ -448,17 +450,19 @@ public void VerifyCreatedTakeViewForm(Take take) //License for Construction AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Licence for Construction Access (TLCA/LTC)?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-licenseToConstructToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Licence for Construction Access (TLCA/LTC)?')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsLicenseConstruct)); + if (take.IsLicenseConstruct.Equals("true")) { if (take.IsLicenseConstructArea != "") - AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new License for Construction Access (TLCA/LTC)?')]/parent::div/parent::div/parent::div/div/div/div/div/div/div/div[contains(text(),'sq. metres')]/preceding-sibling::div"), TransformNumberFormat(take.IsLicenseConstructArea)); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Licence for Construction Access (TLCA/LTC)?')]/parent::div/parent::div/parent::div/div/div/div/div/div/div/div[contains(text(),'sq. metres')]/preceding-sibling::div"), TransformNumberFormat(take.IsLicenseConstructArea)); - AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new License for Construction Access (TLCA/LTC)?')]/parent::div/parent::div/parent::div/div/div/label[contains(text(),'LTC end date')]/parent::div/following-sibling::div"), TransformDateFormat(take.IsLicenseConstructDate)); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a new Licence for Construction Access (TLCA/LTC)?')]/parent::div/parent::div/parent::div/div/div/label[contains(text(),'LTC end date')]/parent::div/following-sibling::div"), TransformDateFormat(take.IsLicenseConstructDate)); } AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a Lease (Payable)?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-leasePayableToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a Lease (Payable)?')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsLeasePayable)); + if (take.IsLeasePayable.Equals("true")) { if (take.IsLeasePayableArea != "") @@ -471,7 +475,7 @@ public void VerifyCreatedTakeViewForm(Take take) AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/h2/div/div[contains(text(),'Surplus')]")); AssertTrueIsDisplayed(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a Surplus?')]")); - Assert.Equal(2, webDriver.FindElements(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/div/div/div/div/input[@id='input-surplusToggle']")).Count); + AssertTrueContentEquals(By.XPath("//div[@data-testid='take-"+ index +"']/div/div/div/div/div/div/div/label[contains(text(),'Is there a Surplus?')]/parent::div/following-sibling::div"), TransformBooleanFormat(take.IsSurplus)); if (take.IsNewHighwayDedication.Equals("True") && take.IsSurplusArea != "") AssertTrueContentEquals(By.XPath("//div[@data-testid='take-" + index + "']/div/div/div/div/div/div/div/label[contains(text(),'Is there a Surplus?')]/parent::div/parent::div/parent::div/div/div/div/div/div/div/div[contains(text(),'sq. metres')]/preceding-sibling::div"), TransformNumberFormat(take.IsSurplusArea)); } @@ -500,7 +504,7 @@ private double TransformSqMtToHectares(string sqmt) private double TransformSqMtToAcres(string sqmt) { - double sqmtNbr = double.Parse(sqmt) * 0.000247105; + double sqmtNbr = double.Parse(sqmt) * 0.000247110891123302; double acresRounded = Math.Round(sqmtNbr, 4, MidpointRounding.ToEven); if (acresRounded.Equals(0.0000)) @@ -509,4 +513,4 @@ private double TransformSqMtToAcres(string sqmt) return acresRounded; } } -} \ No newline at end of file +} diff --git a/testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs b/testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs index 476b9abe68..271acc155c 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs @@ -48,7 +48,7 @@ public class LeaseDeposits : PageObjectBase private By licenseDepositAddDescriptionTextarea = By.CssSelector("textarea[id='input-description']"); private By licenseDepositAddAmountLabel = By.XPath("//label[contains(text(),'Deposit amount')]"); private By licenseDepositAddAmountInput = By.Id("input-amountPaid"); - private By licenseDepositAddPaidDateLabel = By.XPath("//label[contains(text(),'Paid date')]"); + private By licenseDepositAddPaidDateLabel = By.XPath("//span[contains(text(),'Paid date')]"); private By licenseDepositAddPaidDateInput = By.Id("datepicker-depositDate"); private By licenseDepositAddDepositHolderLabel = By.XPath("//label[contains(text(),'Deposit holder')]"); private By licenseDepositAddDepositHolderInput = By.CssSelector("label[for='input-contactHolder']"); @@ -59,7 +59,7 @@ public class LeaseDeposits : PageObjectBase private By licenseDepositReturnDepositTypeContent = By.XPath("//strong[contains(text(),'Deposit type')]/parent::div/following-sibling::div"); private By licenseDepositReturnDepositAmountLabel = By.XPath("//strong[contains(text(),'Deposit amount')]"); private By licenseDepositReturnDepositAmountContent = By.XPath("//strong[contains(text(),'Deposit amount')]/parent::div/following-sibling::div"); - private By licenseDepositReturnTerminationDateLabel = By.XPath("//label[contains(text(),'Termination or surrender date')]"); + private By licenseDepositReturnTerminationDateLabel = By.XPath("//span[contains(text(),'Termination or surrender date')]"); private By licenseDepositReturnTerminationDateInput = By.Id("datepicker-terminationDate"); private By licenseDepositReturnClaimLabel = By.XPath("//label[contains(text(),'Claims against deposit ($)')]"); private By licenseDepositReturnClaimInput = By.Id("input-claimsAgainst"); @@ -67,7 +67,7 @@ public class LeaseDeposits : PageObjectBase private By licenseDepositReturnAmountInput = By.Id("input-returnAmount"); private By licenseDepositReturnInterestPaidLabel = By.XPath("//label[contains(text(),'Interest paid ($)')]"); private By licenseDepositReturnInterestPaidInput = By.Id("input-interestPaid"); - private By licenseDepositReturnDateLabel = By.XPath("//label[contains(text(),'Returned date')]"); + private By licenseDepositReturnDateLabel = By.XPath("//span[contains(text(),'Returned date')]"); private By licenseDepositReturnDateInput = By.Id("datepicker-returnDate"); private By licenseDepositReturnPayeeNameLabel = By.XPath("//label[contains(text(),'Payee name')]"); private By licenseDepositRerturnPayeeNameInput = By.Id("input-contactHolder.id"); diff --git a/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs b/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs index 76e6364cdd..6887632b32 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs @@ -42,11 +42,11 @@ public class LeaseDetails : PageObjectBase private By licenseDetailsLeaseDateStartContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Lease / Licence')]/parent::div/div/label[contains(text(),'Start date')]/following-sibling::div"); private By licenseDetailsLeaseDateEndLabel = By.XPath("//form/div/div/div/div/h4[contains(text(),'Lease / Licence')]/parent::div/div/label[contains(text(),'Expiry')]"); private By licenseDetailsLeaseDateEndContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Lease / Licence')]/parent::div/div/label[contains(text(),'Expiry')]/following-sibling::div"); - private By licenseDetailsCurrentTermSubtitle = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Term')]"); - private By licenseDetailsCurrentTermStartLabel = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Term')]/parent::div/div/label[contains(text(),'Start date')]"); - private By licenseDetailsCurrentTermStartContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Term')]/parent::div/div/label[contains(text(),'Start date')]/following-sibling::div"); - private By licenseDetailsCurrentTermEndLabel = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Term')]/parent::div/div/label[contains(text(),'Expiry')]"); - private By licenseDetailsCurrentTermEndContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Term')]/parent::div/div/label[contains(text(),'Expiry')]/following-sibling::div"); + private By licenseDetailsCurrentTermSubtitle = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Period')]"); + private By licenseDetailsCurrentTermStartLabel = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Period')]/parent::div/div/label[contains(text(),'Start date')]"); + private By licenseDetailsCurrentTermStartContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Period')]/parent::div/div/label[contains(text(),'Start date')]/following-sibling::div"); + private By licenseDetailsCurrentTermEndLabel = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Period')]/parent::div/div/label[contains(text(),'Expiry')]"); + private By licenseDetailsCurrentTermEndContent = By.XPath("//form/div/div/div/div/h4[contains(text(),'Current Period')]/parent::div/div/label[contains(text(),'Expiry')]/following-sibling::div"); //Property Information Elements private By licenseDetailsPropertyInformationSubtitle = By.XPath("//h2/div/div[contains(text(),'Property Information')]"); diff --git a/testing/PIMS.Tests.Automation/PageObjects/LeaseImprovements.cs b/testing/PIMS.Tests.Automation/PageObjects/LeaseImprovements.cs index 094a354560..b4d860b851 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/LeaseImprovements.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/LeaseImprovements.cs @@ -52,7 +52,7 @@ public LeaseImprovements(IWebDriver webDriver) : base(webDriver) public void NavigateToImprovementSection() { WaitUntilClickable(licenseImprovementLink); - webDriver.FindElement(licenseImprovementLink).Click(); + FocusAndClick(licenseImprovementLink); } //Edit Improvements section diff --git a/testing/PIMS.Tests.Automation/PageObjects/LeasePayments.cs b/testing/PIMS.Tests.Automation/PageObjects/LeasePayments.cs index 4301772b92..49d0e4be47 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/LeasePayments.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/LeasePayments.cs @@ -289,7 +289,7 @@ public void VerifyInsertedTermTable(Term term) AssertTrueContentEquals(By.XPath("//div[@data-testid='leasePaymentsTable']/div[@class='tbody']/div[@class='tr-wrapper']["+ totalTermsInLease +"]/div[@class='tr']/div[@class='td expander svg-btn']/following-sibling::div[3]"), term.TermPaymentFrequency); AssertTrueContentEquals(By.XPath("//div[@data-testid='leasePaymentsTable']/div[@class='tbody']/div[@class='tr-wrapper']["+ totalTermsInLease +"]/div[@class='tr']/div[@class='td expander svg-btn']/following-sibling::div[4]"), term.TermPaymentsDue); AssertTrueContentEquals(By.XPath("//div[@data-testid='leasePaymentsTable']/div[@class='tbody']/div[@class='tr-wrapper']["+ totalTermsInLease +"]/div[@class='tr']/div[@class='td expander svg-btn']/following-sibling::div[5]"), TransformCurrencyFormat(term.TermAgreedPayment)); - AssertTrueContentEquals(By.XPath("//div[@data-testid='leasePaymentsTable']/div[@class='tbody']/div[@class='tr-wrapper']["+ totalTermsInLease +"]/div[@class='tr']/div[@class='td expander svg-btn']/following-sibling::div[6]"), TransformBooleanFormat(term.IsGSTEligible)); + AssertTrueContentEquals(By.XPath("//div[@data-testid='leasePaymentsTable']/div[@class='tbody']/div[@class='tr-wrapper']["+ totalTermsInLease +"]/div[@class='tr']/div[@class='td expander svg-btn']/following-sibling::div[6]"), TransformBooleanLeaseFormat(term.IsGSTEligible)); if (term.IsGSTEligible) { diff --git a/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs b/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs index 164b5a3761..56030b6b71 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs @@ -200,9 +200,10 @@ protected void AssertTrueDoublesEquals(By elementBy, double number2) { WaitUntilVisible(elementBy); var numberFromElement = webDriver.FindElement(elementBy).GetAttribute("Value"); - var number1 = double.Parse(numberFromElement); + var number1 = Math.Round(double.Parse(numberFromElement), 4, MidpointRounding.ToEven).ToString(); + var roundedNumber2 = Math.Round(number2, 4, MidpointRounding.ToEven).ToString(); - Assert.True(number1.Equals(number2)); + Assert.Equal(roundedNumber2, number1); } protected void AssertTrueElementContains(By elementBy, string text) @@ -293,7 +294,7 @@ protected List GetProjects(By element) return result; } - protected string TransformBooleanFormat(bool elementValue) + protected string TransformBooleanLeaseFormat(bool elementValue) { if (elementValue) { return "Y"; } @@ -301,9 +302,12 @@ protected string TransformBooleanFormat(bool elementValue) { return "N"; } } - protected double TransformStringToDouble(string elementValue) + protected string TransformBooleanFormat(string elementValue) { - return double.Parse(elementValue, System.Globalization.CultureInfo.InvariantCulture); + var boolElementValue = bool.Parse(elementValue); + + if (boolElementValue) return "Yes"; + else return "No"; } protected List GetViewFieldListContent(By element) diff --git a/testing/PIMS.Tests.Automation/PageObjects/PropertyManagementTab.cs b/testing/PIMS.Tests.Automation/PageObjects/PropertyManagementTab.cs index f0e72b6664..4ddee8af12 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/PropertyManagementTab.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/PropertyManagementTab.cs @@ -53,8 +53,8 @@ public class PropertyManagementTab : PageObjectBase private By managementActivitiesTable = By.CssSelector("div[data-testid='PropertyManagementActivitiesTable']"); private By managementActivitiesBodyCount = By.CssSelector("div[data-testid='PropertyManagementActivitiesTable'] div[class='tbody'] div[class='tr-wrapper']"); private By managementActivitiesDeleteBttns = By.CssSelector("button[title='Delete']"); - - private By managementActivityPaginationOptions = By.CssSelector("ul[class='pagination'] li"); + private By managementActivityPaginationOptions = By.XPath("//div[@data-testid='PropertyManagementActivitiesTable']/following-sibling::div/div/ul[@class='pagination']/li"); + //Create Activity Elements //Activity Details @@ -365,19 +365,19 @@ public void CancelPropertyManagement() ButtonElement("Cancel"); Assert.Equal("Confirm changes", sharedModals.ModalHeader()); - Assert.Equal("If you cancel now, this property information will not be saved.", sharedModals.ConfirmationModalText1()); - Assert.Equal("Are you sure you want to Cancel?", sharedModals.ConfirmationModalText2()); + Assert.Equal("If you choose to cancel now, your changes will not be saved.", sharedModals.ConfirmationModalText1()); + Assert.Equal("Do you want to proceed?", sharedModals.ConfirmationModalText2()); sharedModals.ModalClickOKBttn(); } public void DeleteAllContacts() { - Wait(2000); + Wait(); while (webDriver.FindElements(managementContactsDeleteBttns).Count > 0) { - Wait(2000); + Wait(); webDriver.FindElement(managementContactsFirstDeleteBttn).Click(); Assert.Equal("Confirm delete", sharedModals.ModalHeader()); @@ -410,7 +410,7 @@ public void ViewLastActivityFromList() { var paginationLastPage = webDriver.FindElements(managementActivityPaginationOptions).Count() -1; - webDriver.FindElement(By.CssSelector("ul[class='pagination'] li:nth-child("+ paginationLastPage +")")).Click(); + webDriver.FindElement(By.XPath("//div[@data-testid='PropertyManagementActivitiesTable']/following-sibling::div/div/ul[@class='pagination']/li["+ paginationLastPage +"]")).Click(); } public void VerifyInitManagementTabView() @@ -507,7 +507,7 @@ public void VerifyCreateActivityInitForm() public void VerifyInsertedSummaryForm(PropertyManagement managementProperty) { - Wait(2000); + Wait(); AssertTrueIsDisplayed(managementSummaryTitle); AssertTrueIsDisplayed(managementPropertyPurposeLabel); diff --git a/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs b/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs index c308467535..a3de0261ff 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs @@ -9,8 +9,8 @@ public class SearchProperties : PageObjectBase private By searchPropertyByPIDPINInput = By.Id("input-pinOrPid"); private By searchPropertyByAddressInput = By.Id("input-address"); private By searchPropertyByPlanInput = By.Id("input-planNumber"); - private By searchPropertyAddressSuggestionsGroup = By.CssSelector("div[class='suggestionList']"); - private By searchPropertyAddressSuggestions1stOption = By.CssSelector("div[class='suggestionList'] option:nth-child(1)"); + private By searchPropertyAddressSuggestionsGroup = By.CssSelector("ul[class='suggestionList']"); + private By searchPropertyAddressSuggestions1stOption = By.CssSelector("ul[class='suggestionList'] li:nth-child(1)"); private By searchPropertySearchBttn = By.Id("search-button"); private By searchPropertyResetBttn = By.Id("reset-button"); @@ -75,7 +75,8 @@ public void SearchPropertyByAddressMap(string address) WaitUntilVisible(searchPropertyAddressSuggestionsGroup); FocusAndClick(searchPropertyAddressSuggestions1stOption); - + + WaitUntilClickable(searchPropertySearchBttn); webDriver.FindElement(searchPropertySearchBttn).Click(); WaitUntilSpinnerDisappear(); } diff --git a/testing/PIMS.Tests.Automation/PageObjects/SharedFileProperties.cs b/testing/PIMS.Tests.Automation/PageObjects/SharedFileProperties.cs index 38a465920b..bdb2692726 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/SharedFileProperties.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/SharedFileProperties.cs @@ -368,10 +368,10 @@ public void SaveFileProperties() while (webDriver.FindElements(propertiesFileConfirmationModal).Count() > 0) { - if (sharedModals.SecondaryModalContent().Contains("You have added one or more properties to the disposition file that are not in the MoTI Inventory")) + if (sharedModals.SecondaryModalContent().Contains("You have added one or more properties to the disposition file that are not in the MOTI Inventory")) { Assert.Equal("User Override Required", sharedModals.SecondaryModalHeader()); - Assert.Contains("You have added one or more properties to the disposition file that are not in the MoTI Inventory. Do you want to proceed?", sharedModals.SecondaryModalContent()); + Assert.Contains("You have added one or more properties to the disposition file that are not in the MOTI Inventory. Do you want to proceed?", sharedModals.SecondaryModalContent()); } else { diff --git a/testing/PIMS.Tests.Automation/StepDefinitions/AcquisitionFileSteps.cs b/testing/PIMS.Tests.Automation/StepDefinitions/AcquisitionFileSteps.cs index 63558f0675..64e6e0b4ad 100644 --- a/testing/PIMS.Tests.Automation/StepDefinitions/AcquisitionFileSteps.cs +++ b/testing/PIMS.Tests.Automation/StepDefinitions/AcquisitionFileSteps.cs @@ -247,9 +247,9 @@ public void UpdateProperties(int rowNumber) sharedFileProperties.NavigateToAddPropertiesToFile(); //Search for a property by Legal Description - //sharedSearchProperties.NavigateToSearchTab(); - //sharedSearchProperties.SelectPropertyByLegalDescription(acquisitionFile.SearchProperties.LegalDescription); - //sharedSearchProperties.SelectFirstOption(); + sharedFileProperties.NavigateToSearchTab(); + sharedFileProperties.SelectPropertyByLegalDescription(acquisitionFile.AcquisitionSearchProperties.LegalDescription); + sharedFileProperties.SelectFirstOptionFromSearch(); //Save changes sharedFileProperties.SaveFileProperties(); diff --git a/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs b/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs index 9b448091c3..85286a715c 100644 --- a/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs +++ b/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs @@ -190,7 +190,7 @@ public void ReviewPropertyInformationList(int rowNumber) searchProperties.SearchPropertyByAddressList(searchProperty.Address); //Validate that the result gives only one pin - Assert.True(searchProperties.PropertiesListFoundCount() == 2); + Assert.True(searchProperties.PropertiesListFoundCount() == 3); //Search for a valid PIN in Inventory searchProperties.SearchPropertyReset(); @@ -312,22 +312,37 @@ public void InsertManagementPropertyTab(int rowNumber) //Go to the Property Management Tab propertyManagementTab.NavigateManagementTab(); - //propertyManagementTab.VerifyInitManagementTabView(); + propertyManagementTab.VerifyInitManagementTabView(); //Click on Edit Summary propertyManagementTab.UpdateManagementSummaryButton(); - //Insert Summary Information + //Insert and cancel Summary Information + propertyManagementTab.InsertManagementSummaryInformation(propertyManagement); + propertyManagementTab.CancelPropertyManagement(); + + //Click on Edit Summary + propertyManagementTab.UpdateManagementSummaryButton(); + + //Insert and save Summary Information propertyManagementTab.VerifyCreateSummaryInitForm(); propertyManagementTab.InsertManagementSummaryInformation(propertyManagement); propertyManagementTab.SavePropertyManagement(); - propertyManagementTab.VerifyInsertedSummaryForm(propertyManagement); + propertyManagementTab.VerifyInsertedSummaryForm(propertyManagement); //Insert Contacts for (int i = 0; i < propertyManagement.ManagementPropertyContacts.Count; i++) { + if (i == 0) + { + //Checking Initial Contact form and cancel changes + propertyManagementTab.AddNewPropertyContactButton(); + propertyManagementTab.VerifyCreateContactsInitForm(); + propertyManagementTab.InsertNewPropertyContact(propertyManagement.ManagementPropertyContacts[i]); + propertyManagementTab.CancelPropertyManagement(); + } + propertyManagementTab.AddNewPropertyContactButton(); - propertyManagementTab.VerifyCreateContactsInitForm(); propertyManagementTab.InsertNewPropertyContact(propertyManagement.ManagementPropertyContacts[i]); propertyManagementTab.SavePropertyManagement(); propertyManagementTab.VerifyLastInsertedPropertyContactTable(propertyManagement.ManagementPropertyContacts[i]); @@ -336,8 +351,16 @@ public void InsertManagementPropertyTab(int rowNumber) //Insert Activities for (int j = 0; j < propertyManagement.ManagementPropertyActivities.Count; j++) { + if (j == 0) + { + //Checking Initial Activity form and cancel changes + propertyManagementTab.AddNewPropertyActivityButton(); + propertyManagementTab.VerifyCreateActivityInitForm(); + propertyManagementTab.InsertNewPropertyActivity(propertyManagement.ManagementPropertyActivities[j]); + propertyManagementTab.CancelPropertyManagement(); + } + propertyManagementTab.AddNewPropertyActivityButton(); - propertyManagementTab.VerifyCreateActivityInitForm(); propertyManagementTab.InsertNewPropertyActivity(propertyManagement.ManagementPropertyActivities[j]); propertyManagementTab.SavePropertyManagement(); propertyManagementTab.VerifyInsertedActivity(propertyManagement.ManagementPropertyActivities[j]); diff --git a/testing/Testing DB Scripts/DELETE AUTOMATION TEST DATA.sql b/testing/Testing DB Scripts/DELETE AUTOMATION TEST DATA.sql index 24b24dd221..d5462c1e50 100644 --- a/testing/Testing DB Scripts/DELETE AUTOMATION TEST DATA.sql +++ b/testing/Testing DB Scripts/DELETE AUTOMATION TEST DATA.sql @@ -73,9 +73,12 @@ DELETE FROM PIMS_ACQUISITION_FILE_NOTE WHERE ACQUISITION_FILE_ID IN (SELECT ACQU DELETE FROM PIMS_ACQUISITION_FILE WHERE APP_CREATE_USERID IN ('TRANPSP1'); -- ACQUISITION FILES TAKES LOGIC -DELETE FROM PIMS_TAKE WHERE PROPERTY_ACQUISITION_FILE_ID IN (SELECT PROPERTY_ACQUISITION_FILE_ID FROM PIMS_PROPERTY_ACQUISITION_FILE WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (026063069, 008950504, 000346179, 000903574, 001031171, 001054945, 001054937, 025562959, 025562967, 023961139, 023961104, 023460491, 004424701, 005721172, 008949158, 003393640, 005723345, 028893140))); -DELETE from PIMS_PROPERTY_ACQUISITION_FILE WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (026063069, 008950504, 000346179, 000903574, 001031171, 001054945, 001054937, 025562959, 025562967, 023961139, 023961104, 023460491, 004424701, 005721172, 008949158, 003393640, 005723345, 028893140)); -DELETE FROM PIMS_PROPERTY WHERE PID IN (026063069, 008950504, 000346179, 000903574, 001031171, 001054945, 001054937, 025562959, 025562967, 023961139, 023961104, 023460491, 004424701, 005721172, 008949158, 003393640, 005723345, 028893140); +DELETE FROM PIMS_TAKE WHERE PROPERTY_ACQUISITION_FILE_ID IN (SELECT PROPERTY_ACQUISITION_FILE_ID FROM PIMS_PROPERTY_ACQUISITION_FILE WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (006112447,014993805,014983214,015210979,011584360,015197115,014992876,01537673,015339041,015319121,015009513,015197174,015197093,015197140,015184099,012241814,012491284,015372863))); +DELETE FROM PIMS_INTHLDR_PROP_INTEREST WHERE PROPERTY_ACQUISITION_FILE_ID IN (SELECT PROPERTY_ACQUISITION_FILE_ID FROM PIMS_PROPERTY_ACQUISITION_FILE WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (006112447,014993805,014983214,015210979,011584360,015197115,014992876,01537673,015339041,015319121,015009513,015197174,015197093,015197140,015184099,012241814,012491284,015372863))); +DELETE from PIMS_PROPERTY_ACQUISITION_FILE WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (006112447,014993805,014983214,015210979,011584360,015197115,014992876,01537673,015339041,015319121,015009513,015197174,015197093,015197140,015184099,012241814,012491284,015372863)); +DELETE FROM PIMS_HISTORICAL_FILE_NUMBER WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM PIMS_PROPERTY WHERE PID IN (006112447,014993805,014983214,015210979,011584360,015197115,014992876,01537673,015339041,015319121,015009513,015197174,015197093,015197140,015184099,012241814,012491284,015372863)); +DELETE FROM PIMS_PROPERTY WHERE PID IN (006112447,014993805,014983214,015210979,011584360,015197115,014992876,01537673,015339041,015319121,015009513,015197174,015197093,015197140,015184099,012241814,012491284,015372863); + -- RESEARCH FILES DELETE FROM PIMS_RESEARCH_FILE_PURPOSE WHERE RESEARCH_FILE_ID IN (SELECT RESEARCH_FILE_ID FROM PIMS_RESEARCH_FILE WHERE APP_CREATE_USERID IN ('TRANPSP1', 'TRANPSP2', 'SUTAIRAK','PRAVKUMA'));