How to use terra-toolkit - 10 common examples

To help you get started, we’ve selected a few terra-toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-framework / wdio.conf.js View on Github external
const wdioConf = require('terra-toolkit/lib/wdio/conf');
const ExpressDevService = require('terra-toolkit/lib/wdio/services/index').ExpressDevService;
const localIP = require('ip');
const path = require('path');
const webpackConfig = require('terra-dev-site/src/config/webpack.config.js');

const webpackPort = 8080;

// Flex specs search between local pacakge and repo
let specs = path.join('tests', 'wdio', '**', '*-spec.js');
if (__dirname === process.cwd()) {
  specs = path.join('packages', '*', specs);
}

const config = {
  ...wdioConf.config,

  baseUrl: `http://${localIP.address()}:${webpackPort}`,
  specs,

  // Ignore deprecation warnings. When chrome supports /actions API we'll update to use those.
  deprecationWarnings: false,

  webpackPort,
  webpackConfig,
  axe: {
    inject: true,
    options: {
      rules: [{
        id: 'landmark-one-main',
        enabled: false,
      }],
github cerner / terra-framework / wdio.conf.js View on Github external
}],
    },
  },
  terra: {
    selector: '[data-terra-dev-site-content] *:first-child',
  },

  beforeHook() {
    // Being Terra tests are executed on an SPA, a full refresh is required
    // in order to reset the site. This ensures customProperty tests and any
    // other dom modifications are cleared before starting a test.
    global.browser.refresh();
  },
};

config.services = wdioConf.config.services.concat([ExpressDevService]);
exports.config = config;
github cerner / terra-clinical / wdio.conf.js View on Github external
const webpackConfig = require('./webpack.config.js');
const ExpressDevService = require('terra-toolkit/lib/wdio/services/index').ExpressDevService;
const localIP = require('ip');
const path = require('path');

const webpackPort = 8080;
const isRepoTest = __dirname === process.cwd();

// Flex specs search between local pacakge and repo
let specs = path.join('tests', 'wdio', '**', '*-spec.js');
if (isRepoTest) {
  specs = path.join('packages', 'terra-*', specs);
}

const config = {
  ...wdioConf.config,
  baseUrl: `http://${localIP.address()}:${webpackPort}`,
  specs: [specs],
  exclude: [
    'packages/terra-clinical-error-view/tests/wdio/**/*-spec.js',
  ],

  // Configuration for terra-toolkit's SeleniumDocker service
  seleniumDocker: {
    cleanup: false,
    env: {
      TZ: 'America/Chicago',
    },
  },

  axe: {
    inject: true,
github cerner / terra-clinical / wdio.conf.js View on Github external
id: 'landmark-one-main',
        enabled: false,
      }],
    },
  },

  // global visual-regression selector
  terra: {
    selector: '[data-terra-dev-site-content] *:first-child',
  },

   // Configuration for ExpressDevService
  webpackConfig,
};

config.services = wdioConf.config.services.concat([ExpressDevService]);
exports.config = config;
github cerner / terra-core / nightwatch.conf.js View on Github external
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const nightwatchConfig = require('terra-toolkit/lib/nightwatch/nightwatch.config.js').default;
const webpackConfig = require('./webpack.config');
const getPackageTestDirectories = require('terra-toolkit/lib/nightwatch/setup-helper.js').getPackageTestDirectories;

let srcFolders;
const isRepoTest = !process.cwd().includes('packages');

if (isRepoTest) {
  srcFolders = getPackageTestDirectories('lerna.json');
} else {
  srcFolders = 'tests/nightwatch/';
}

const config = nightwatchConfig(webpackConfig, srcFolders);

module.exports = config;
github cerner / terra-framework / nightwatch.conf.js View on Github external
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const nightwatchConfig = require('terra-toolkit/lib/nightwatch/nightwatch.config.js').default;
const webpackConfig = require('terra-dev-site/src/config/webpack.config.js');
const getPackageTestDirectories = require('terra-toolkit/lib/nightwatch/setup-helper.js').getPackageTestDirectories;
const path = require('path');

let srcFolders;
const isRepoTest = !process.cwd().includes('packages');

if (isRepoTest) {
  srcFolders = getPackageTestDirectories('lerna.json');
} else {
  srcFolders = path.join('tests', 'nightwatch');
}

const config = nightwatchConfig(webpackConfig, srcFolders);

module.exports = config;
github cerner / terra-framework / nightwatch.conf.js View on Github external
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const nightwatchConfig = require('terra-toolkit/lib/nightwatch/nightwatch.config.js').default;
const webpackConfig = require('terra-dev-site/src/config/webpack.config.js');
const getPackageTestDirectories = require('terra-toolkit/lib/nightwatch/setup-helper.js').getPackageTestDirectories;
const path = require('path');

let srcFolders;
const isRepoTest = !process.cwd().includes('packages');

if (isRepoTest) {
  srcFolders = getPackageTestDirectories('lerna.json');
} else {
  srcFolders = path.join('tests', 'nightwatch');
}

const config = nightwatchConfig(webpackConfig, srcFolders);

module.exports = config;
github cerner / terra-clinical / nightwatch.conf.js View on Github external
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const nightwatchConfig = require('terra-toolkit/lib/nightwatch/nightwatch.config.js').default;
const webpackConfig = require('./webpack.config');
const getPackageTestDirectories = require('terra-toolkit/lib/nightwatch/setup-helper.js').getPackageTestDirectories;

let srcFolders;
const isRepoTest = __dirname === process.cwd();

if (isRepoTest) {
  srcFolders = getPackageTestDirectories('lerna.json');
} else {
  srcFolders = 'tests/nightwatch/';
}

if (Array.isArray(srcFolders)) {
  srcFolders = srcFolders.filter(value => value !== 'packages/terra-clinical-error-view/tests/nightwatch' && value !== 'packages/terra-clinical-no-data-view/tests/nightwatch');
}

const config = nightwatchConfig(webpackConfig, srcFolders);

module.exports = config;
github cerner / terra-core / nightwatch.conf.js View on Github external
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const nightwatchConfig = require('terra-toolkit/lib/nightwatch/nightwatch.config.js').default;
const webpackConfig = require('./webpack.config');
const getPackageTestDirectories = require('terra-toolkit/lib/nightwatch/setup-helper.js').getPackageTestDirectories;

let srcFolders;
const isRepoTest = !process.cwd().includes('packages');

if (isRepoTest) {
  srcFolders = getPackageTestDirectories('lerna.json');
} else {
  srcFolders = 'tests/nightwatch/';
}

const config = nightwatchConfig(webpackConfig, srcFolders);

module.exports = config;
github cerner / terra-framework / wdio.conf.js View on Github external
/* eslint-disable import/no-extraneous-dependencies */
const wdioConf = require('terra-toolkit/lib/wdio/conf');
const ExpressDevService = require('terra-toolkit/lib/wdio/services/index').ExpressDevService;
const localIP = require('ip');
const path = require('path');
const webpackConfig = require('terra-dev-site/src/config/webpack.config.js');

const webpackPort = 8080;

// Flex specs search between local pacakge and repo
let specs = path.join('tests', 'wdio', '**', '*-spec.js');
if (__dirname === process.cwd()) {
  specs = path.join('packages', '*', specs);
}

const config = {
  ...wdioConf.config,

  baseUrl: `http://${localIP.address()}:${webpackPort}`,