Skip to content

Commit

Permalink
Removing deprecated .NET PageFactory code
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jan 19, 2016
1 parent bf10c23 commit 4e7489e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 292 deletions.
72 changes: 0 additions & 72 deletions dotnet/src/support/PageObjects/DefaultElementLocatorFactory.cs

This file was deleted.

57 changes: 0 additions & 57 deletions dotnet/src/support/PageObjects/IElementLocatorFactory.cs

This file was deleted.

53 changes: 0 additions & 53 deletions dotnet/src/support/PageObjects/PageFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,6 @@ public static T InitElements<T>(IWebDriver driver)
return InitElements<T>(new DefaultElementLocator(driver));
}

/// <summary>
/// Initializes the elements in the Page Object with the given type.
/// </summary>
/// <typeparam name="T">The <see cref="Type"/> of the Page Object class.</typeparam>
/// <param name="driver">The <see cref="IWebDriver"/> instance used to populate the page.</param>
/// <param name="locatorFactory">The <see cref="IElementLocatorFactory"/> implementation that
/// determines how elements are located.</param>
/// <returns>An instance of the Page Object class with the elements initialized.</returns>
/// <remarks>
/// The class used in the <typeparamref name="T"/> argument must have a public constructor
/// that takes a single argument of type <see cref="IWebDriver"/>. This helps to enforce
/// best practices of the Page Object pattern, and encapsulates the driver into the Page
/// Object so that it can have no external WebDriver dependencies.
/// </remarks>
/// <exception cref="ArgumentException">
/// thrown if no constructor to the class can be found with a single IWebDriver argument
/// <para>-or-</para>
/// if a field or property decorated with the <see cref="FindsByAttribute"/> is not of type
/// <see cref="IWebElement"/> or IList{IWebElement}.
/// </exception>
[Obsolete("Users should use classes that implement IElementLocator instead of IElementLocatorFactory. This overload will be removed in a future release.")]
public static T InitElements<T>(IWebDriver driver, IElementLocatorFactory locatorFactory)
{
if (locatorFactory == null)
{
throw new ArgumentNullException("locatorFactory", "locatorFactory cannot be null");
}

return InitElements<T>(locatorFactory.CreateLocator(driver));
}

/// <summary>
/// Initializes the elements in the Page Object with the given type.
/// </summary>
Expand Down Expand Up @@ -139,28 +108,6 @@ public static T InitElements<T>(IElementLocator locator)
return page;
}

/// <summary>
/// Initializes the elements in the Page Object.
/// </summary>
/// <param name="driver">The driver used to find elements on the page.</param>
/// <param name="page">The Page Object to be populated with elements.</param>
/// <param name="locatorFactory">The <see cref="IElementLocatorFactory"/> implementation that
/// determines how elements are located.</param>
/// <exception cref="ArgumentException">
/// thrown if a field or property decorated with the <see cref="FindsByAttribute"/> is not of type
/// <see cref="IWebElement"/> or IList{IWebElement}.
/// </exception>
[Obsolete("Users should use classes that implement IElementLocator instead of IElementLocatorFactory. This overload will be removed in a future release.")]
public static void InitElements(ISearchContext driver, object page, IElementLocatorFactory locatorFactory)
{
if (locatorFactory == null)
{
throw new ArgumentNullException("locatorFactory", "locatorFactory cannot be null");
}

InitElements(page, locatorFactory.CreateLocator(driver));
}

/// <summary>
/// Initializes the elements in the Page Object.
/// </summary>
Expand Down
110 changes: 0 additions & 110 deletions dotnet/src/support/PageObjects/RetryingElementLocatorFactory.cs

This file was deleted.

0 comments on commit 4e7489e

Please sign in to comment.