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
echo "checking current date time:" | |
date | |
TIMEZONES=() | |
readarray -t TIMEZONES < <(timedatectl list-timezones) | |
NEW_TZ=${TIMEZONES[$RANDOM % ${#TIMEZONES[@]}]} | |
echo "Setting up time zone:${NEW_TZ}..." | |
sudo timedatectl set-timezone "${NEW_TZ}" | |
echo "Time zone set, checking time:" | |
date |
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 User | |
{ | |
public int Id { get; set; } | |
public string FullName { get; set; } | |
public string FirstName { get; set; } | |
public string LastName { get; set; } |
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
[Test] | |
public void TestBddFy() | |
{ | |
this.Given(_ => GivenIHaveAnApple(1), "Given I have {0} apples") | |
.When(_ => WhenIEatAnApple(null), "I eat an apple") | |
.Then(_ => ThenIHaveNoApples(), "I have no apples") | |
.BDDfy(); | |
} |
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
... | |
var btn=driver.FindElements(By.XPath("//button[@class='notExisting']")).FirstOrDefault(); | |
if (btn != null) | |
{ | |
btn.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 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(); | |
} |
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 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
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 HtmlTable<T> : HtmlControl where T : HtmlRow, new() | |
{ | |
private string rowFilterXpath = "descendant::tr"; | |
public HtmlTable(IWebElement webElement): base(webElement) | |
{ | |
} | |
public string RowFilterXpath | |
{ |
NewerOlder