Created
March 12, 2018 03:01
-
-
Save asialgearoid/0cd158eeb8eab6f05867c40f48e71218 to your computer and use it in GitHub Desktop.
Testing Cordova Apps with Appium (screenshots.js)
This file contains hidden or 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
const fs = require('fs'); | |
describe('Screenshots', () => { | |
it('shows text is visible', () => { | |
browser.timeouts('implicit', 5000); | |
// We need to switch to the native context for the screenshot to work | |
browser.context('NATIVE_APP'); | |
// browser.screenshot returns the screenshot as a base64 string | |
const textVisibleScreenshot = browser.screenshot(); | |
fs.writeFileSync('screenshot-1.png', textVisibleScreenshot.value, 'base64'); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment