driver.js 472 Bytes
const axios = require('axios');
const caseLayout = require('./case-layout');
const {iosCaps, androidCaps, serverConfig, port} = require('../config.json');

axios.defaults.baseURL = `http://127.0.0.1:${port}/`;
axios.defaults.responseType = 'json';

module.exports.describe = (scene, title, driverFn) => {
  const caps = global.TEST_PLATFORM === 'ios' ? iosCaps : androidCaps;

  caseLayout.addScene({
    scene,
    title,
    driverFn,
    caps,
    serverConfig
  });
}