Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-8826: Automation test case update for IS84 #4173

Merged
merged 20 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4dfd67f
Merge branch 'dev' into automation-branch
stairaku Jun 13, 2024
c15e6d2
Merge branch 'dev' into automation-branch
asanchezr Jun 13, 2024
ec290b7
Merge branch 'dev' into automation-branch
asanchezr Jun 13, 2024
9200f88
Merge branch 'bcgov:dev' into automation-branch
stairaku Jun 13, 2024
12537ef
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jun 17, 2024
a1d590c
Merge branch 'bcgov:dev' into automation-branch
stairaku Jun 19, 2024
a2bf202
IS82 automation updates
stairaku Jun 19, 2024
6dee30e
Merge branch 'bcgov:dev' into automation-branch
stairaku Jun 24, 2024
ece1803
Automation changes
stairaku Jun 24, 2024
b4bb876
Merge branch 'bcgov:dev' into automation-branch
stairaku Jun 24, 2024
49f85fb
Merge branch 'bcgov:dev' into automation-branch
stairaku Jul 4, 2024
ea168af
Merge branch 'bcgov:dev' into automation-branch
stairaku Jul 5, 2024
ff040d3
Changes on automation IS84
stairaku Jul 8, 2024
007821d
Changes on automation test cases IS84
stairaku Jul 9, 2024
8ef5275
Merge branch 'bcgov:dev' into automation-branch
stairaku Jul 9, 2024
84950e9
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jul 9, 2024
17fc678
Additional validation on Property Management Tab
stairaku Jul 9, 2024
2c7365a
Merge branch 'dev' into automation-branch
stairaku Jul 9, 2024
c0938fe
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jul 9, 2024
7b60bbf
Merge branch 'dev' into automation-branch
asanchezr Jul 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading