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-9503: Automation test set IS93 - Additional data changes #4486

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.
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 Periods and 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: 31 additions & 0 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.

39 changes: 24 additions & 15 deletions testing/PIMS.Tests.Automation/PageObjects/DigitalDocuments.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OpenQA.Selenium;
using FluentAssertions.Equivalency.Steps;
using OpenQA.Selenium;
using PIMS.Tests.Automation.Classes;

namespace PIMS.Tests.Automation.PageObjects
Expand Down Expand Up @@ -30,7 +31,7 @@ public class DigitalDocuments: PageObjectBase

//Upload Documents Agricultural Land Comission
private readonly By documentALCTypeAppNumberLabel = By.XPath("//label[contains(text(),'Application #')]");
private readonly By documentALCTypeAppNumberInput = By.CssSelector("input[metadata-input-APPLICATION_NUMBER']");
private readonly By documentALCTypeAppNumberInput = By.CssSelector("input[data-testid='metadata-input-APPLICATION_NUMBER']");

//Upload BC Assessment Search Type Fields
private readonly By documentCivicAddressLabel = By.XPath("//label[contains(text(),'Civic address')]");
Expand Down Expand Up @@ -82,19 +83,19 @@ public class DigitalDocuments: PageObjectBase
private readonly By documentHistoricFileTypeEndDateLabel = By.XPath("//label[contains(text(),'End date')]");
private readonly By documentHistoricFileTypeEndDateInput = By.CssSelector("input[data-testid='metadata-input-END_DATE']");
private readonly By documentHistoricFileTypeFileLabel = By.XPath("//div[@class='pr-0 text-left col-4']/label[contains(text(),'File #')]");
private readonly By documentHistoricFileTypeFileInput = By.CssSelector("input[data-testid='metadata-input-END_DATE']");
private readonly By documentHistoricFileTypeFileInput = By.CssSelector("input[data-testid='metadata-input-FILE_NUMBER']");
private readonly By documentHistoricFileTypePhyLocationLabel = By.XPath("//label[contains(text(),'Physical location')]");
private readonly By documentHistoricFileTypePhyLocationInput = By.CssSelector("input[data-testid='metadata-input-PHYSICAL_LOCATION']");
private readonly By documentHistoricFileTypeSectionLabel = By.XPath("//label[contains(text(),'Section')]");
private readonly By documentHistoricFileTypeSectionInput = By.Id("input[data-testid='metadata-input-SECTION_NUMBER']");
private readonly By documentHistoricFileTypeSectionInput = By.CssSelector("input[data-testid='metadata-input-SECTION_NUMBER']");
private readonly By documentHistoricFileTypeStartDateLabel = By.XPath("//label[contains(text(),'Start date')]");
private readonly By documentHistoricFileTypeStartDateInput = By.Id("input[data-testid='metadata-input-START_DATE']");
private readonly By documentHistoricFileTypeStartDateInput = By.CssSelector("input[data-testid='metadata-input-START_DATE']");

//Upload Land Act Tenure Fields
private readonly By documentLandActTypeReferenceAgencyLabel = By.XPath("//label[contains(text(),'Reference/Agency Document #')]");
private readonly By documentLandActTypeReferenceAgencyInput = By.Id("input[data-testid='metadata-input-REFAG_DOC_NUMBER']");
private readonly By documentLandActTypeReferenceAgencyInput = By.CssSelector("input[data-testid='metadata-input-REFAG_DOC_NUMBER']");
private readonly By documentLandActTypeReferenceLandsLabel = By.XPath("//label[contains(text(),'Reference/Agency Lands file #')]");
private readonly By documentLandActTypeReferenceLandsInput = By.Id("input[data-testid='metadata-input-REFAG_LANDFILE_NUMBER']");
private readonly By documentLandActTypeReferenceLandsInput = By.CssSelector("input[data-testid='metadata-input-REFAG_LANDFILE_NUMBER']");


//Upload Legal Survey Plans Fields
Expand Down Expand Up @@ -133,9 +134,9 @@ public class DigitalDocuments: PageObjectBase
private readonly By documentYearInput = By.CssSelector("input[data-testid='metadata-input-YEAR']");

//Upload Other Type Fields
private readonly By documentOtherTypePINLabel = By.XPath("//div[@class='pb-2 row'][3]/div/label[contains(text(),'PIN')]");
private readonly By documentOtherTypePINLabel = By.XPath("//input[@data-testid='metadata-input-PIN']/parent::div/parent::div/preceding-sibling::div/label[contains(text(),'PIN')]");
private readonly By documentOtherTypePINInput = By.CssSelector("input[data-testid='metadata-input-PIN']");
private readonly By documentOtherTypePropIdLabel = By.XPath("//div[@class='pb-2 row'][4]/div/label[contains(text(),'Property identifier')]");
private readonly By documentOtherTypePropIdLabel = By.XPath("//input[@data-testid='metadata-input-PROPERTY_IDENTIFIER']/parent::div/parent::div/preceding-sibling::div/label[contains(text(),'Property identifier')]");
private readonly By documentRoadNameInput = By.CssSelector("input[data-testid='metadata-input-ROAD_NAME']");
private readonly By documentShortDescriptorLabel = By.XPath("//label[contains(text(),'Short descriptor')]");

Expand All @@ -160,14 +161,14 @@ public class DigitalDocuments: PageObjectBase

//Upload Privy Council Fields
private readonly By documentPrivyCouncilTypePrivyLabel = By.XPath("//label[contains(text(),'Year - privy council #')]");
private readonly By documentPrivyCouncilTypePrivyInput = By.Id("input[data-testid='metadata-input-YEAR_PRIVY_COUNCIL_NUMBER']");
private readonly By documentPrivyCouncilTypePrivyInput = By.CssSelector("input[data-testid='metadata-input-YEAR_PRIVY_COUNCIL_NUMBER']");

//Upload Short Descriptor Field
private readonly By documentShortDescriptorInput = By.CssSelector("input[data-testid='metadata-input-SHORT_DESCRIPTOR']");

//Upload Title search/ Historical title Fields
private readonly By documentTitleSearchTypePIDLabel = By.XPath("//input[@data-testid='metadata-input-PID']/parent::div/parent::div/preceding-sibling::div/label[contains(text(),'PID')]");
private readonly By documentTitleSearchTypeTitleLabel = By.XPath("//input[@data-testid='metadata-input-Title']/parent::div/parent::div/preceding-sibling::div/label[contains(text(),'Title')]");
private readonly By documentTitleSearchTypeTitleLabel = By.XPath("//input[@data-testid='metadata-input-TITLE_NUMBER']/parent::div/parent::div/preceding-sibling::div/label[contains(text(),'Title')]");
private readonly By documentTitleSearchTypeTitleInput = By.CssSelector("input[data-testid='metadata-input-TITLE_NUMBER']");

//Upload Transfer of Administration Type Fields
Expand Down Expand Up @@ -251,6 +252,7 @@ public class DigitalDocuments: PageObjectBase
private readonly By documentEditBttn = By.XPath("//div[@class='modal-body']/div/div/div/div/button");
private readonly By documentCancelEditButton = By.XPath("//div[@class='modal-body']/div/div[2]/div/div/div/div/button/div[contains(text(),'No')]/parent::button");
private readonly By documentSaveEditButton = By.XPath("//div[@class='modal-body']/div/div[2]/div/div/div/div/button/div[contains(text(),'Yes')]/parent::button");
private readonly By documentCancelEmbbedWarning = By.XPath("//div[@class='modal-footer']/div[@class='button-wrap']/p");

//Document Confirmation Modal Elements
private readonly By documentConfirmationModal = By.XPath("//div[contains(text(),'Confirm Changes')]/parent::div/parent::div");
Expand Down Expand Up @@ -307,7 +309,6 @@ public class DigitalDocuments: PageObjectBase
private readonly By documentPreiewEnterScreenBttn = By.CssSelector("button[aria-label='Enter Fullscreen']");
private readonly By documentPreiewCloseBttn = By.CssSelector("button[aria-label='Close']");


private SharedModals sharedModals;

public DigitalDocuments(IWebDriver webDriver) : base(webDriver)
Expand Down Expand Up @@ -573,6 +574,14 @@ public void CancelDigitalDocument()

webDriver.FindElement(documentConfirmModalOkBttn).Click();
}
else
{
WaitUntilVisible(documentCancelEmbbedWarning);
AssertTrueElementContains(documentCancelEmbbedWarning, "Unsaved updates will be lost. Click");
AssertTrueElementContains(documentCancelEmbbedWarning, "again to proceed without saving, or");
AssertTrueElementContains(documentCancelEmbbedWarning, "to save the changes.");
sharedModals.ModalClickCancelBttn();
}
}

public void CancelEditDigitalDocument()
Expand Down Expand Up @@ -736,8 +745,8 @@ public void InsertDocumentTypeDetails(DigitalDocument document)
if (document.Owner != "" && webDriver.FindElements(documentTypeOwnerInput).Count > 0)
webDriver.FindElement(documentTypeOwnerInput).SendKeys(document.Owner);

if (document.PhysicalLocation != "" && webDriver.FindElements(documentTypeOwnerInput).Count > 0)
webDriver.FindElement(documentTypeOwnerInput).SendKeys(document.PhysicalLocation);
if (document.PhysicalLocation != "" && webDriver.FindElements(documentHistoricFileTypePhyLocationInput).Count > 0)
webDriver.FindElement(documentHistoricFileTypePhyLocationInput).SendKeys(document.PhysicalLocation);

if (document.PIDNumber != "" && webDriver.FindElements(documentTypePropIdInput).Count > 0)
webDriver.FindElement(documentTypePropIdInput).SendKeys(document.PIDNumber);
Expand Down Expand Up @@ -1334,7 +1343,7 @@ private void VerifyForm12Fields()
AssertTrueIsDisplayed(documentLegalSurveyInput);

AssertTrueIsDisplayed(documentMOTIPlanLabel);
AssertTrueIsDisplayed(documentTypeMotiFileInput);
AssertTrueIsDisplayed(documentMOTIPlanInput);

AssertTrueIsDisplayed(documentShortDescriptorLabel);
AssertTrueIsDisplayed(documentShortDescriptorInput);
Expand Down
2 changes: 1 addition & 1 deletion testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LeaseDetails : PageObjectBase

//Lease Header Elements
private readonly By licenseHeaderNbrLabel = By.XPath("//label[contains(text(),'Lease/Licence #')]");
private readonly By licenseHeaderNbrContent = By.XPath("//label[contains(text(),'Lease/Licence #')]/parent::div/following-sibling::div/span[1]");
private readonly By licenseHeaderNbrContent = By.XPath("/html[1]/body[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/span[1]");
private readonly By licenseHeaderAccountType = By.XPath("//label[contains(text(),'Lease/Licence #')]/parent::div/following-sibling::div/span[2]");
private readonly By licenseHeaderProperty = By.XPath("//h1[contains(text(),'Lease / Licence')]/parent::div/parent::div/following-sibling::div[2]/div[1]/div/div/div/div[2]/div/label[contains(text(),'Property')]");
private readonly By licenseHeaderPropertyContent = By.XPath("//h1[contains(text(),'Lease / Licence')]/parent::div/parent::div/following-sibling::div[2]/div[1]/div/div/div/div[2]/div/label[contains(text(),'Property')]/parent::div/following-sibling::div/div/span");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public PropertyManagementTab(IWebDriver webDriver) : base(webDriver)
public void NavigateManagementTab()
{
WaitUntilSpinnerDisappear();
WaitUntilClickable(managementTabLink);
webDriver.FindElement(managementTabLink).Click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void UpdateDigitalDocuments(string fileType, int rowNumber)
Assert.Equal(5, digitalDocumentsTab.DigitalDocumentsTableResultNumber());

sharedPagination.ChoosePaginationOption(10);
Assert.Equal(10, digitalDocumentsTab.DigitalDocumentsTableResultNumber());
Assert.True(digitalDocumentsTab.DigitalDocumentsTableResultNumber() <= 10);

sharedPagination.ChoosePaginationOption(20);
Assert.True(digitalDocumentsTab.DigitalDocumentsTableResultNumber() <= 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() == 1);
Assert.True(searchProperties.PropertiesListFoundCount() >= 1);

//Search for a valid PIN in Inventory
searchProperties.SearchPropertyReset();
Expand Down
Loading