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-9565: Changes on automation test set to accomodate GHA #4516

Merged
merged 20 commits into from
Dec 5, 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
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.
28 changes: 14 additions & 14 deletions testing/PIMS.Tests.Automation/Features/SmokeTest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ Scenario: 11. Acquisition File Agreements Tab
When I create Agreements within an Acquisition File
Then A new Acquisition file is created successfully

#Scenario: 12. Acquisition File Compensation Tab
# Given I create a new Acquisition File from row number 18
# When I add additional information to the Acquisition File Details
# And I add Properties to the Acquisition File
# And I create Stakeholders within an Acquisition File
# And I create Compensation Requisition within an Acquisition File
# Then A new Acquisition file is created successfully

#Scenario: 13. Disposition Checklist Tab
# Given I create a new Disposition File from row number 1
# When I insert Checklist information to an Disposition File
# Then Disposition File's Checklist has been saved successfully

Scenario: 12. Disposition Offers and Sale Tab
Scenario: 12. Acquisition File Compensation Tab
Given I create a new Acquisition File from row number 18
When I add additional information to the Acquisition File Details
And I add Properties to the Acquisition File
And I create Stakeholders within an Acquisition File
And I create Compensation Requisition within an Acquisition File
Then A new Acquisition file is created successfully

Scenario: 13. Disposition Checklist Tab
Given I create a new Disposition File from row number 1
When I insert Checklist information to an Disposition File
Then Disposition File's Checklist has been saved successfully

Scenario: 14. Disposition Offers and Sale Tab
Given I create a new Disposition File from row number 1
When I create Appraisal, Assessment, Offers and Sales Details within a Disposition File
Then A new Disposition file is created successfully
Expand Down
79 changes: 75 additions & 4 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.

2 changes: 1 addition & 1 deletion testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>484766ab-9711-4242-858c-ae7c826b3074</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class AcquisitionChecklist : PageObjectBase
{
private By checklistLinkTab = By.XPath("//a[contains(text(),'Checklist')]");

private By checklistEditBttn = By.CssSelector("button[title='Edit checklist']");
private By checklistEditBttn = By.XPath("//body/div[@id='root']/div[2]/div[2]/div[1]/div[1]/div[1]/div[3]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/button[@title='Edit checklist']");
private By checklistInfo = By.XPath("//div/em[contains(text(),'This checklist was last updated')]");

//Checklist View Elements
Expand Down
10 changes: 7 additions & 3 deletions testing/PIMS.Tests.Automation/PageObjects/AcquisitionDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace PIMS.Tests.Automation.PageObjects
public class AcquisitionDetails : PageObjectBase
{
//Acquisition Files Menu Elements
private readonly By menuAcquisitionButton = By.CssSelector("div[data-testid='nav-tooltip-acquisition'] a");
private readonly By menuAcquisitionButton = By.XPath("//body/div[@id='root']/div[2]/div[1]/div[1]/div[@data-testid='nav-tooltip-acquisition']/a");
private readonly By createAcquisitionFileButton = By.XPath("//a[contains(text(),'Create an Acquisition File')]");

private readonly By acquisitionFileSummaryBttn = By.CssSelector("div[data-testid='menu-item-row-0'] div button[title='File Details']");
Expand Down Expand Up @@ -42,6 +42,7 @@ public class AcquisitionDetails : PageObjectBase
private By acquisitionFileProjectContent = By.XPath("//div[@class='collapse show']/div/div/label[contains(text(),'Ministry project')]/parent::div/following-sibling::div");
private By acquisitionFileProjectProductLabel = By.XPath("//label[contains(text(),'Product')]");
private By acquisitionFileProjectProductSelect = By.Id("input-product");
private By acquicistionFileProjectProductOptions = By.CssSelector("select[id='input-product'] option");
private By acquisitionFileProjectProductContent = By.XPath("//label[contains(text(),'Product')]/parent::div/following-sibling::div");
private By acquisitionFileProjectFundingLabel = By.XPath("//label[contains(text(),'Funding')]");
private By acquisitionFileProjectFundingInput = By.Id("input-fundingTypeCode");
Expand Down Expand Up @@ -140,8 +141,9 @@ public void NavigateToCreateNewAcquisitionFile()

public void NavigateToFileSummary()
{
WaitUntilVisible(acquisitionFileSummaryBttn);
FocusAndClick(acquisitionFileSummaryBttn);
Wait();
if (webDriver.FindElements(acquisitionFileSummaryBttn).Count() > 0)
FocusAndClick(acquisitionFileSummaryBttn);
}

public void NavigateToFileDetailsTab()
Expand Down Expand Up @@ -193,6 +195,8 @@ public void UpdateAcquisitionFile(AcquisitionFile acquisition)
{
WaitUntilClickable(acquisitionFileProjectProductSelect);
webDriver.FindElement(acquisitionFileProjectProductSelect).Click();

Wait(2000);
ChooseSpecificSelectOption(acquisitionFileProjectProductSelect, acquisition.AcquisitionProjProductCode + " " + acquisition.AcquisitionProjProduct);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public void VerifyStakeholderInitEditForm()

public void VerifyInterestStakeholderViewForm(AcquisitionStakeholder interest)
{
Wait();
AssertTrueIsDisplayed(stakeholderInterestsSubtitle);
AssertTrueIsDisplayed(stakeholderInterestsEditBttn);
AssertTrueIsDisplayed(stakeholderInterestTable);
Expand Down
2 changes: 1 addition & 1 deletion testing/PIMS.Tests.Automation/PageObjects/Contacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace PIMS.Tests.Automation.PageObjects
public class Contacts : PageObjectBase
{
//Contact Menu Elements
private By menuContactsLink = By.CssSelector("div[data-testid='nav-tooltip-contacts'] a");
private By menuContactsLink = By.XPath("//body/div[@id='root']/div[2]/div[1]/div[1]/div[@data-testid='nav-tooltip-contacts']/a");
private By createContactLink = By.XPath("//a[contains(text(),'Add a Contact')]");
private By createContactButton = By.XPath("//div[contains(text(),'Add new contact')]/parent::button");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace PIMS.Tests.Automation.PageObjects
public class DispositionFileDetails : PageObjectBase
{
//Disposition Files Menu Elements
private By menuDispositionButton = By.CssSelector("div[data-testid='nav-tooltip-disposition'] a");
private By menuDispositionButton = By.XPath("//body/div[@id='root']/div[2]/div[1]/div[1]/div[@data-testid='nav-tooltip-disposition']/a");
private By createDispositionFileButton = By.XPath("//a[contains(text(),'Create a Disposition File')]");

private By dispositionFileSummaryBttn = By.XPath("//div[contains(text(),'File Summary')]");
Expand Down
2 changes: 1 addition & 1 deletion testing/PIMS.Tests.Automation/PageObjects/LeaseDeposits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void AddNotes(string notes)

public void DeleteFirstReturn()
{
WaitUntilClickable(licenseDepositReturn1stRowDeleteBttn);
Wait();
FocusAndClick(licenseDepositReturn1stRowDeleteBttn);

WaitUntilVisible(licenseDepositModal);
Expand Down
3 changes: 2 additions & 1 deletion testing/PIMS.Tests.Automation/PageObjects/LeaseDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace PIMS.Tests.Automation.PageObjects
public class LeaseDetails : PageObjectBase
{
//Main Menu links Elements
private readonly By menuManagementButton = By.CssSelector("div[data-testid='nav-tooltip-leases&licences'] a");
private readonly By menuManagementButton = By.XPath("//body/div[@id='root']/div[2]/div[1]/div[1]/div[@data-testid='nav-tooltip-leases&licences']/a");
private readonly By createLicenseButton = By.XPath("//a[contains(text(),'Create a Lease/Licence File')]");

//File Details Edit Icon
Expand Down Expand Up @@ -273,6 +273,7 @@ public void CreateMinimumLicenseDetails(Lease lease)
{
foreach (string purpose in lease.LeasePurpose)
{
webDriver.FindElement(licenseDetailsPurposeLabel).Click();
FocusAndClick(licenseDetailsPurposeMultiselector);

Wait(5000);
Expand Down
3 changes: 2 additions & 1 deletion testing/PIMS.Tests.Automation/PageObjects/ResearchFiles.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using OpenQA.Selenium;
using PIMS.Tests.Automation.Classes;
using System.ComponentModel;

namespace PIMS.Tests.Automation.PageObjects
{
public class ResearchFiles : PageObjectBase
{
//Research File Menu options
private readonly By menuResearchButton = By.CssSelector("div[data-testid='nav-tooltip-research'] a");
private readonly By menuResearchButton = By.XPath("//body/div[@id='root']/div[2]/div[1]/div[1]/div[@data-testid='nav-tooltip-research']/a");
private readonly By createResearchFileButton = By.XPath("//a[contains(text(),'Create a Research File')]");

//File Details Tab Element
Expand Down
Loading