This file contains hidden or 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
public class BlogExampleObject | |
{ | |
//Will always check that actual value is greater | |
// than attribute argument | |
//And will ignore comparison if expected is 0 | |
[ValidateActualGreaterThan(0)] | |
public int Id { get; set; } | |
//Will always check that actual value is not null | |
//And will ignore comparison if expected is null |
This file contains hidden or 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
[TestMethod] | |
public void BlogExample_PropertySet() | |
{ | |
var expected = new BlogExampleObject | |
{ | |
ChildObject = new TestObject{Value="ChildObjectValue1"}, | |
ChildObjectList = new List<TestObject>{new TestObject{Value="ListObject1"}}, | |
IgnoredProperty = "1", | |
ProcessedProperty = "Test" | |
}; |
This file contains hidden or 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
[TestMethod] | |
public void CumulativeAssert_MultipleFailuresExample() | |
{ | |
//Some actions | |
CumulativeAssert.That(false,"Boolean failure"); | |
//Some actions | |
CumulativeAssert.That(true, "Boolean passed"); | |
//More actions | |
CumulativeAssert.That(1, Is.EqualTo(2), "int equality"); | |
//Some actions |
This file contains hidden or 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
public class HtmlControl | |
{ | |
protected readonly IWebElement webElement; | |
public HtmlControl(IWebElement webElement) | |
{ | |
this.webElement = webElement; | |
} | |
public void Click() |
This file contains hidden or 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
public class HtmlTable<T> : HtmlControl where T : HtmlRow, new() | |
{ | |
private string rowFilterXpath = "descendant::tr"; | |
public HtmlTable(IWebElement webElement): base(webElement) | |
{ | |
} | |
public string RowFilterXpath | |
{ |
This file contains hidden or 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
package org.openqa.selenium.example; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.htmlunit.HtmlUnitDriver; | |
public class Example { | |
public static void main(String[] args) { | |
// Create a new instance of the html unit driver |
This file contains hidden or 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
public class Page | |
{ | |
protected readonly IWebDriver driver; | |
public Page(IWebDriver driver) | |
{ | |
this.driver = driver; | |
} | |
public string Title |
This file contains hidden or 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
public abstract class Page | |
{ | |
protected readonly IWebDriver driver; | |
protected Page(IWebDriver driver) | |
{ | |
this.driver = driver; | |
MaxLoadingTime = TimeSpan.FromSeconds(30); | |
} |
This file contains hidden or 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
public static class WebDriverExtensions{ | |
public static bool ElementExists(this IWebDriver webDriver, By @by) | |
{ | |
return webDriver.FindElements(@by).Any(); | |
} | |
public static IWebElement FindElementOrDefault(this IWebDriver webDriver, By @by) | |
{ | |
return webDriver.FindElements(@by).FirstOrDefault(); | |
} |
This file contains hidden or 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
public static class WebDriverExtensions{ | |
public static bool ElementExists(this IWebDriver webDriver, By @by) | |
{ | |
return webDriver.FindElements(@by).Any(); | |
} | |
public static IWebElement FindElementOrDefault(this IWebDriver webDriver, By @by) | |
{ | |
return webDriver.FindElements(@by).FirstOrDefault(); | |
} |
OlderNewer