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 void mainTestCode(){ | |
//put all the logic here | |
} | |
[TestMethod] | |
public void test1(){ | |
mainTestCode(); | |
} | |
[TestMethod] | |
public void test2(){ | |
mainTestCode(); |
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
context('Login page', ()=>{ | |
beforeEach(()=> { | |
cy.visit('https://www.saucedemo.com/') | |
}) | |
it('can open page', () => { | |
cy.title().should('eq', 'Swag Labs') | |
}) | |
it('can login', () => { | |
cy.get('#user-name').type('standard_user') |
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
Given driver webUrl + "/demo" | |
And input("#abr02tre", Key.CONTROL + "a") | |
And match temp contains "565d" | |
And match temp contains "5d" | |
When input("#rc02ert", "test") | |
Then text("divId45") |
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
var assert = require('assert'); | |
let failureCount = 0; | |
before(function () { | |
console.log('before()', failureCount) | |
}); | |
beforeEach(function () { | |
console.log('beforeEach()', failureCount) | |
}); |
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
@Before | |
public void setUp() throws MalformedURLException { | |
logger.debug("Started setUp();"); | |
logger.debug("platformVersion=>" + platformVersion + ". deviceName=>" + deviceName); | |
MutableCapabilities capabilities = new MutableCapabilities(); | |
capabilities.setCapability("appiumVersion", "1.16.0"); | |
capabilities.setCapability("autoAcceptAlerts", "true"); | |
capabilities.setCapability("idleTimeout", "90"); | |
capabilities.setCapability("noReset", "true"); |
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
var capabilities = new AppiumOptions(); | |
//We can run on any version of the platform as long as it's the correct device | |
//Make sure to pick an Android or iOS device based on your app | |
capabilities.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Google Pixel 4"); | |
capabilities.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android"); | |
//make sure you set locale as sometimes it opens in a different location and throws off locations | |
capabilities.AddAdditionalCapability("locale", "en"); | |
capabilities.AddAdditionalCapability("language", "en"); | |
//The next major version of Appium (2.x) will **require** this capability | |
capabilities.AddAdditionalCapability("automationName", "UiAutomator2"); |
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 com.saucelabs.saucebindings; | |
SauceOptions sauceOptions = new SauceOptions(); | |
//Set a build name | |
sauceOptions.setBuild("Sample Build Name"); | |
new SauceSession(sauceOptions).start(); |
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
<build> | |
<pluginManagement> | |
<plugins> | |
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.8.1</version> | |
<configuration> | |
<source>11</source> |
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
package com.hilton.v2; | |
import org.junit.rules.TestWatcher; | |
import org.junit.runner.Description; | |
import org.openqa.selenium.JavascriptExecutor; | |
import org.openqa.selenium.WebDriver; | |
public class SauceTestWatcher extends TestWatcher { | |
private WebDriver driver; |