Skip to content

Commit

Permalink
PSP-8826: Automation test case update for IS84 (#4173)
Browse files Browse the repository at this point in the history
* IS82 automation updates

* Automation changes

* Changes on automation IS84

* Changes on automation test cases IS84

* Additional validation on Property Management Tab

---------

Co-authored-by: Alejandro Sanchez <emailforasr@gmail.com>
  • Loading branch information
stairaku and asanchezr committed Jul 9, 2024
1 parent fefe952 commit 41090ee
Show file tree
Hide file tree
Showing 18 changed files with 96 additions and 126 deletions.
Binary file modified testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx
Binary file not shown.
10 changes: 5 additions & 5 deletions testing/PIMS.Tests.Automation/Features/Leases.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 0 additions & 34 deletions testing/PIMS.Tests.Automation/Features/Leases.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions testing/PIMS.Tests.Automation/Features/SmokeTest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 0 additions & 31 deletions testing/PIMS.Tests.Automation/Features/SmokeTest.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 15 additions & 11 deletions testing/PIMS.Tests.Automation/PageObjects/AcquisitionTakes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 != "")
Expand All @@ -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));
}
Expand Down Expand Up @@ -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))
Expand All @@ -509,4 +513,4 @@ private double TransformSqMtToAcres(string sqmt)
return acresRounded;
}
}
}
}
6 changes: 3 additions & 3 deletions testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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']");
Expand All @@ -59,15 +59,15 @@ 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");
private By licenseDepositReturnAmountLabel = By.XPath("//label[contains(text(),'Returned amount ($) without interest')]");
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");
Expand Down
10 changes: 5 additions & 5 deletions testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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')]");
Expand Down
Loading

0 comments on commit 41090ee

Please sign in to comment.