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
// Ensure we have landed at the start & click the buttons | |
var firstNextButtonElement = AndroidManager.Wait.UntilEx(iWebDriver => (ExpectedConditions.ElementIsVisible(By.XPath("//android.widget.Button[@content-desc=\"NEXT\"]/android.view.ViewGroup")))(iWebDriver)); | |
Assert.IsNotNull(firstNextButtonElement); | |
firstNextButtonElement.Click(); | |
var secondNextButtonElement = AndroidManager.Wait.UntilEx(iWebDriver => (ExpectedConditions.ElementIsVisible(By.XPath("//android.widget.Button[@content-desc=\"NEXT\"]/android.view.ViewGroup")))(iWebDriver)); | |
Assert.IsNotNull(secondNextButtonElement); | |
secondNextButtonElement.Click(); | |
var thirdNextButtonElement = AndroidManager.Wait.UntilEx(iWebDriver => (ExpectedConditions.ElementIsVisible(By.XPath("//android.widget.Button[@content-desc=\"NEXT\"]/android.view.ViewGroup")))(iWebDriver)); |
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
{ | |
"appiumVersion": "1.16.0", | |
"platformName": "iOS", | |
"platformVersion": "13.2", | |
"deviceName": "iPhone XS Simulator", | |
"app": "sauce-storage:App-sim-05202020.zip" | |
} |
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
[TestFixture] | |
[Parallelizable(ParallelScope.All)] | |
class ParallelAtMethodsWithSelenium | |
{ | |
private sealed class TestScope : IDisposable | |
{ | |
public IWebDriver Driver { get; } | |
private string SauceUserName { get; } | |
private string SauceAccessKey { get; } | |
private Dictionary<string, object> SauceOptions { get; } |
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
import io.github.bonigarcia.wdm.WebDriverManager; | |
//This method will run once before all of the tests in our class | |
@BeforeClass | |
public static void setupClass() { | |
WebDriverManager.chromedriver().setup(); | |
} | |
//The setup() will run one time before every single @Test method | |
//In our case it will instantiate a new ChromeDriver that WebDriverManager setup for us | |
@Before |
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
System.setProperty("webdriver.chrome.driver", "resources/windows/chromedriver.exe"); |
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
import org.junit.jupiter.api.*; | |
import org.openqa.selenium.JavascriptExecutor; | |
import org.openqa.selenium.MutableCapabilities; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.net.MalformedURLException; | |
import java.net.URL; |
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
public class CompositionTest | |
{ | |
@Test | |
public void aTestUsingComposition() { | |
InventoryPage inventoryPage = new InventoryPage(driver); | |
inventoryPage.open(); | |
//If you want to interact with the header | |
HeaderComponent header = new HeaderComponent(driver); | |
header.search("backpack"); |
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
public class HeaderComponent { | |
//All of the things related to the Header go here | |
//Elements related to the header section | |
//Methods to interact with the header | |
} |
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
public class KeyboardActions() | |
{ | |
//Clicks in the middle of the given element. | |
click(WebElement target) | |
//Clicks (without releasing) at the current mouse location. | |
clickAndHold(WebElement target) | |
//Performs a context-click at middle of the given element. First performs a mouseMove to the location of the element. | |
contextClick(WebElement target); | |
//Performs a double-click at middle of the given element. | |
doubleClick(WebElement target) |
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
// A car is Composed of an enginer, wheels, and so on. | |
// Hence, it contains these objects inside of the class | |
public class Car | |
{ | |
Engine engine; | |
Wheels wheels; | |
} | |