-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix XPath generation in ElementFactory for non-xpath base locators +s…
…emver: feature (#184) * Update Aquality.Selenium.Core version * Add FindChildElements to Form to resolve #187 +semver: feature * Fix XPath generation in ElementFactory for non-xpath base locators * Add missed localization values * Handle some locator types to generate more productive XPath for multiple elements
- Loading branch information
Showing
9 changed files
with
192 additions
and
30 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
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
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
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
61 changes: 61 additions & 0 deletions
61
...lity.Selenium.Tests/Integration/TestApp/AutomationPractice/Forms/ProductTabContentForm.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,61 @@ | ||
using Aquality.Selenium.Core.Elements; | ||
using Aquality.Selenium.Elements; | ||
using Aquality.Selenium.Forms; | ||
using OpenQA.Selenium; | ||
using System.Collections.Generic; | ||
|
||
namespace Aquality.Selenium.Tests.Integration.TestApp.AutomationPractice.Forms | ||
{ | ||
internal sealed class ProductTabContentForm : Form | ||
{ | ||
private static readonly By DottedXPath = By.XPath(".//ul[@id='blockbestsellers']//li[not(@style='display:none')]"); | ||
private static readonly By BestSellersById = By.Id("blockbestsellers"); | ||
private static readonly By InputByName = By.Name("controller"); | ||
private static readonly By ItemByCssSelector = By.CssSelector(".submenu-container"); | ||
private static readonly By ItemByClassName = By.ClassName("submenu-container"); | ||
|
||
public ProductTabContentForm() : base(By.ClassName("tab-content"), "Product tab content") | ||
{ | ||
} | ||
|
||
public IList<Label> GetListElements(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(By.XPath("//ul[@id='blockbestsellers']//li"), state: state, expectedCount: count); | ||
} | ||
|
||
public IList<Label> GetListElementsById(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(BestSellersById, state: state, expectedCount: count); | ||
} | ||
|
||
public IList<Label> GetListElementsByName(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(InputByName, state: state, expectedCount: count); | ||
} | ||
|
||
public IList<Label> GetListElementsByClassName(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(ItemByClassName, state: state, expectedCount: count); | ||
} | ||
|
||
public IList<Label> GetListElementsByCss(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(ItemByCssSelector, state: state, expectedCount: count); | ||
} | ||
|
||
public Label GetChildElementByNonXPath(ElementState state) | ||
{ | ||
return FindChildElement<Label>(BestSellersById, state: state); | ||
} | ||
|
||
public IList<Label> GetListElementsByDottedXPath(ElementState state, ElementsCount count) | ||
{ | ||
return ElementFactory.FindElements<Label>(DottedXPath, state: state, expectedCount: count); | ||
} | ||
|
||
public IList<Label> GetChildElementsByDottedXPath(ElementState state, ElementsCount count) | ||
{ | ||
return FindChildElements<Label>(DottedXPath, state: state, expectedCount: count); | ||
} | ||
} | ||
} |
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