-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add page component to PageObjectModels
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
Dfe.Data.SearchPrototype/Web/Tests/Integration/PageObjectModel/PageComponents/PageBody.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,15 @@ | ||
using AngleSharp.Dom; | ||
using Dfe.Data.SearchPrototype.Web.Tests.Integration.PageObjectModel.PageComponents; | ||
|
||
namespace DfE.Data.SearchPrototype.Web.Tests.Integration.PageObjectModel.PageComponents | ||
{ | ||
public sealed class PageBody : PageComponent | ||
{ | ||
private const string BodyElementTag = "body"; | ||
|
||
private PageBody(IDocument documentObjectModel) : base(documentObjectModel, BodyElementTag){ | ||
} | ||
|
||
public static PageBody Create(IDocument documentObjectModel) => new(documentObjectModel); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...a.SearchPrototype/Web/Tests/Integration/PageObjectModel/PageComponents/SearchComponent.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,33 @@ | ||
//using AngleSharp.Dom; | ||
//using AngleSharp.Html.Dom; | ||
//using Dfe.Data.SearchPrototype.Web.Tests.Integration.PageObjectModel.PageComponents; | ||
|
||
//namespace DfE.Data.SearchPrototype.Web.Tests.Integration.PageObjectModel.PageComponents | ||
//{ | ||
// public sealed class SearchComponent : PageComponent | ||
// { | ||
// private const string searchComponentContainer = "div"; | ||
|
||
// private SearchComponent(IDocument documentObjectModel) | ||
// : base(documentObjectModel, searchComponentContainer, isTagName: false) | ||
// { | ||
// } | ||
|
||
// public string GetSearchComponentContainer(string containerId) => | ||
// PageElement == null ? | ||
// throw new InvalidOperationException( | ||
// "Unable to derive the main heading in page.") : | ||
// PageElement | ||
// .GetElementsByTagName("div").GetElementById(containerId).InnerHtml; | ||
|
||
// public IHtmlAnchorElement GetHeaderLink(string linkName) => | ||
// PageElement == null ? | ||
// throw new InvalidOperationException( | ||
// $"Unable to derive the search link: {linkName} in page.") : | ||
// (IHtmlAnchorElement)PageElement | ||
// .GetElementsByTagName("a") | ||
// .Single(anchorTags => anchorTags.TextContent.Contains(linkName)); | ||
|
||
// public static SearchComponent Create(IDocument documentObjectModel) => new(documentObjectModel); | ||
// } | ||
//} |