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
if (typeof window.jsXMLHTTPListener === 'undefined') { | |
let jsXMLHTTPListener = { | |
isCallFinishedStatus: 1, | |
pointerSize: 0, | |
pointerFinishSize: 0, | |
isCallFinished: function() { | |
return 1 === this.isCallFinishedStatus; | |
}, | |
setCallFinished: function(i = 0) { | |
this.isCallFinishedStatus = i; |
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
// thanks to http://twitter.com/@KrComet | |
export const getAvailableTestIds = () => { | |
// eslint-disable-next-line | |
console.log(new Set([...document.querySelectorAll('[data-testid]')].map((el) => el.dataset.testid))); | |
}; | |
export const getAvailableIds = () => { | |
console.log(new Set([...document.querySelectorAll('[id]')].map((el) => el.id))); | |
}; |
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
private final CustomScreenRecorder screenRecorder; | |
public BaseTest() throws IOException, AWTException { | |
this.screenRecorder = new CustomScreenRecorder(new File(System.getProperty("user.dir") + "/target/screen-records"));; | |
} | |
@AfterScenario | |
public void tearDown(ExecutionContext context) { | |
if(WebDriverManager.getInstance().getWebDriver() != null){ | |
WebDriverManager.getInstance().killDriver(); |
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 CustomScreenshotGrabber implements CustomScreenshotWriter { | |
@Override | |
public synchronized String takeScreenshot() { | |
if (WebDriverManager.getInstance().getWebDriver() != null) { | |
TakesScreenshot driver = (TakesScreenshot) WebDriverManager.getInstance().getWebDriver(); | |
String screenshotFileName = String.format("screenshot-%s.png", UUID.randomUUID()); | |
try { | |
Files.write(Paths.get((".gauge/screenshots"), screenshotFileName), | |
driver.getScreenshotAs(OutputType.BYTES)); | |
} catch (IOException e) { |
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
@AfterStep | |
public void saveScreenshot(ExecutionContext context) { | |
if (WebDriverManager.getInstance().getWebDriver() != null) { | |
if(!(context.getCurrentStep().getDynamicText().contains("VI")) && !(context.getCurrentStep().getDynamicText().contains("verify"))) { | |
waitHelper.waitUntilPageIsReady(); | |
Gauge.captureScreenshot(); | |
log.warn("Screenshot captured!"); | |
} | |
} | |
} |
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
private static DriverService service; | |
private ThreadLocal<WebDriver> webDriver; | |
public void startTest(String browserName){ | |
webDriver = new ThreadLocal<>(); | |
switch(browserName.toLowerCase()){ | |
case "chrome": | |
io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup(); | |
if (service == null || !service.isRunning()) { |
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
on mac: sh jmeter | |
example: | |
jmeter -n -t my_test.jmx -l log.csv -H my.proxy.server -P 8000 | |
jmeter -n -t /path/to/your/test_plan.jmx -l /path/to/results_file.jtl | |
_____users and rampup overrided from cli | |
_____For this, the thread properties should be defined as follows: ${__P(Users, 1)} ${__P(RampUp, 1)} |
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
fun Matcher<View>.doOnView(vararg actions: ViewAction) { | |
doOnView_Method(matcher = this, actions = *actions) | |
} | |
fun Matcher<View>.assertOnView(vararg assertions: ViewAssertion) { | |
assertOnView_Method(matcher = this, assertions = *assertions) | |
} | |
fun Matcher<View>.waitForView(millis: Int = 5000, millisPerTry: Long = 200): ViewInteraction { | |
return waitForView_Method(viewMatcher = this, waitMillis = millis, waitMillisPerTry = millisPerTry) |
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
// | |
// XCUIElement+Wait.swift | |
// | |
// Created by Ryan Paterson on 12/12/2020. | |
// | |
import XCTest | |
extension XCUIElement { | |
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
App Name | Bundle ID | |
--------------------------------- | |
Activity | com.apple.Fitness | |
App Store | com.apple.AppStore | |
Apple Store | com.apple.store.Jolly | |
Books | com.apple.iBooks | |
Calculator | com.apple.calculator | |
Calendar | com.apple.mobilecal | |
Camera | com.apple.camera | |
Clips | com.apple.clips |
NewerOlder