Last active
June 27, 2023 21:05
-
-
Save erdemkiiliic/cf88d1843f9fe7597d27b3b29f275bef to your computer and use it in GitHub Desktop.
Capturing a screenshot after each step in Gauge that doesn't contain "VI" and "verify" in the step name.
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!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment