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

Automation test - Stabilization of some automated features #3285

Merged
merged 27 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9b03bf4
Automation Projects
stairaku Mar 29, 2023
15afced
Automation - Projects and Products automation
stairaku Mar 31, 2023
32ea3f8
Merge branch 'bcgov:dev' into test-branch
stairaku Apr 6, 2023
e1d67d1
Merge branch 'bcgov:dev' into test-branch
stairaku Apr 21, 2023
10dbf55
Merge branch 'bcgov:dev' into test-branch
stairaku Apr 25, 2023
792c8d2
Merge branch 'bcgov:dev' into test-branch
stairaku May 3, 2023
86636d0
Merge branch 'bcgov:dev' into test-branch
stairaku May 5, 2023
8a172d1
Merge branch 'bcgov:dev' into test-branch
stairaku May 10, 2023
793ef7f
Leases refactoring
stairaku May 12, 2023
6c7230d
Leases refactoring
stairaku May 17, 2023
cf7a74b
Merge branch 'bcgov:dev' into test-branch
stairaku May 17, 2023
8adb07d
Merge branch 'bcgov:dev' into test-branch
stairaku May 23, 2023
fb07bc5
Lease License automation refactoring
stairaku May 23, 2023
c518abe
Merge branch 'test-branch' of https://github.com/stairaku/PSP into te…
stairaku May 23, 2023
9dde5e1
Merge branch 'dev' into test-branch
stairaku May 23, 2023
78363d1
Merge branch 'bcgov:dev' into test-branch
stairaku May 26, 2023
6f774bc
Acquisition Files refactoring
stairaku May 26, 2023
0321751
Merge branch 'test-branch' of https://github.com/stairaku/PSP into te…
stairaku May 26, 2023
ac2e201
Merge branch 'bcgov:dev' into test-branch
stairaku Jun 1, 2023
25c8ac0
Automation fixes
stairaku Jun 1, 2023
3011e1c
Merge branch 'test-branch' of https://github.com/stairaku/PSP into te…
stairaku Jun 1, 2023
a2b56a4
Merge branch 'dev' into test-branch
stairaku Jun 1, 2023
67d12ba
Merge branch 'dev' into test-branch
devinleighsmith Jun 3, 2023
cfc8817
Merge branch 'dev' into test-branch
devinleighsmith Jun 5, 2023
4659d65
Automation - stabilization of some automation features
stairaku Jun 22, 2023
9aa649c
Merge branch 'bcgov:dev' into test-branch
stairaku Jun 22, 2023
f7f65c4
Merge branch 'test-branch' of https://github.com/stairaku/PSP into te…
stairaku Jun 22, 2023
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
4 changes: 2 additions & 2 deletions testing/PIMS.Tests.Automation/Classes/AcquisitionFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ public class AcquisitionFile
public string? AcquisitionProjProduct { get; set; } = String.Empty;
public string? AcquisitionProjFunding { get; set; } = String.Empty;
public string? AcquisitionFundingOther { get; set; } = String.Empty;

public string? AssignedDate { get; set; } = String.Empty;
public string? DeliveryDate { get; set; } = String.Empty;
public string? AcquisitionCompletedDate { get; set; } = String.Empty;
public string AcquisitionFileName { get; set; } = null!;
public string? HistoricalFileNumber { get; set; } = String.Empty;
public string? PhysicalFileStatus { get; set; } = String.Empty;
public string AcquisitionType { get; set; } = null!;
public string MOTIRegion { get; set; } = null!;
public string AcquisitionMOTIRegion { get; set; } = null!;
public int AcquisitionTeamStartRow { get; set; } = 0;
public int AcquisitionTeamCount { get; set; } = 0;
public List<AcquisitionTeamMember>? AcquisitionTeam { get; set; } = new List<AcquisitionTeamMember>();
Expand Down
56 changes: 48 additions & 8 deletions testing/PIMS.Tests.Automation/Classes/Contact.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

namespace PIMS.Tests.Automation.Classes
{
public class Contact
public class OrganizationContact
{
public string OrganizationName { get; set; } = null!;
public string? Alias { get; set; } = String.Empty;
public string? IncorporationNumber { get; set; } = String.Empty;
public string ContactStatus { get; set; } = null!;
public string? Email1 { get; set; } = String.Empty;
public string? EmailType1 { get; set; } = String.Empty;
Expand Down Expand Up @@ -45,21 +48,58 @@ public class Contact
public string? BillingOtherCountry { get; set; } = String.Empty;
public string? BillingPostalCode { get; set; } = String.Empty;
public string? Comments { get; set; } = String.Empty;
}
public class OrganizationContact: Contact
{
public string OrganizationName { get; set; } = null!;
public string? Alias { get; set; } = String.Empty;
public string? IncorporationNumber { get; set; } = String.Empty;

}

public class IndividualContact : Contact
public class IndividualContact
{
public string FirstName { get; set; } = null!;
public string? MiddleName { get; set; } = String.Empty;
public string LastName { get; set; } = null!;
public string FullName { get; set; } = null!;
public string? PreferableName { get; set; } = String.Empty;
public string? Organization { get; set; } = String.Empty;
public string ContactStatus { get; set; } = null!;
public string? Email1 { get; set; } = String.Empty;
public string? EmailType1 { get; set; } = String.Empty;
public string? EmailTypeDisplay1 { get; set; } = String.Empty;
public string? Email2 { get; set; } = String.Empty;
public string? EmailType2 { get; set; } = String.Empty;
public string? EmailTypeDisplay2 { get; set; } = String.Empty;
public string? Phone1 { get; set; } = String.Empty;
public string? PhoneType1 { get; set; } = String.Empty;
public string? PhoneTypeDisplay1 { get; set; } = String.Empty;
public string? Phone2 { get; set; } = String.Empty;
public string? PhoneType2 { get; set; } = String.Empty;
public string? PhoneTypeDisplay2 { get; set; } = String.Empty;
public string? MailAddressLine1 { get; set; } = String.Empty;
public string? MailAddressLine2 { get; set; } = String.Empty;
public string? MailAddressLine3 { get; set; } = String.Empty;
public string? MailCity { get; set; } = String.Empty;
public string? MailProvince { get; set; } = String.Empty;
public string? MailProvDisplay { get; set; } = String.Empty;
public string? MailCityProvinceView { get; set; } = String.Empty;
public string? MailCountry { get; set; } = String.Empty;
public string? MailOtherCountry { get; set; } = String.Empty;
public string? MailPostalCode { get; set; } = String.Empty;
public string? PropertyAddressLine1 { get; set; } = String.Empty;
public string? PropertyAddressLine2 { get; set; } = String.Empty;
public string? PropertyAddressLine3 { get; set; } = String.Empty;
public string? PropertyCity { get; set; } = String.Empty;
public string? PropertyProvince { get; set; } = String.Empty;
public string? PropertyCityProvinceView { get; set; } = String.Empty;
public string? PropertyCountry { get; set; } = String.Empty;
public string? PropertyOtherCountry { get; set; } = String.Empty;
public string? PropertyPostalCode { get; set; } = String.Empty;
public string? BillingAddressLine1 { get; set; } = String.Empty;
public string? BillingAddressLine2 { get; set; } = String.Empty;
public string? BillingAddressLine3 { get; set; } = String.Empty;
public string? BillingCity { get; set; } = String.Empty;
public string? BillingProvince { get; set; } = String.Empty;
public string? BillingCityProvinceView { get; set; } = String.Empty;
public string? BillingCountry { get; set; } = String.Empty;
public string? BillingOtherCountry { get; set; } = String.Empty;
public string? BillingPostalCode { get; set; } = String.Empty;
public string? Comments { get; set; } = String.Empty;
}
}
Binary file modified testing/PIMS.Tests.Automation/Data/PIMS_Testing_Data.xlsx
Binary file not shown.
13 changes: 5 additions & 8 deletions testing/PIMS.Tests.Automation/Drivers/BrowserDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ public class BrowserDriver : IDisposable
{
private readonly Lazy<IWebDriver> currentWebDriverLazy;
private readonly Lazy<IConfiguration> configurationLazy;
//private bool _isDisposed;
private readonly bool closeBrowserOnDispose;
private readonly bool runAutomationHeadless;

public BrowserDriver()
{

System.Diagnostics.Debug.WriteLine(Environment.GetEnvironmentVariable("BASE_URL"));
currentWebDriverLazy = new Lazy<IWebDriver>(CreateEdgeWebDriver);
configurationLazy = new Lazy<IConfiguration>(ReadConfiguration);
closeBrowserOnDispose = Configuration.GetValue("CloseBrowserAfterEachTest", true);
Expand All @@ -39,6 +40,7 @@ private IWebDriver CreateChromeWebDriver()

var chromeDriver = new ChromeDriver(ChromeDriverService.CreateDefaultService(), options);
chromeDriver.Url = Configuration.GetValue<string>("baseUrl");
//chromeDriver.Url = Environment.GetEnvironmentVariable("BASE_URL");

return chromeDriver;
}
Expand All @@ -57,6 +59,8 @@ private IWebDriver CreateEdgeWebDriver()

var edgeDriver = new EdgeDriver(EdgeDriverService.CreateDefaultService(), options);
edgeDriver.Url = Configuration.GetValue<string>("baseUrl");
//var baseUrl = Environment.GetEnvironmentVariable("BASE_URL");
//edgeDriver.Url = baseUrl;

return edgeDriver;
}
Expand All @@ -68,17 +72,10 @@ private IConfiguration ReadConfiguration() =>

