Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- exports.config = {
- runner: 'local',
- port: 4723,
- path: '/wd/hub',
- services: ['appium'],
- appium: {
- command: 'appium'
- },
- specs: [
- './tests/**/*.spec.js'
- ],
- sync: true,
- maxInstances: 1,
- capabilities: [{
- platformName: 'Android',
- platformVersion: '8.0',
- deviceName: process.env.DEVICE_NAME,
- app: process.env.APP_URL,
- appPackage: 'mainapp',
- appActivity: 'MainActivity',
- automationName: 'uiautomator2',
- newCommandTimeout: 1000,
- uiautomator2ServerInstallTimeout: 4000,
- adbExecTimeout: 120000,
- autoGrantPermissions: true,
- autoAcceptAlerts: true,
- unicodeKeyboard: true,
- reporters: ['spec']
- }],
- logLevel: 'warn',
- framework: 'mocha',
- reporters: ['spec'],
- mochaOpts: {
- timeout: 600000
- },
- waitforTimeout: 4000,
- connectionRetryTimeout: 90000,
- afterTest: (test, context, {
- error, result, duration, passed, retries
- }) => {
- if (!passed) {
- const screenshot = driver.takeScreenshot();
- fs.writeFile(`./screenshots/${test.parent}:${test.title.replace(/,/g, '').replace(/ /g, '-')}.png`, screenshot, 'base64', (err) => {
- if (err) {
- throw err;
- }
- });
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement