-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from 2gis/feature/xpath
Feature/xpath
- Loading branch information
Showing
20 changed files
with
1,053 additions
and
389 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
src/TestApplications.Tests/WpfTestApplication.Tests/CheckFindByXPath.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,65 @@ | ||
namespace WpfTestApplication.Tests | ||
{ | ||
#region using | ||
|
||
using System.Linq; | ||
|
||
using NUnit.Framework; | ||
|
||
using Winium.Cruciatus; | ||
using Winium.Cruciatus.Core; | ||
|
||
using WpfTestApplication.Tests.Map; | ||
|
||
#endregion | ||
|
||
[TestFixture] | ||
public class CheckFindByXPath | ||
{ | ||
#region Fields | ||
|
||
private WpfTestApplicationApp application; | ||
|
||
#endregion | ||
|
||
#region Public Methods and Operators | ||
|
||
[Test] | ||
public void FindElementsByPartName() | ||
{ | ||
const string XPath = "*[starts-with(@Name, 'M')]"; | ||
var results = this.application.MainWindow.TabItem1.TextListBox.FindElements(By.XPath(XPath)).ToList(); | ||
Assert.That(results, Has.Count.EqualTo(2)); | ||
} | ||
|
||
[Test] | ||
public void FindMainWindowFromRoot() | ||
{ | ||
const string XPath = "*[@AutomationId='WpfTestApplicationMainWindow']"; | ||
var mainWindow = CruciatusFactory.Root.FindElement(By.XPath(XPath)); | ||
Assert.AreEqual(mainWindow, this.application.MainWindow); | ||
} | ||
|
||
[Test] | ||
public void FindMainWindowUseRootXPathFunction() | ||
{ | ||
const string XPath = "/*[@AutomationId='WpfTestApplicationMainWindow']"; | ||
var mainWindow = this.application.MainWindow.TabItem1.SetTextButton.FindElement(By.XPath(XPath)); | ||
Assert.AreEqual(mainWindow, this.application.MainWindow); | ||
} | ||
|
||
[TestFixtureSetUp] | ||
public void FixtureSetUp() | ||
{ | ||
TestClassHelper.Initialize(out this.application); | ||
} | ||
|
||
[TestFixtureTearDown] | ||
public void FixtureTearDown() | ||
{ | ||
TestClassHelper.Cleanup(this.application); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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
Oops, something went wrong.