Last active
February 11, 2021 13:50
-
-
Save eliasnogueira/27344d639f5f1d6a96db42b90b1abb99 to your computer and use it in GitHub Desktop.
Test to take the device screenshot
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
@Test | |
void readQRCode() { | |
MobileElement qrCodeElement = driver.findElement(By.id("com.example.qrcode:id/imageView")); | |
File screenshot = driver.getScreenshotAs(OutputType.FILE); | |
String content = decodeQRCode(generateImage(qrCodeElement, screenshot)); | |
assertThat(content).isEqualTo("f3ce8d4d-074f-483f-9fd0-45c7947fd40c"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The full code can be found at https://github.com/eliasnogueira/appium-read-qrcode/