diff --git a/testing/PIMS.Tests.Automation/Classes/Property.cs b/testing/PIMS.Tests.Automation/Classes/Property.cs index f70c426bab..7a62838720 100644 --- a/testing/PIMS.Tests.Automation/Classes/Property.cs +++ b/testing/PIMS.Tests.Automation/Classes/Property.cs @@ -2,8 +2,15 @@ { public class Property { + public string PID { get; set; } = null!; + public string PlanNumber { get; set; } = null!; public string PropertyName { get; set; } = null!; public Address Address { get; set; } = new Address(); + public string GeneralLocation { get; set; } = null!; + public int HistoricalFileStartRow { get; set; } = 0; + public int HistoricalFileCount { get; set; } = 0; + public List PropertyHistoricalFiles { get; set; } = new List(); + public string LegalDescription { get; set; } = null!; public string MOTIRegion { get; set; } = null!; public string HighwaysDistrict { get; set; } = null!; public string ElectoralDistrict { get; set; } = null!; @@ -15,7 +22,6 @@ public class Property public List TenureStatus { get; set; } = new List(); public string ProvincialPublicHwy { get; set; } = null!; public List HighwayEstablishedBy { get; set; } = new List(); - public List AdjacentLandType { get; set; } = new List(); public string SqrMeters { get; set; } = null!; public Boolean IsVolumetric { get; set; } = false; public string Volume { get; set; } = null!; @@ -37,6 +43,13 @@ public class Address public string PostalCode { get; set; } = null!; } + public class HistoricalFile + { + public string HistoricalFileNumber { get; set; } = null!; + public string HistoricalFileType { get; set; } = null!; + public string HistoricalFileOtherDetails { get; set; } = null!; + } + public class SearchProperty { public string PID { get; set; } = null!; diff --git a/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx b/testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx index 3f6bb816d3..3ed7451431 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/Properties.feature b/testing/PIMS.Tests.Automation/Features/Properties.feature index 8f657e90a2..e0efa31381 100644 --- a/testing/PIMS.Tests.Automation/Features/Properties.feature +++ b/testing/PIMS.Tests.Automation/Features/Properties.feature @@ -4,8 +4,8 @@ Feature: Properties Property Inventory and Information Details test cases Scenario: 01. Property Information Tab - Given I review a Property's Information - When I update a Property details from row number 3 + Given I review a Property's Information from row number 3 + When I update a Property details Then A Property Information is saved successfully Scenario: 02. Property PIMS Files Tab diff --git a/testing/PIMS.Tests.Automation/Features/Properties.feature.cs b/testing/PIMS.Tests.Automation/Features/Properties.feature.cs index 36327d6f7d..2939ba0fbf 100644 --- a/testing/PIMS.Tests.Automation/Features/Properties.feature.cs +++ b/testing/PIMS.Tests.Automation/Features/Properties.feature.cs @@ -101,10 +101,10 @@ public void _01_PropertyInformationTab() { this.ScenarioStart(); #line 7 - testRunner.Given("I review a Property\'s Information", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); + testRunner.Given("I review a Property\'s Information from row number 3", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); #line hidden #line 8 - testRunner.When("I update a Property details from row number 3", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); + testRunner.When("I update a Property details", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); #line hidden #line 9 testRunner.Then("A Property Information is saved successfully", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); diff --git a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs index 087de1798c..d26877d685 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs @@ -7,7 +7,7 @@ namespace PIMS.Tests.Automation.PageObjects public class AcquisitionDetails : PageObjectBase { //Acquisition Files Menu Elements - private By menuAcquisitionButton = By.CssSelector("div[data-testid='nav-tooltip-acquisition'] a"); + private readonly By menuAcquisitionButton = By.CssSelector("div[data-testid='nav-tooltip-acquisition'] a"); private By createAcquisitionFileButton = By.XPath("//a[contains(text(),'Create an Acquisition File')]"); private By acquisitionFileSummaryBttn = By.XPath("//div[contains(text(),'File Summary')]"); @@ -31,6 +31,7 @@ public class AcquisitionDetails : PageObjectBase private By acquisitionFileHeaderLastUpdateContent = By.XPath("//strong[contains(text(), 'Updated')]/parent::span"); private By acquisitionFileHeaderLastUpdateByContent = By.XPath("//strong[contains(text(), 'Updated')]/parent::span/span[@id='userNameTooltip']/strong"); private By acquisitionFileHeaderHistoricalFileLabel = By.XPath("//label[contains(text(),'Historical File')]"); + private By acquisitionFileHeaderHistoricalFileContent = By.XPath("//label[contains(text(),'Historical File #:')]/parent::strong/parent::div/following-sibling::div/div/span"); private By acquisitionHeaderStatusContent = By.XPath("//div[@class='col']/div/div[3]/div/div"); private By acquisitionFileStatusSelect = By.Id("input-fileStatusTypeCode"); @@ -370,6 +371,7 @@ public void VerifyAcquisitionFileView(AcquisitionFile acquisition) AssertTrueContentEquals(acquisitionFileHeaderProductContent, acquisition.AcquisitionProjProductCode + " - " + acquisition.AcquisitionProjProduct); AssertTrueIsDisplayed(acquisitionFileHeaderHistoricalFileLabel); + Assert.True(webDriver.FindElements(acquisitionFileHeaderHistoricalFileContent).Count > 0); AssertTrueIsDisplayed(acquisitionFileHeaderCreatedDateLabel); AssertTrueContentNotEquals(acquisitionFileHeaderCreatedDateContent, ""); diff --git a/testing/PIMS.Tests.Automation/PageObjects/DispositionFileDetails.cs b/testing/PIMS.Tests.Automation/PageObjects/DispositionFileDetails.cs index 876039794f..50bf29892a 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/DispositionFileDetails.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/DispositionFileDetails.cs @@ -486,7 +486,7 @@ public void VerifyDispositionFileView(DispositionFile disposition) AssertTrueContentNotEquals(dispositionFileHeaderCodeContent, ""); AssertTrueIsDisplayed(dispositionFileHistoricalLabel); - //AssertTrueIsDisplayed(dispositionFileHistoricalContent); + Assert.True(webDriver.FindElements(dispositionFileHistoricalContent).Count > 0); AssertTrueIsDisplayed(dispositionFileHeaderCreatedDateLabel); AssertTrueContentNotEquals(dispositionFileHeaderCreatedDateContent, ""); diff --git a/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs b/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs index 0bf7e98679..17e190cd7a 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs @@ -25,7 +25,8 @@ public class LeaseDetails : PageObjectBase private By licenseHeaderExpiryDateLabel = By.XPath("//label[contains(text(),'Lease Start')]/parent::strong/parent::div/following-sibling::div[2]/strong/label[contains(text(),'Expiry')]"); private By licenseHeaderExpiryDateContent = By.XPath("//label[contains(text(),'Lease Start')]/parent::strong/parent::div/following-sibling::div[3]/span"); private By licenseHeaderHistoricalFileLabel = By.XPath("//label[contains(text(),'Historical File')]"); - private By licenseHeaderHistoricalFileContent = By.XPath("//label[contains(text(),'Historical File')]/parent::div/following-sibling::div/strong"); + private By licenseHeaderHistoricalFileContent = By.XPath("//label[contains(text(),'Historical File #:')]/parent::strong/parent::div/following-sibling::div/div/span"); + private By licenseHeaderCreatedLabel = By.XPath("//span/strong[contains(text(),'Created')]"); private By licenseHeaderCreatedContent = By.XPath("//strong[contains(text(),'Created')]/parent::span"); private By licenseHeaderCreatedByContent = By.XPath("//strong[contains(text(),'Created')]/parent::span/span[@data-testid='tooltip-icon-userNameTooltip']"); @@ -175,7 +176,6 @@ public class LeaseDetails : PageObjectBase //Leases Modal Element private By licenseDetailsConfirmationModal = By.CssSelector("div[class='modal-content']"); private By licenseDetailsConfirmationContent = By.CssSelector("div[class='modal-content'] p"); - //private By licenseDetailsAcknowledgeContinueBttn = By.XPath("//button/div[contains(text(),'Acknowledge & Continue')]"); private SharedFileProperties sharedSearchProperties; private SharedModals sharedModals; @@ -617,7 +617,7 @@ public void VerifyLicenseHeader(Lease lease) AssertTrueIsDisplayed(licenseHeaderExpiryDateLabel); AssertTrueIsDisplayed(licenseHeaderExpiryDateContent); AssertTrueIsDisplayed(licenseHeaderHistoricalFileLabel); - //AssertTrueIsDisplayed(licenseHeaderHistoricalFileContent); + Assert.True(webDriver.FindElements(licenseHeaderHistoricalFileContent).Count > 0); AssertTrueIsDisplayed(licenseHeaderCreatedLabel); AssertTrueContentNotEquals(licenseHeaderCreatedContent, ""); AssertTrueContentNotEquals(licenseHeaderCreatedByContent, ""); diff --git a/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs b/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs index 085fbd1b95..cca234b8df 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/PageObjectBase.cs @@ -179,18 +179,24 @@ protected void AssertTrueIsDisplayed(By elementBy) Assert.True(webDriver.FindElement(elementBy).Displayed); } - protected void AssertTrueContentEquals(By elementBy, string text) + protected void AssertTrueContentEquals(By elementBy, string text = "") { WaitUntilVisible(elementBy); Assert.Equal(text, webDriver.FindElement(elementBy).Text); } - protected void AssertTrueElementValueEquals(By elementBy, string text) + protected void AssertTrueElementValueEquals(By elementBy, string text = "") { WaitUntilVisible(elementBy); Assert.Equal(text, webDriver.FindElement(elementBy).GetAttribute("Value")); } + protected void AssertTrueContentNotEquals(By elementBy, string text) + { + WaitUntilVisible(elementBy); + Assert.True(webDriver.FindElement(elementBy).Text != text); + } + protected void AssertTrueDoublesEquals(By elementBy, double number2) { WaitUntilVisible(elementBy); @@ -200,12 +206,6 @@ protected void AssertTrueDoublesEquals(By elementBy, double number2) Assert.True(number1.Equals(number2)); } - protected void AssertTrueContentNotEquals(By elementBy, string text) - { - WaitUntilVisible(elementBy); - Assert.True(webDriver.FindElement(elementBy).Text != text); - } - protected void AssertTrueElementContains(By elementBy, string text) { WaitUntilVisible(elementBy); @@ -244,9 +244,7 @@ protected string TransformNumberFormat(string amount) if (amount == "") - { return ""; - } else { decimal value = decimal.Parse(amount); @@ -327,7 +325,7 @@ protected string GetUppercaseString(string elementValue) protected string GetSubstring(string input, int startIndex, int endIndex) { - return input.Substring(startIndex, endIndex); + return input.Substring(startIndex, endIndex - startIndex); } public void Dispose() diff --git a/testing/PIMS.Tests.Automation/PageObjects/PropertyInformation.cs b/testing/PIMS.Tests.Automation/PageObjects/PropertyInformation.cs index f6a601f7ef..a12bb5554c 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/PropertyInformation.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/PropertyInformation.cs @@ -41,6 +41,8 @@ public class PropertyInformation : PageObjectBase private By propertyInformationHeaderAddressContent = By.XPath("//label[contains(text(),'Civic Address')]/parent::strong/parent::div/following-sibling::div"); private By propertyInformationHeaderPlanLabel = By.XPath("//label[contains(text(),'Plan')]"); private By propertyInformationHeaderPlanContent = By.XPath("//label[contains(text(),'Plan #')]/parent::strong/parent::div/following-sibling::div"); + private By propertyInformationHeaderHistoricFileLabel = By.XPath("//label[contains(text(),'Historical File #:')]"); + private By propertyInformationHeaderHistoricFileContent = By.XPath("//label[contains(text(),'Historical File #:')]/parent::strong/parent::div/following-sibling::div/div/span"); private By propertyInformationHeaderPIDLabel = By.XPath("//label[contains(text(),'PID')]"); private By propertyInformationHeaderPIDContent = By.XPath("//label[contains(text(),'PID')]/parent::strong/parent::div/following-sibling::div"); private By propertyInformationHeaderLandTypeLabel = By.XPath("//strong/label[contains(text(),'Land parcel type')]"); @@ -123,10 +125,10 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsEditAddressTitle = By.XPath("//div[contains(text(),'Property Address')]"); private By propertyDetailsAddressNotAvailable = By.XPath("//b[contains(text(),'Property address not available')]"); private By propertyDetailsAddressLabel = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div/label"); - private By propertyDetailsAddressContent = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div[2]"); - private By propertyDetailsAddressContentDetails = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div[2]"); private By propertyDetailsAddressLine1Label = By.XPath("//label[contains(text(),'Address (line 1)')]"); - + private By propertyDetailsAddressLine1Content = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div[2]/div[1]"); + private By propertyDetailsAddressLine2Content = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div[2]/div[2]"); + private By propertyDetailsAddressLine3Content = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/h2/div/div[contains(text(),'Property Address')]/parent::div/parent::h2/following-sibling::div/div[1]/div[2]/div[3]"); private By propertyDetailsCityLabel = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/div/div[2]/div/label[contains(text(),'City')]"); private By propertyDetailsCityContent = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/div/div[2]/div/label[contains(text(),'City')]/parent::div/following-sibling::div"); private By propertyDetailsEditCityLabel = By.XPath("//Label[contains(text(),'City')]"); @@ -135,8 +137,12 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsPostalCodeLabel = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/div/div[4]/div/label[contains(text(),'Postal code')]"); private By propertyDetailsPostalCodeContent = By.XPath("//div[@class='tab-content']/div[@role='tabpanel']/div/div[2]/div/div[4]/div/label[contains(text(),'Postal code')]/parent::div/following-sibling::div"); private By propertyDetailsEditPostalCodeLabel = By.XPath("//Label[contains(text(),'Postal code')]"); + private By propertyDetailsGeneralLocationLabel = By.XPath("//label[contains(text(),'General location')]"); + private By propertyDetailsGeneralLocationContent = By.XPath("//label[contains(text(),'General location')]/parent::div/following-sibling::div"); private By propertyDetailsAttributesTitle = By.XPath("//div[contains(text(),'Property Attributes')]"); + private By propertyDetailsAttrLegalDescLabel = By.XPath("//label[contains(text(),'Legal Description')]"); + private By propertyDetailsAttrLegalDescContent = By.XPath("//label[contains(text(),'Legal Description')]/parent::div/following-sibling::div"); private By propertyDetailsAttrRegionLabel = By.XPath("//label[contains(text(),'MOTI region')]"); private By propertyDetailsAttrRegionDiv = By.XPath("//label[contains(text(),'MOTI region')]/parent::div/following-sibling::div"); private By propertyDetailsAttrHighwayLabel = By.XPath("//label[contains(text(),'Highways district')]"); @@ -152,17 +158,17 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsAttrMunicipalLabel = By.XPath("//label[contains(text(),'Municipal zoning')]"); private By propertyDetailsAttrMunicipalDiv = By.XPath("//label[contains(text(),'Municipal zoning')]/parent::div/following-sibling::div"); private By propertyDetailsAttrAnomaliesLabel = By.XPath("//label[contains(text(),'Anomalies')]"); - private By propertyDetailsAttrAnomaliesDiv = By.XPath("//label[contains(text(),'Anomalies')]/parent::div/following-sibling::div/div/div"); + private By propertyDetailsAttrAnomaliesDiv = By.XPath("//label[contains(text(),'Anomalies')]/parent::div/following-sibling::div/div/div/div"); private By propertyDetailsAttrCoordinatesLabel = By.XPath("//label[contains(text(),'Coordinates')]"); private By propertyDetailsAttrCoordinatesDiv = By.XPath("//label[contains(text(),'Coordinates')]/parent::div/following-sibling::div"); private By propertyDetailsTenureTitle = By.XPath("//div[contains(text(),'Tenure Status')]"); private By propertyDetailsTenureStatusLabel = By.XPath("//label[contains(text(),'Tenure status')]"); - private By propertyDetailsTenureStatusDiv = By.XPath("//label[contains(text(),'Tenure status')]/parent::div/following-sibling::div"); + private By propertyDetailsTenureStatusDiv = By.XPath("//label[contains(text(),'Tenure status')]/parent::div/following-sibling::div/div/div/div"); private By propertyDetailsPublicHwyLabel = By.XPath("//label[contains(text(),'Provincial Public Hwy')]"); private By propertyDetailsPublicHwyDiv = By.XPath("//label[contains(text(),'Provincial Public Hwy')]/parent::div/following-sibling::div"); private By propertyDetailsHighwayRoadEstablishLabel = By.XPath("//label[contains(text(),'Highway / Road established by')]"); - private By propertyDetailsHighwayRoadEstablisDiv = By.XPath("//label[contains(text(),'Highway / Road established by')]/parent::div/following-sibling::div"); + private By propertyDetailsHighwayRoadEstablishDiv = By.XPath("//label[contains(text(),'Highway / Road established by')]/parent::div/following-sibling::div"); private By propertyDetailsAdjacentLandTypeLabel = By.XPath("//label[contains(text(),'Adjacent Land type')]"); private By propertyDetailsAdjacentLandTypeDiv = By.XPath("//label[contains(text(),'Adjacent Land type')]/parent::div/following-sibling::div"); @@ -175,19 +181,30 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsMeasurementsTitle = By.XPath("//div[contains(text(),'Measurements')]"); private By propertyDetailsMeasurementsAreaLabel = By.XPath("//label[contains(text(),'Area')]"); - private By propertyDetailsMeasurementVolumeParcelLabel = By.XPath("//label[contains(text(),'Is this a volumetric parcel?')]"); - private By propertyDetailsMeasurementVolumeLabel = By.XPath("//label[contains(text(),'Volume')]"); - private By propertyDetailsMeasurementTypeLabel = By.XPath("//label[contains(text(),'Type')]"); private By propertyDetailsAreaSqMtsLabel = By.XPath("//div[contains(text(),'sq. metres')]"); + private By propertyDetailsAreaSqMtsContent = By.XPath("//label[contains(text(),'Area')]/parent::div/following-sibling::div/div/div[1]/div/div[1]/div[1]"); private By propertyDetailsAreaHtsLabel = By.XPath("//div[contains(text(),'hectares')]"); private By propertyDetailsAreaSqFeetLabel = By.XPath("//div[contains(text(),'sq. feet')]"); private By propertyDetailsAreaAcresLabel = By.XPath("//div[contains(text(),'acres')]"); + private By propertyDetailsMeasurementVolumeParcelLabel = By.XPath("//label[contains(text(),'Is this a volumetric parcel?')]"); + private By propertyDetailsMeasurementVolumeLabel = By.XPath("//label[contains(text(),'Volume')]"); private By propertyDetailsAreaMtsCubeLabel = By.XPath("//span[contains(text(),'metres')]"); + private By propertyDetailsAreaMtsCubeContent = By.XPath("//label[contains(text(),'Volume')]/parent::div/following-sibling::div/div/div[1]/div/div[1]/div[1]/div[1]/div[1]"); private By propertyDetailsAreaFeetCubeLabel = By.XPath("//span[contains(text(),'feet')]"); + private By propertyDetailsMeasurementTypeLabel = By.XPath("//label[contains(text(),'Type')]"); + private By propertyDetailsMeasurementTypeContent = By.XPath("//label[contains(text(),'Type')]/parent::div/following-sibling::div"); private By propertyDetailsViewNotesTitle = By.XPath("//div[contains(text(),'Measurements')]/parent::div/parent::h2/parent::div/following-sibling::div/h2/div/div[contains(text(),'Notes')]"); private By propertyDetailsEditNotesTitle = By.XPath("//h2/div/div[contains(text(),'Notes')]"); + private By propertyDetailsViewNotesContent = By.XPath("//div[contains(text(),'Notes')]/parent::div/parent::h2/following-sibling::div/p"); + + private By propertyDetailsSubdivisionTitle = By.XPath("//div[contains(text(),'Subdivision History')]"); + private By propertyDetailsSubdivisionNoneContent = By.XPath("//div[contains(text(),'This property is not part of a subdivision')]"); + + private By propertyDetailsConsolidationTitle = By.XPath("//div[contains(text(),'Consolidation History')]"); + private By propertyDetailsConsolidationNoneContent = By.XPath("//div[contains(text(),'This property is not part of a consolidation')]"); + //Create Form elements private By propertyDetailsAddressAddLineBttn = By.XPath("//div[contains(text(),'Add an address line')]/parent::button"); private By propertyDetailsAddressLine1Input = By.Id("input-address.streetAddress1"); private By propertyDetailsAddressLine2Input = By.Id("input-address.streetAddress2"); @@ -195,7 +212,12 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsAddressLineDeleteBttn = By.XPath("//*[@data-testid='remove-button']/parent::div/parent::button"); private By propertyDetailsAddressCityInput = By.Id("input-address.municipality"); private By propertyDetailsPostalCodeInput = By.Id("input-address.postal"); + private By propertyDetailsGeneralLocationInput = By.Id("input-generalLocation"); + private By propertyAttrAddHistoricalFileButton = By.CssSelector("button[data-testid='add-historical-number']"); + private By propertyAttrHistoricalFilesTotalCount = By.XPath("//label[contains(text(),'Historical File #')]/parent::div/following-sibling::div/div"); + private By propertyAttributesHistoricalFile1stDeleteButton = By.CssSelector("div[data-testid='historical-number-row-0'] button"); + private By propertyAttributesLegalDescriptionInput = By.Id("input-landLegalDescription"); private By propertyDetailsMotiRegionSelect = By.Id("input-regionTypeCode"); private By propertyDetailsHighwayDistrictSelect = By.Id("input-districtTypeCode"); private By propertyDetailsRailwaySelect = By.Id("input-isRwyBeltDomPatent"); @@ -204,15 +226,14 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsAnomaliesInput = By.Id("multiselect-anomalies_input"); private By propertyDetailsAnomaliesOptions = By.XPath("//input[@id='multiselect-anomalies_input']/parent::div/following-sibling::div/ul[@class='optionContainer']"); private By propertyDetailsAttrAnomaliesDeleteBttns = By.CssSelector("div[id='multiselect-anomalies'] i[class='custom-close']"); + private By propertyDetailsTenureStatusInput = By.Id("multiselect-tenures_input"); private By propertyDetailsTenureOptions = By.XPath("//input[@id='multiselect-tenures_input']/parent::div/following-sibling::div/ul[@class='optionContainer']"); private By propertyDetailsTenureDeleteBttns = By.CssSelector("div[id='multiselect-tenures'] i[class='custom-close']"); private By propertyDetailsProvPublicHwy = By.Id("input-pphStatusTypeCode"); private By propertyDetailsRoadEstablishInput = By.Id("multiselect-roadTypes_input"); private By propertyDetailsRoadEstablishOptions = By.XPath("//input[@id='multiselect-roadTypes_input']/parent::div/following-sibling::div/ul[@class='optionContainer']"); - private By propertyDetailsAdjacentLandInput = By.Id("multiselect-adjacentLands_input"); - private By propertyDetailsAdjacentLandOptions = By.XPath("//input[@id='multiselect-adjacentLands_input']/parent::div/following-sibling::div/ul[@class='optionContainer']"); - private By propertyDetailsAdjacentLandDeleteBttns = By.CssSelector("div[id='multiselect-adjacentLands'] i[class='custom-close']"); + private By propertyDetailsAreaSqMtsInput = By.Name("area-sq-meters"); private By propertyDetailsAreaHctInput = By.Name("area-hectares"); private By propertyDetailsAreaSqFtInput = By.Name("area-sq-feet"); @@ -222,6 +243,7 @@ public class PropertyInformation : PageObjectBase private By propertyDetailsVolCubeMtsInput = By.Name("volume-cubic-meters"); private By propertyDetailsVolCubeFeetInput = By.Name("volume-cubic-feet"); private By propertyDetailsVolTypeSelect = By.Id("input-volumetricParcelTypeCode"); + private By propertyDetailsNotesTextarea = By.Id("input-notes"); //Property Information Confirmation Modal @@ -336,7 +358,6 @@ public void EditPropertyInfoBttn() public void SavePropertyDetails() { ButtonElement("Save"); - } public void CancelPropertyDetails() @@ -345,19 +366,14 @@ public void CancelPropertyDetails() Wait(); if (webDriver.FindElements(propertyInformationConfirmationModal).Count > 0) - { - //Assert.Equal("Confirm changes", sharedModals.ModalHeader()); - //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 UpdatePropertyDetails(Property property) { - Wait(3000); + Wait(); + //PROPERTY ADDRESS //Delete previous Line 2 or Line 3 if existing while (webDriver.FindElements(propertyDetailsAddressLineDeleteBttn).Count > 0) { @@ -389,22 +405,40 @@ public void UpdatePropertyDetails(Property property) ClearInput(propertyDetailsPostalCodeInput); webDriver.FindElement(propertyDetailsPostalCodeInput).SendKeys(property.Address.PostalCode); } - if (property.MOTIRegion != "") + if (property.GeneralLocation != "") { - ChooseSpecificSelectOption(propertyDetailsMotiRegionSelect, property.MOTIRegion); + ClearInput(propertyDetailsGeneralLocationInput); + webDriver.FindElement(propertyDetailsGeneralLocationInput).SendKeys(property.GeneralLocation); } - if (property.HighwaysDistrict != "") + + //ATTRIBUTES + while (webDriver.FindElements(propertyAttributesHistoricalFile1stDeleteButton).Count > 0) + DeleteFirstHistoricalFile(); + + if (property.PropertyHistoricalFiles!.Count > 0) { - ChooseSpecificSelectOption(propertyDetailsHighwayDistrictSelect, property.HighwaysDistrict); + for (var i = 0; i < property.PropertyHistoricalFiles.Count; i++) + AddHistoricalFile(property.PropertyHistoricalFiles[i]); } - if (property.RailwayBelt != "") + + if (property.LegalDescription != "") { - ChooseSpecificSelectOption(propertyDetailsRailwaySelect, property.RailwayBelt); + ClearInput(propertyAttributesLegalDescriptionInput); + webDriver.FindElement(propertyAttributesLegalDescriptionInput).SendKeys(property.LegalDescription); } + + if (property.MOTIRegion != "") + ChooseSpecificSelectOption(propertyDetailsMotiRegionSelect, property.MOTIRegion); + + if (property.HighwaysDistrict != "") + ChooseSpecificSelectOption(propertyDetailsHighwayDistrictSelect, property.HighwaysDistrict); + + if (property.RailwayBelt != "") + ChooseSpecificSelectOption(propertyDetailsRailwaySelect, property.RailwayBelt); + if (property.LandParcelType != "") - { ChooseSpecificSelectOption(propertyDetailsLandTypeSelect, property.LandParcelType); - } + if (property.MunicipalZoning != "") { ClearInput(propertyDetailsMunicipalZoneInput); @@ -415,10 +449,9 @@ public void UpdatePropertyDetails(Property property) if (webDriver.FindElements(propertyDetailsAttrAnomaliesDeleteBttns).Count > 0) { while (webDriver.FindElements(propertyDetailsAttrAnomaliesDeleteBttns).Count > 0) - { - webDriver.FindElements(propertyDetailsAttrAnomaliesDeleteBttns)[0].Click(); - } + webDriver.FindElements(propertyDetailsAttrAnomaliesDeleteBttns)[0].Click(); } + if (property.Anomalies.First() != "") { foreach (string anomaly in property.Anomalies) @@ -435,10 +468,10 @@ public void UpdatePropertyDetails(Property property) { FocusAndClick(propertyDetailsTenureStatusInput); while (webDriver.FindElements(propertyDetailsTenureDeleteBttns).Count > 0) - { - webDriver.FindElements(propertyDetailsTenureDeleteBttns)[0].Click(); - } + webDriver.FindElements(propertyDetailsTenureDeleteBttns)[0].Click(); } + + //TENURE STATUS if (property.TenureStatus.First() != "") { foreach (string status in property.TenureStatus) @@ -451,9 +484,7 @@ public void UpdatePropertyDetails(Property property) } if (property.ProvincialPublicHwy != "") - { - ChooseSpecificSelectOption(propertyDetailsProvPublicHwy, property.ProvincialPublicHwy); - } + ChooseSpecificSelectOption(propertyDetailsProvPublicHwy, property.ProvincialPublicHwy); if (property.HighwayEstablishedBy.First() != "") { @@ -465,45 +496,28 @@ public void UpdatePropertyDetails(Property property) } } - //Delete Adjacent Land previously selected if any - if (webDriver.FindElements(propertyDetailsAdjacentLandDeleteBttns).Count > 0) - { - while (webDriver.FindElements(propertyDetailsAdjacentLandDeleteBttns).Count > 0) - { - webDriver.FindElements(propertyDetailsAdjacentLandDeleteBttns)[0].Click(); - } - } - //if (property.AdjacentLandType.First() != "") - //{ - // ClearMultiSelectInput(propertyDetailsAdjacentLandInput); - // foreach (string type in property.AdjacentLandType) - // { - // FocusAndClick(propertyDetailsAdjacentLandInput); - // ChooseMultiSelectSpecificOption(propertyDetailsAdjacentLandOptions, type); - // } - //} + //MEASUREMENTS if (property.SqrMeters != "") { ClearDigitsInput(propertyDetailsAreaSqMtsInput); webDriver.FindElement(propertyDetailsAreaSqMtsInput).SendKeys(property.SqrMeters); } + if (property.IsVolumetric) - { FocusAndClick(propertyDetailsIsVolumeRadioYes); - } else - { FocusAndClick(propertyDetailsIsVolumeRadioNo); - } + if (property.Volume != "") { ClearInput(propertyDetailsVolCubeMtsInput); webDriver.FindElement(propertyDetailsVolCubeMtsInput).SendKeys(property.Volume); } + if (property.VolumeType != "") - { ChooseSpecificSelectOption(propertyDetailsVolTypeSelect, property.VolumeType); - } + + //NOTES if (property.PropertyNotes != "") { ClearInput(propertyDetailsNotesTextarea); @@ -514,16 +528,16 @@ public void UpdatePropertyDetails(Property property) public void VerifyPropertyMapPopUpView() { WaitUntilVisible(propertyLeafletTitle); - Assert.True(webDriver.FindElement(propertyLeafletCloseLink).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletTitle).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletPIDLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletPINLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletPlanNbrLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletOwnerTypeLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletMunicipalityLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletAreaLabel).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletZoomMapZoomBttn).Displayed); - Assert.True(webDriver.FindElement(propertyLeafletEllipsisBttn).Displayed); + AssertTrueIsDisplayed(propertyLeafletCloseLink); + AssertTrueIsDisplayed(propertyLeafletTitle); + AssertTrueIsDisplayed(propertyLeafletPIDLabel); + AssertTrueIsDisplayed(propertyLeafletPINLabel); + AssertTrueIsDisplayed(propertyLeafletPlanNbrLabel); + AssertTrueIsDisplayed(propertyLeafletOwnerTypeLabel); + AssertTrueIsDisplayed(propertyLeafletMunicipalityLabel); + AssertTrueIsDisplayed(propertyLeafletAreaLabel); + AssertTrueIsDisplayed(propertyLeafletZoomMapZoomBttn); + AssertTrueIsDisplayed(propertyLeafletEllipsisBttn); } public void VerifyTitleTab() @@ -604,37 +618,44 @@ public void VerifyValueTab() AssertTrueIsDisplayed(propertySalesDescription); } - public void VerifyPropertyInformationHeader() + public void VerifyPropertyInformationHeader(bool hasHistoricalFile) { Wait(); - Assert.True(webDriver.FindElement(propertyInformationHeaderTitle).Displayed); - Assert.True(webDriver.FindElement(propertyInformationHeaderAddressLabel).Displayed); - Assert.True(webDriver.FindElement(propertyInformationHeaderAddressContent).Text != null); - Assert.True(webDriver.FindElement(propertyInformationHeaderPlanLabel).Displayed); - Assert.True(webDriver.FindElement(propertyInformationHeaderPlanContent).Text != null); - Assert.True(webDriver.FindElement(propertyInformationHeaderPIDLabel).Displayed); - Assert.True(webDriver.FindElement(propertyInformationHeaderPIDContent).Text != null); - Assert.True(webDriver.FindElement(propertyInformationHeaderLandTypeLabel).Displayed); - Assert.True(webDriver.FindElement(propertyInformationHeaderLandTypeContent).Text != null); - Assert.True(webDriver.FindElement(propertyInformationHeaderZoomBttn).Displayed); + AssertTrueIsDisplayed(propertyInformationHeaderTitle); + + AssertTrueIsDisplayed(propertyInformationHeaderAddressLabel); + AssertTrueContentNotEquals(propertyInformationHeaderAddressContent, ""); + + AssertTrueIsDisplayed(propertyInformationHeaderPlanLabel); + AssertTrueContentNotEquals(propertyInformationHeaderPlanContent, ""); + + AssertTrueIsDisplayed(propertyInformationHeaderHistoricFileLabel); + if(hasHistoricalFile) + Assert.True(webDriver.FindElements(propertyInformationHeaderHistoricFileContent).Count > 0); + + AssertTrueIsDisplayed(propertyInformationHeaderPIDLabel); + AssertTrueContentNotEquals(propertyInformationHeaderPIDContent, ""); + + AssertTrueIsDisplayed(propertyInformationHeaderLandTypeLabel); + AssertTrueContentNotEquals(propertyInformationHeaderLandTypeContent, ""); + + AssertTrueIsDisplayed(propertyInformationHeaderZoomBttn); } public void VerifyPropertyDetailsView() { - //WaitUntilDisappear(propertyDetailsWaitSpinner); - Wait(3000); + Wait(); AssertTrueIsDisplayed(propertyDetailsAddressTitle); if (webDriver.FindElements(propertyDetailsAddressNotAvailable).Count() > 0) - { AssertTrueIsDisplayed(propertyDetailsAddressNotAvailable); - } + else { AssertTrueIsDisplayed(propertyDetailsAddressLabel); - AssertTrueIsDisplayed(propertyDetailsAddressContent); + AssertTrueIsDisplayed(propertyDetailsAddressLine1Content); AssertTrueIsDisplayed(propertyDetailsCityLabel); AssertTrueIsDisplayed(propertyDetailsCityContent); AssertTrueIsDisplayed(propertyDetailsProvinceLabel); @@ -672,7 +693,7 @@ public void VerifyPropertyDetailsView() if (webDriver.FindElements(propertyDetailsHighwayRoadEstablishLabel).Count() > 0) { AssertTrueIsDisplayed(propertyDetailsHighwayRoadEstablishLabel); - AssertTrueIsDisplayed(propertyDetailsHighwayRoadEstablisDiv); + AssertTrueIsDisplayed(propertyDetailsHighwayRoadEstablishDiv); } if (webDriver.FindElements(propertyDetailsAdjacentLandTypeLabel).Count() > 0) @@ -683,35 +704,36 @@ public void VerifyPropertyDetailsView() if (webDriver.FindElements(propertyDetailsFirstNationTitle).Count() > 0) { - Assert.True(webDriver.FindElement(propertyDetailsFirstNationTitle).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsFirstNationBandNameLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsFirstNationBandNameDiv).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsFirstNationReserveLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsFirstNationReserveDiv).Displayed); + AssertTrueIsDisplayed(propertyDetailsFirstNationTitle); + AssertTrueIsDisplayed(propertyDetailsFirstNationBandNameLabel); + AssertTrueIsDisplayed(propertyDetailsFirstNationBandNameDiv); + AssertTrueIsDisplayed(propertyDetailsFirstNationReserveLabel); + AssertTrueIsDisplayed(propertyDetailsFirstNationReserveDiv); } - Assert.True(webDriver.FindElement(propertyDetailsMeasurementsTitle).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsMeasurementsAreaLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsMeasurementVolumeParcelLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaSqMtsLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaHtsLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaSqFeetLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaAcresLabel).Displayed); + AssertTrueIsDisplayed(propertyDetailsMeasurementsTitle); + AssertTrueIsDisplayed(propertyDetailsMeasurementsAreaLabel); + AssertTrueIsDisplayed(propertyDetailsMeasurementVolumeParcelLabel); + AssertTrueIsDisplayed(propertyDetailsAreaSqMtsLabel); + AssertTrueIsDisplayed(propertyDetailsAreaHtsLabel); + AssertTrueIsDisplayed(propertyDetailsAreaSqFeetLabel); + AssertTrueIsDisplayed(propertyDetailsAreaAcresLabel); if (webDriver.FindElements(propertyDetailsMeasurementVolumeLabel).Count() > 0) { - Assert.True(webDriver.FindElement(propertyDetailsMeasurementVolumeLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsMeasurementTypeLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaMtsCubeLabel).Displayed); - Assert.True(webDriver.FindElement(propertyDetailsAreaFeetCubeLabel).Displayed); + AssertTrueIsDisplayed(propertyDetailsMeasurementVolumeLabel); + AssertTrueIsDisplayed(propertyDetailsMeasurementTypeLabel); + AssertTrueIsDisplayed(propertyDetailsAreaMtsCubeLabel); + AssertTrueIsDisplayed(propertyDetailsAreaFeetCubeLabel); } - Assert.True(webDriver.FindElement(propertyDetailsViewNotesTitle).Displayed); + AssertTrueIsDisplayed(propertyDetailsViewNotesTitle); } public void VerifyUpdatePropertyDetailsView(Property property) { - WaitUntilVisible(propertyDetailsEditBttn); + + //ADDRESS AssertTrueIsDisplayed(propertyDetailsAddressTitle); if (webDriver.FindElements(propertyDetailsAddressNotAvailable).Count() > 0) @@ -719,35 +741,67 @@ public void VerifyUpdatePropertyDetailsView(Property property) else { AssertTrueIsDisplayed(propertyDetailsAddressLabel); - //To-Do: Address + if(property.Address.AddressLine1 != "") + AssertTrueContentEquals(propertyDetailsAddressLine1Content, property.Address.AddressLine1); + + if (property.Address.AddressLine2 != "") + AssertTrueContentEquals(propertyDetailsAddressLine2Content, property.Address.AddressLine2); + + if (property.Address.AddressLine3 != "") + AssertTrueContentEquals(propertyDetailsAddressLine3Content, property.Address.AddressLine3); + AssertTrueIsDisplayed(propertyDetailsCityLabel); - AssertTrueContentEquals(propertyDetailsCityContent, property.Address.City); + if(property.Address.City != "") + AssertTrueContentEquals(propertyDetailsCityContent, property.Address.City); + AssertTrueIsDisplayed(propertyDetailsProvinceLabel); - AssertTrueContentEquals(propertyDetailsProvinceContent, property.Address.Province); + if(property.Address.Province != null) + AssertTrueContentEquals(propertyDetailsProvinceContent, "British Columbia"); + AssertTrueIsDisplayed(propertyDetailsPostalCodeLabel); - AssertTrueContentEquals(propertyDetailsPostalCodeContent, property.Address.PostalCode); + if(property.Address.PostalCode != "") + AssertTrueContentEquals(propertyDetailsPostalCodeContent, property.Address.PostalCode); } + AssertTrueIsDisplayed(propertyDetailsGeneralLocationLabel); + if(property.GeneralLocation != "") + AssertTrueContentEquals(propertyDetailsGeneralLocationContent, property.GeneralLocation); + + //ATTRIBUTES AssertTrueIsDisplayed(propertyDetailsAttributesTitle); + + AssertTrueIsDisplayed(propertyDetailsAttrLegalDescLabel); + if (property.LegalDescription != "") + AssertTrueContentEquals(propertyDetailsAttrLegalDescContent, property.LegalDescription); + AssertTrueIsDisplayed(propertyDetailsAttrRegionLabel); AssertTrueContentEquals(propertyDetailsAttrRegionDiv, property.MOTIRegion); - AssertTrueIsDisplayed(propertyDetailsAttrHighwayLabel); + AssertTrueIsDisplayed(propertyDetailsAttrHighwayLabel); var highWayDistrictText = webDriver.FindElement(propertyDetailsAttrHighwayDiv).Text; Assert.Equal(property.HighwaysDistrict, GetSubstring(highWayDistrictText, 2, highWayDistrictText.Length)); AssertTrueIsDisplayed(propertyDetailsAttrElectoralLabel); - AssertTrueContentEquals(propertyDetailsAttrElectoralDiv,property.ElectoralDistrict); + if(property.ElectoralDistrict != "") + AssertTrueContentEquals(propertyDetailsAttrElectoralDiv,property.ElectoralDistrict); + AssertTrueIsDisplayed(propertyDetailsAttrAgriLandLabel); - AssertTrueContentEquals(propertyDetailsAttrAgriLandDiv, property.AgriculturalLandReserve); + if(property.AgriculturalLandReserve != "") + AssertTrueContentEquals(propertyDetailsAttrAgriLandDiv, property.AgriculturalLandReserve); + AssertTrueIsDisplayed(propertyDetailsAttrRailwayLabel); - AssertTrueContentEquals(propertyDetailsAttrRailwayDiv, property.RailwayBelt); + if(property.RailwayBelt != "") + AssertTrueContentEquals(propertyDetailsAttrRailwayDiv, property.RailwayBelt); + AssertTrueIsDisplayed(propertyDetailsAttrLandParcelLabel); - AssertTrueContentEquals(propertyDetailsAttrLandParcelDiv,property.LandParcelType); + if(property.LandParcelType != "") + AssertTrueContentEquals(propertyDetailsAttrLandParcelDiv,property.LandParcelType); + AssertTrueIsDisplayed(propertyDetailsAttrMunicipalLabel); - AssertTrueContentEquals(propertyDetailsAttrMunicipalDiv,property.MunicipalZoning); - AssertTrueIsDisplayed(propertyDetailsAttrAnomaliesLabel); + if(property.MunicipalZoning != "") + AssertTrueContentEquals(propertyDetailsAttrMunicipalDiv,property.MunicipalZoning); + AssertTrueIsDisplayed(propertyDetailsAttrAnomaliesLabel); if (property.Anomalies.First() != "") { var anomaliesUI = GetViewFieldListContent(propertyDetailsAttrAnomaliesDiv); @@ -755,6 +809,8 @@ public void VerifyUpdatePropertyDetailsView(Property property) } AssertTrueIsDisplayed(propertyDetailsAttrCoordinatesLabel); + + //TENURE STATUS AssertTrueIsDisplayed(propertyDetailsTenureTitle); AssertTrueIsDisplayed(propertyDetailsTenureStatusLabel); @@ -771,18 +827,10 @@ public void VerifyUpdatePropertyDetailsView(Property property) { AssertTrueIsDisplayed(propertyDetailsHighwayRoadEstablishLabel); - var highwayEstablishedUI = GetViewFieldListContent(propertyDetailsHighwayRoadEstablisDiv); + var highwayEstablishedUI = GetViewFieldListContent(propertyDetailsHighwayRoadEstablishDiv); Assert.True(Enumerable.SequenceEqual(highwayEstablishedUI, property.HighwayEstablishedBy)); } - if (webDriver.FindElements(propertyDetailsAdjacentLandTypeLabel).Count() > 0) - { - AssertTrueIsDisplayed(propertyDetailsAdjacentLandTypeLabel); - - var adjacentLandTypeUI = GetViewFieldListContent(propertyDetailsAdjacentLandTypeDiv); - Assert.True(Enumerable.SequenceEqual(adjacentLandTypeUI, property.AdjacentLandType)); - } - if (webDriver.FindElements(propertyDetailsFirstNationTitle).Count() > 0) { AssertTrueIsDisplayed(propertyDetailsFirstNationTitle); @@ -792,23 +840,42 @@ public void VerifyUpdatePropertyDetailsView(Property property) AssertTrueIsDisplayed(propertyDetailsFirstNationReserveDiv); } + //MEASUREMENTS AssertTrueIsDisplayed(propertyDetailsMeasurementsTitle); AssertTrueIsDisplayed(propertyDetailsMeasurementsAreaLabel); - AssertTrueIsDisplayed(propertyDetailsMeasurementVolumeParcelLabel); + if(property.SqrMeters != "") + AssertTrueContentEquals(propertyDetailsAreaSqMtsContent, property.SqrMeters); AssertTrueIsDisplayed(propertyDetailsAreaSqMtsLabel); AssertTrueIsDisplayed(propertyDetailsAreaHtsLabel); AssertTrueIsDisplayed(propertyDetailsAreaSqFeetLabel); AssertTrueIsDisplayed(propertyDetailsAreaAcresLabel); + AssertTrueIsDisplayed(propertyDetailsMeasurementVolumeParcelLabel); + if(property.Volume!= "") + AssertTrueContentEquals(propertyDetailsAreaMtsCubeContent, property.Volume); + if (webDriver.FindElements(propertyDetailsMeasurementVolumeLabel).Count() > 0) { AssertTrueIsDisplayed(propertyDetailsMeasurementVolumeLabel); AssertTrueIsDisplayed(propertyDetailsMeasurementTypeLabel); + if(property.VolumeType != "") + AssertTrueContentEquals(propertyDetailsMeasurementTypeContent, property.VolumeType); AssertTrueIsDisplayed(propertyDetailsAreaMtsCubeLabel); AssertTrueIsDisplayed(propertyDetailsAreaFeetCubeLabel); } + //NOTES AssertTrueIsDisplayed(propertyDetailsViewNotesTitle); + if(property.PropertyNotes != "") + AssertTrueContentEquals(propertyDetailsViewNotesContent, property.PropertyNotes); + + //SUBDIVISION HISTORY + AssertTrueIsDisplayed(propertyDetailsSubdivisionTitle); + AssertTrueIsDisplayed(propertyDetailsSubdivisionNoneContent); + + //CONSOLIDATION HISTORY + AssertTrueIsDisplayed(propertyDetailsConsolidationTitle); + AssertTrueIsDisplayed(propertyDetailsConsolidationNoneContent); } public void VerifyPropertyDetailsEditForm() @@ -857,13 +924,6 @@ public void VerifyPropertyDetailsEditForm() AssertTrueIsDisplayed(propertyDetailsRoadEstablishInput); } - if (webDriver.FindElements(propertyDetailsAdjacentLandTypeLabel).Count() > 0) - { - AssertTrueIsDisplayed(propertyDetailsAdjacentLandTypeLabel); - AssertTrueIsDisplayed(propertyDetailsAdjacentLandInput); - } - - if (webDriver.FindElements(propertyDetailsFirstNationTitle).Count() > 0) { AssertTrueIsDisplayed(propertyDetailsFirstNationTitle); @@ -916,5 +976,30 @@ public int PropertyTabs() Wait(2000); return webDriver.FindElements(propertyInformationTabsTotal).Count(); } + + public void DeleteFirstHistoricalFile() + { + WaitUntilClickable(propertyAttributesHistoricalFile1stDeleteButton); + webDriver.FindElement(propertyAttributesHistoricalFile1stDeleteButton).Click(); + } + + private void AddHistoricalFile(HistoricalFile historicalFile) + { + WaitUntilClickable(propertyAttrAddHistoricalFileButton); + FocusAndClick(propertyAttrAddHistoricalFileButton); + + Wait(); + var historicalFileIndex = webDriver.FindElements(propertyAttrHistoricalFilesTotalCount).Count() -1; + + WaitUntilVisible(By.Id("input-historicalNumbers."+ historicalFileIndex +".historicalNumber")); + webDriver.FindElement(By.Id("input-historicalNumbers."+ historicalFileIndex +".historicalNumber")).SendKeys(historicalFile.HistoricalFileNumber); + + ChooseSpecificSelectOption(By.Id("input-historicalNumbers."+ historicalFileIndex +".historicalNumberType"), historicalFile.HistoricalFileType); + + if(historicalFile.HistoricalFileOtherDetails != "") + webDriver.FindElement(By.Id("input-historicalNumbers."+ historicalFileIndex +".otherHistoricalNumberType")).SendKeys(historicalFile.HistoricalFileOtherDetails); + + Wait(); + } } } diff --git a/testing/PIMS.Tests.Automation/PageObjects/ResearchFiles.cs b/testing/PIMS.Tests.Automation/PageObjects/ResearchFiles.cs index 7eb272e6cc..5dd1dc4aeb 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/ResearchFiles.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/ResearchFiles.cs @@ -62,7 +62,7 @@ public class ResearchFiles : PageObjectBase private By researchFileHeaderDistrictLabel = By.XPath("//label[contains(text(),'Ministry district')]"); private By researchFileHeaderDistrictContent = By.XPath("//label[contains(text(),'Ministry district')]/parent::strong/parent::div/following-sibling::div"); private By researchFileHistoricalFileLabel = By.XPath("//label[contains(text(),'Historical File')]"); - private By researchFileHistoricalFileContent = By.XPath("//label[contains(text(),'Historical File')]/parent::strong/parent::div/following-sibling::div/div"); + private By researchFileHistoricalFileContent = By.XPath("//label[contains(text(),'Historical File')]/parent::strong/parent::div/following-sibling::div/div/span"); private By researchFileHeaderCreatedLabel = By.XPath("//strong[contains(text(),'Created')]"); private By researchFileHeaderCreatedDateContent = By.XPath("//strong[contains(text(),'Created')]/parent::span"); private By researchFileHeaderCreatedByContent = By.XPath("//strong[contains(text(),'Created')]/parent::span/span[@data-testid='tooltip-icon-userNameTooltip']"); @@ -724,7 +724,7 @@ private void VerifyResearchFileHeader(ResearchFile researchFile, string user) AssertTrueIsDisplayed(researchFileHeaderDistrictLabel); AssertTrueIsDisplayed(researchFileHistoricalFileLabel); - //AssertTrueIsDisplayed(researchFileHistoricalFileContent); + Assert.True(webDriver.FindElements(researchFileHistoricalFileContent).Count > 0); AssertTrueIsDisplayed(researchFileHeaderCreatedLabel); AssertTrueElementContains(researchFileHeaderCreatedDateContent, GetTodayFormattedDate()); diff --git a/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs b/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs index aca2f13ec6..cfad1dbb7f 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/SearchProperties.cs @@ -39,7 +39,7 @@ public class SearchProperties : PageObjectBase private By searchPropertyListContent1stLocation = By.XPath("//div[@data-testid='propertiesTable']/form/div/div[1]/div/div[4]"); private By searchPropertyListContent1stLotSize = By.XPath("//div[@data-testid='propertiesTable']/form/div/div[1]/div/div[5]"); private By searchPropertyListContent1stOwnership = By.XPath("//div[@data-testid='propertiesTable']/form/div/div[1]/div/div[6]"); - private By searchPropertyListContent1stViewTabBttn = By.XPath("//div[@data-testid='propertiesTable']/form/div/div[1]/div/div[7]/div/button[@data-testid='view-prop-tab']"); + private By searchPropertyListContent1stViewTabBttn = By.CssSelector("div[data-testid='propertiesTable'] div[class='tbody'] div[class='tr-wrapper']:first-child button[data-testid='view-prop-tab']"); private By searchPropertyListContent1stViewWindowBttn = By.XPath("//div[@data-testid='propertiesTable']/form/div/div[1]/div/div[7]/div/button[@data-testid='view-prop-ext']"); private By searchPropertyListPaginationMenu = By.CssSelector("div[class='Menu-root']"); private By searchPropertyListPaginationMenuBttn = By.CssSelector("div[class='Menu-button']"); diff --git a/testing/PIMS.Tests.Automation/PageObjects/SubdivisionConsolidationProperties.cs b/testing/PIMS.Tests.Automation/PageObjects/SubdivisionConsolidationProperties.cs index 76ece89891..f582e41076 100644 --- a/testing/PIMS.Tests.Automation/PageObjects/SubdivisionConsolidationProperties.cs +++ b/testing/PIMS.Tests.Automation/PageObjects/SubdivisionConsolidationProperties.cs @@ -108,7 +108,6 @@ public class SubdivisionConsolidationProperties : PageObjectBase private By subconTableContent = By.XPath("//div[@data-testid='propertyOperationTable']/div[@class='tbody']/div[@class='tr-wrapper']"); - private SharedModals sharedModals; public SubdivisionConsolidationProperties(IWebDriver webDriver) : base(webDriver) diff --git a/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs b/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs index cdb67b4c09..c3c61064c5 100644 --- a/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs +++ b/testing/PIMS.Tests.Automation/StepDefinitions/PropertiesSteps.cs @@ -90,8 +90,8 @@ public void SearchInvalidPropertyOnMap(int rowNumber) } - [StepDefinition(@"I review a Property's Information")] - public void ReviewPropertyInformation() + [StepDefinition(@"I review a Property's Information from row number (.*)")] + public void ReviewPropertyInformation(int rowNumber) { /* TEST COVERAGE: PSP-1558, PSP-3153, PSP-3184, PSP-3589, PSP-4903, PSP-5163 */ @@ -99,20 +99,21 @@ public void ReviewPropertyInformation() loginSteps.Idir(userName); //Navigate to the Inventory List View + PopulateProperty(rowNumber); searchProperties.NavigatePropertyListView(); + //Search for a property + searchProperties.SearchPropertyByPINPID(property.PID); + //Select the first property from the list searchProperties.ChooseFirstPropertyFromList(); - //Validate Property Information Header - propertyInformation.VerifyPropertyInformationHeader(); - //Validate Title Tab propertyInformation.NavigatePropertyTitleTab(); - propertyInformation.VerifyTitleTab(); + //propertyInformation.VerifyTitleTab(); - //Validate Tab - //propertyInformation.NavigatePropertyValueTab(); + //Validate Value Tab + propertyInformation.NavigatePropertyValueTab(); //propertyInformation.VerifyValueTab(); //Validate the Property Details View @@ -122,7 +123,7 @@ public void ReviewPropertyInformation() } [StepDefinition(@"I search for a Property in the Properties List by different filters from row number (.*)")] - public void ReviewPropertyInformation(int rowNumber) + public void ReviewPropertyInformationList(int rowNumber) { /* TEST COVERAGE: PSP-1558, PSP-3153, PSP-3184, PSP-3589, PSP-4903, PSP-4905, PSP-5163, PSP-7815 */ @@ -249,13 +250,12 @@ public void InventoryProperty(int rowNumber) searchProperties.SelectFoundPin(); } - [StepDefinition(@"I update a Property details from row number (.*)")] - public void EditPropertyInformationDetails(int rowNumber) + [StepDefinition(@"I update a Property details")] + public void EditPropertyInformationDetails() { /* TEST COVERAGE: PSP-3460, PSP-3462, PSP-3590, PSP-3591, PSP-3599, PSP-3600, PSP-3612, PSP-3722, PSP-4791, PSP-4794, PSP-5162, PSP-5163, PSP-5164, PSP-5165 */ //Click on the Edit Property Information Button - PopulateProperty(rowNumber); propertyInformation.EditPropertyInfoBttn(); //Verify Property Information Edit Form @@ -275,11 +275,6 @@ public void EditPropertyInformationDetails(int rowNumber) //Save changes propertyInformation.SavePropertyDetails(); - - //Verify changes - propertyInformation.NavigatePropertyDetailsTab(); - propertyInformation.VerifyPropertyDetailsView(); - } [StepDefinition(@"I insert information in the Property Management Tab from row number (.*)")] @@ -433,7 +428,9 @@ public void NonPropertyFound() public void PropertyInfoSucess() { //Validate Property Information View Form after changes - propertyInformation.VerifyPropertyDetailsView(); + propertyInformation.NavigatePropertyDetailsTab(); + propertyInformation.VerifyPropertyInformationHeader(true); + propertyInformation.VerifyUpdatePropertyDetailsView(property); propertyInformation.Dispose(); } @@ -480,31 +477,55 @@ private void PopulateProperty(int rowNumber) property = new Property(); + property.PID = ExcelDataContext.ReadData(rowNumber, "PropertyPID"); + property.PlanNumber = ExcelDataContext.ReadData(rowNumber, "PropertyPlanNumber"); property.PropertyName = ExcelDataContext.ReadData(rowNumber, "PropertyName"); - property.Address.AddressLine1 = ExcelDataContext.ReadData(rowNumber, "AddressLine1"); - property.Address.AddressLine2 = ExcelDataContext.ReadData(rowNumber, "AddressLine2"); - property.Address.AddressLine3 = ExcelDataContext.ReadData(rowNumber, "AddressLine3"); - property.Address.City = ExcelDataContext.ReadData(rowNumber, "City"); - property.Address.PostalCode = ExcelDataContext.ReadData(rowNumber, "PostalCode"); - - property.MOTIRegion = ExcelDataContext.ReadData(rowNumber, "MoTIRegion"); - property.HighwaysDistrict = ExcelDataContext.ReadData(rowNumber, "HighwaysDistrict"); - property.ElectoralDistrict = ExcelDataContext.ReadData(rowNumber, "ElectoralDistrict"); - property.AgriculturalLandReserve = ExcelDataContext.ReadData(rowNumber, "AgriculturalLandReserve"); - property.RailwayBelt = ExcelDataContext.ReadData(rowNumber, "RailwayBelt"); - property.LandParcelType = ExcelDataContext.ReadData(rowNumber, "LandParcelType"); - property.MunicipalZoning = ExcelDataContext.ReadData(rowNumber, "MunicipalZoning"); - property.Anomalies = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "Anomalies")); - - property.TenureStatus = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "TenureStatus")); - property.ProvincialPublicHwy = ExcelDataContext.ReadData(rowNumber, "ProvincialPublicHwy"); - property.HighwayEstablishedBy = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "HighwayEstablishedBy")); - property.AdjacentLandType = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "AdjacentLandType")); - property.SqrMeters = ExcelDataContext.ReadData(rowNumber, "SqrMeters"); - property.IsVolumetric = bool.Parse(ExcelDataContext.ReadData(rowNumber, "IsVolumetric")); - property.Volume = ExcelDataContext.ReadData(rowNumber, "Volume"); - property.VolumeType = ExcelDataContext.ReadData(rowNumber, "VolumeType"); - property.PropertyNotes = ExcelDataContext.ReadData(rowNumber, "Notes"); + property.Address.AddressLine1 = ExcelDataContext.ReadData(rowNumber, "PropertyAddressLine1"); + property.Address.AddressLine2 = ExcelDataContext.ReadData(rowNumber, "PropertyAddressLine2"); + property.Address.AddressLine3 = ExcelDataContext.ReadData(rowNumber, "PropertyAddressLine3"); + property.Address.City = ExcelDataContext.ReadData(rowNumber, "PropertyCity"); + property.Address.PostalCode = ExcelDataContext.ReadData(rowNumber, "PropertyPostalCode"); + property.GeneralLocation = ExcelDataContext.ReadData(rowNumber, "PropertyGeneralLocation"); + + property.HistoricalFileStartRow = int.Parse(ExcelDataContext.ReadData(rowNumber, "PropertyHistoricalFileStartRow")); + property.HistoricalFileCount = int.Parse(ExcelDataContext.ReadData(rowNumber, "PropertyHistoricalFileCount")); + if (property.HistoricalFileStartRow != 0 && property.HistoricalFileCount != 0) + PopulateHistoricalFiles(property.HistoricalFileStartRow, property.HistoricalFileCount); + + property.LegalDescription = ExcelDataContext.ReadData(rowNumber, "PropertyLegalDescription"); + property.MOTIRegion = ExcelDataContext.ReadData(rowNumber, "PropertyMoTIRegion"); + property.HighwaysDistrict = ExcelDataContext.ReadData(rowNumber, "PropertyHighwaysDistrict"); + property.ElectoralDistrict = ExcelDataContext.ReadData(rowNumber, "PropertyElectoralDistrict"); + property.AgriculturalLandReserve = ExcelDataContext.ReadData(rowNumber, "PropertyAgriculturalLandReserve"); + property.RailwayBelt = ExcelDataContext.ReadData(rowNumber, "PropertyRailwayBelt"); + property.LandParcelType = ExcelDataContext.ReadData(rowNumber, "PropertyLandParcelType"); + property.MunicipalZoning = ExcelDataContext.ReadData(rowNumber, "PropertyMunicipalZoning"); + property.Anomalies = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "PropertyAnomalies")); + + property.TenureStatus = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "PropertyTenureStatus")); + property.ProvincialPublicHwy = ExcelDataContext.ReadData(rowNumber, "PropertyProvincialPublicHwy"); + property.HighwayEstablishedBy = genericSteps.PopulateLists(ExcelDataContext.ReadData(rowNumber, "PropertyHighwayEstablishedBy")); + property.SqrMeters = ExcelDataContext.ReadData(rowNumber, "PropertySqrMeters"); + property.IsVolumetric = bool.Parse(ExcelDataContext.ReadData(rowNumber, "PropertyIsVolumetric")); + property.Volume = ExcelDataContext.ReadData(rowNumber, "PropertyVolume"); + property.VolumeType = ExcelDataContext.ReadData(rowNumber, "PropertyVolumeType"); + property.PropertyNotes = ExcelDataContext.ReadData(rowNumber, "PropertyNotes"); + } + + private void PopulateHistoricalFiles(int startRow, int rowsCount) + { + DataTable propertyHistoricalFilesSheet = ExcelDataContext.GetInstance().Sheets["PropertiesHistoricalFile"]!; + ExcelDataContext.PopulateInCollection(propertyHistoricalFilesSheet); + + for (int i = startRow; i < startRow + rowsCount; i++) + { + HistoricalFile historicalFile = new HistoricalFile(); + historicalFile.HistoricalFileNumber = ExcelDataContext.ReadData(i, "PropertyHistoricalFileNumber"); + historicalFile.HistoricalFileType = ExcelDataContext.ReadData(i, "PropertyHistoricalFileType"); + historicalFile.HistoricalFileOtherDetails = ExcelDataContext.ReadData(i, "PropertyHistoricalFileOtherDetails"); + + property.PropertyHistoricalFiles.Add(historicalFile); + } } private void PopulateSearchProperty(int rowNumber)