public void Dispose()
{
//if (_isDisposed)
//{
// return;
//}

if (currentWebDriverLazy.IsValueCreated && closeBrowserOnDispose)
{
Current.Quit();
}

//_isDisposed = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Scenario: Create a new complete Acquisition File with pins

Scenario: Edit existing Acquisition File and Properties
Given I edit an existing Acquisition File from row number 2
When I edit a Digital Document for a "Acquisition File" from row number 7
And I update a Property details from row number 4
When I update a Property details from row number 4
And I navigate back to the Acquisition File Summary
And I edit a Digital Document for a "Acquisition File" from row number 7
Then An existing Acquisition file has been edited successfully

Scenario: Create an Acquisition File from Pin
Expand Down

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

8 changes: 5 additions & 3 deletions testing/PIMS.Tests.Automation/Features/Contacts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Scenario Outline: Create new Organization Complete Contact
Examples:
| ContactType | RowNumber |
| Organization | 1 |
| Organization | 3 |

Scenario Outline: Create new Individual Complete Contact
Given I create a new Individual Contact from row number <RowNumber>
Expand All @@ -19,25 +20,26 @@ Scenario Outline: Create new Individual Complete Contact
| ContactType | RowNumber |
| Individual | 1 |
| Individual | 2 |
| Individual | 4 |

Scenario: Cancel creating a new contact
Given I cancel creating a new contact from row number 2
Then Search Contacts screen is correctly rendered

Scenario: Update an Existing Organization Contact
Given I update an existing Organization Contact from row number 3
Given I update an existing Organization Contact from row number 4
Then An Organization contact is successfully updated

Scenario: Update an Existing Individual Contact
Given I update an existing Individual Contact from row number 4
Given I update an existing Individual Contact from row number 5
Then An Individual contact is successfully updated

Scenario Outline: Search for a non-existing Contact
Given I search for an non-existing contact from type "<ContactType>" row number <RowNumber>
Then No contacts results are found
Examples:
| ContactType | RowNumber |
| Individual | 5 |
| Individual | 6 |
| Organization | 4 |


Expand Down
40 changes: 21 additions & 19 deletions testing/PIMS.Tests.Automation/Features/Contacts.feature.cs

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

11 changes: 6 additions & 5 deletions testing/PIMS.Tests.Automation/Features/Projects.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Feature: Projects
Scenario Outline: Create new Projects
Given I create a new Project from row number <RowNumber>
When I verify The Project View Form
And I create Digital Documents for a "Project" row number <DocRowNumber>
And I search for an existing project
Then Expected Content is displayed on Projects Table
Examples:
| RowNumber |
| 1 |
| 2 |
| 3 |
| 4 |
| RowNumber | DocRowNumber |
| 1 | 8 |
| 2 | 9 |
| 3 | 10 |
| 4 | 11 |

Scenario: Update Project
Given I update an existing project from row number 5
Expand Down
Loading