-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed AddSubsidiaryPlatform test
- Loading branch information
Rick Anderson
authored and
Rick Anderson
committed
Oct 30, 2024
1 parent
cde00ea
commit 220168c
Showing
11 changed files
with
220 additions
and
13 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Test/UITest/SpecFlowProjectBDD/Features/AddSubsidiaryPlatform.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Test/UITest/SpecFlowProjectBDD/Features/AddSubsidiaryPlatform.feature.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Test/UITest/SpecFlowProjectBDD/Utilities/StringUtilities.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SpecFlowProjectBDD.Utilities; | ||
public class StrUtilities | ||
{ | ||
public string GenerateRandomString(int length) | ||
{ | ||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | ||
var random = new Random(); | ||
return new string(Enumerable.Repeat(chars, length) | ||
.Select(s => s[random.Next(s.Length)]) | ||
.ToArray()); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
Test/UITest/TestFrameWork/Models/AddNewPlatformPageModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using OpenQA.Selenium; | ||
|
||
namespace UITest.Models | ||
{ | ||
public class AddNewPlatformPageModel | ||
{ | ||
|
||
|
||
public static string PlatformNameTextBox { get => "organizationNm"; } | ||
public static string PlatformCodeTextBox { get => "organizationCd"; } | ||
public static string EmailForNonComplianceNoticesTextBox { get => "primaryNoticeOfTakedownContactEmail"; } | ||
public static string EmailForTakedownRequestLettersTextBox { get => "primaryTakedownRequestContactEmail"; } | ||
public static string SecondaryEmailForNonComplianceNoticesTextBox {get => "secondaryNoticeOfTakedownContactEmail"; } | ||
public static string SecondaryEmailForTakedownRequest { get => "secondaryTakedownRequestContactEmail"; } | ||
public static string SaveButton { get => "body > app-root > app-layout > div.content > app-add-sub-platform > div.actions.ng-star-inserted > button:nth-child(1)"; } | ||
public static string CancelButton { get => "body > app-root > app-layout > div.content > app-add-sub-platform > div.actions.ng-star-inserted > button.p-element.p-button-transparent.p-button.p-component"; } | ||
|
||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Test/UITest/TestFrameWork/Models/DetailedPlatformContactInformationPageModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace UITest.Models | ||
{ | ||
public class DetailedPlatformContactInformationPageModel | ||
{ | ||
public static string AddSubsidiaryPlatformButton { get => "body > app-root > app-layout > div.content > app-view-platform > div.header > button"; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Test/UITest/TestFrameWork/Models/ManagePlatformsPageModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace UITest.Models | ||
{ | ||
public class ManagePlatformsPageModel | ||
{ | ||
|
||
public static string EditPlatformButton { get => "#platform-edit-0-icon"; } | ||
|
||
public static string ListingsTable { get => "listings-table"; } | ||
|
||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Test/UITest/TestFrameWork/PageObjects/AddNewPlatformPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using UITest.Models; | ||
using UITest.SeleniumObjects; | ||
using UITest.TestDriver; | ||
using UITest.TestObjectFramework; | ||
|
||
namespace UITest.PageObjects | ||
{ | ||
public class AddNewPlatformPage | ||
{ | ||
private IDriver _Driver; | ||
|
||
//No Valid URL since the URL must contain a unique and new platform number | ||
//private string _URL = @"http://127.0.0.1:4200/add-sub-platform/590"; | ||
|
||
private TextBox _PlatformNameTextBox; | ||
|
||
private TextBox _PlatformCodeTextBox; | ||
|
||
private TextBox _EmailForNonComplianceNoticesTextBox; | ||
private TextBox _EmailForTakedownRequestLettersTextBox; | ||
private TextBox _SecondaryEmailForNonComplianceNoticesTextBox; | ||
private TextBox _SecondaryEmailForTakedownRequest; | ||
private Button _CancelButton; | ||
private Button _SaveButton; | ||
|
||
public TextBox PlatformNameTextBox { get => _PlatformNameTextBox; } | ||
public TextBox PlatformCodeTextBox { get => _PlatformCodeTextBox; } | ||
public TextBox EmailForNonComplianceNoticesTextBox { get => _EmailForNonComplianceNoticesTextBox; } | ||
public TextBox EmailForTakedownRequestLettersTextBox { get => _EmailForTakedownRequestLettersTextBox; } | ||
public TextBox SecondaryEmailForNonComplianceNoticesTextBox { get => _SecondaryEmailForNonComplianceNoticesTextBox; } | ||
public TextBox SecondaryEmailForTakedownRequest { get => _SecondaryEmailForTakedownRequest; } | ||
public Button SaveButton { get => _SaveButton; } | ||
public Button CancelButton { get => _CancelButton; } | ||
//public string URL { get => _URL; set => _URL = value; } | ||
public IDriver Driver { get => _Driver; } | ||
|
||
public AddNewPlatformPage(IDriver Driver) | ||
{ | ||
_Driver = Driver; | ||
|
||
_PlatformNameTextBox = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.PlatformNameTextBox); | ||
_PlatformCodeTextBox = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.PlatformCodeTextBox); | ||
_EmailForNonComplianceNoticesTextBox = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.EmailForNonComplianceNoticesTextBox); | ||
_EmailForTakedownRequestLettersTextBox = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.EmailForTakedownRequestLettersTextBox); | ||
_SecondaryEmailForNonComplianceNoticesTextBox = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.SecondaryEmailForNonComplianceNoticesTextBox); | ||
_SecondaryEmailForTakedownRequest = new TextBox(Driver, Enums.FINDBY.ID, AddNewPlatformPageModel.SecondaryEmailForTakedownRequest); | ||
_SaveButton = new Button(Driver, Enums.FINDBY.CSSSELECTOR, AddNewPlatformPageModel.SaveButton); | ||
_CancelButton = new Button(Driver, Enums.FINDBY.CSSSELECTOR, AddNewPlatformPageModel.CancelButton); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Test/UITest/TestFrameWork/PageObjects/DetailedPlatformContactInformationPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using UITest.Models; | ||
using UITest.SeleniumObjects; | ||
using UITest.TestDriver; | ||
using UITest.TestObjectFramework; | ||
|
||
namespace UITest.PageObjects | ||
{ | ||
public class DetailedPlatformContactInformationPage | ||
{ | ||
private IDriver _Driver; | ||
|
||
private string _URL = @"http://127.0.0.1:4200/platform/590"; | ||
|
||
private Button _AddSubsidiaryPlatformButton; | ||
|
||
|
||
public string URL { get => _URL; set => _URL = value; } | ||
|
||
public Button AddSubsidiaryPlatformButton { get => _AddSubsidiaryPlatformButton; set => _AddSubsidiaryPlatformButton = value; } | ||
|
||
|
||
public IDriver Driver { get => _Driver; } | ||
|
||
public DetailedPlatformContactInformationPage(IDriver Driver) | ||
{ | ||
_Driver = Driver; | ||
|
||
_AddSubsidiaryPlatformButton = new Button(Driver, Enums.FINDBY.CSSSELECTOR, DetailedPlatformContactInformationPageModel.AddSubsidiaryPlatformButton); | ||
|
||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Test/UITest/TestFrameWork/PageObjects/ManagePlatformsPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using UITest.Models; | ||
using UITest.SeleniumObjects; | ||
using UITest.TestDriver; | ||
using UITest.TestObjectFramework; | ||
|
||
namespace UITest.PageObjects | ||
{ | ||
public class ManagePlatformsPage | ||
{ | ||
private IDriver _Driver; | ||
|
||
private string _URL = @"http://127.0.0.1:4200/platform-management"; | ||
|
||
private Button _EditPlatformButton; | ||
|
||
private Table _ListingsTable; | ||
|
||
public string URL { get => _URL; set => _URL = value; } | ||
|
||
|
||
public Button EditPlatformButton { get => _EditPlatformButton; set => _EditPlatformButton = value; } | ||
|
||
public Table ListingsTable { get => _ListingsTable; } | ||
public IDriver Driver { get => _Driver; } | ||
|
||
public ManagePlatformsPage(IDriver Driver) | ||
{ | ||
_Driver = Driver; | ||
|
||
_EditPlatformButton = new Button(Driver, Enums.FINDBY.CSSSELECTOR, ManagePlatformsPageModel.EditPlatformButton); | ||
|
||
_ListingsTable = new Table(Driver, Enums.FINDBY.ID, ManagePlatformsPageModel.ListingsTable); | ||
} | ||
} | ||
} |