How to use screener-runner - 10 common examples

To help you get started, we’ve selected a few screener-runner 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 screener-io / screener-storybook / src / runner.js View on Github external
var localUrl = 'http://' + host;
      // add tunnel details
      config.tunnel = {
        host: host,
        gzip: true,
        cache: true
      };
      // generate config format expected by screener-runner
      config.states = transformToStates(config.storybook, localUrl, config.storybookPreview);
      // remove storybook-specific fields
      config = omit(config, ['storybook', 'storybookConfigDir', 'storybookStaticDir', 'storybookStaticBuildDir', 'storybookPort', 'storybookApp', 'storybookVersion', 'storybookBinPath', 'storybookPreview']);
      if (options && options.debug) {
        console.log('DEBUG: config', JSON.stringify(config, null, 2));
      }
      // send storybook states to screener-runner
      return Runner.run(config);
    });
};
github microsoft / fluent-ui-react / build / screener / screener.steps.ts View on Github external
const getScreenerSteps = (pageUrl: string, stepsModulePath: string): any[] => {
  if (!fs.existsSync(`${stepsModulePath}.ts`)) {
    return undefined
  }

  const stepsBuilder: ScreenerStepBuilder = new Steps()
  const {
    steps: screenerSteps,
    themes = DEFAULT_THEMES,
  }: ScreenerTestsConfig = require(stepsModulePath).default

  _.forEach(themes, themeName => {
    stepsBuilder.switchTheme(themeName).snapshot(`Theme: ${themeName}`)

    _.forEach(screenerSteps, screenerStep => {
      screenerStep(stepsBuilder, keys)

      // We need to reload page to reset mouse position between tests
      stepsBuilder.url(pageUrl).switchTheme(themeName)
    })
  })
github microsoft / fluent-ui-react / build / screener / screener.steps.ts View on Github external
import _ from 'lodash'
import fs from 'fs'
import Steps from 'screener-runner/src/steps'
import keys from 'screener-runner/src/keys'

const DEFAULT_THEMES: ScreenerThemes = ['teams']

Steps.prototype.resetExternalLayout = function resetExternalLayout() {
  return this.executeScript(`window.resetExternalLayout()`)
}

Steps.prototype.switchTheme = function switchTheme(themeName: ScreenerThemeName) {
  return this.executeScript(`window.switchTheme("${themeName}")`)
}

const getScreenerSteps = (pageUrl: string, stepsModulePath: string): any[] => {
  if (!fs.existsSync(`${stepsModulePath}.ts`)) {
    return undefined
  }

  const stepsBuilder: ScreenerStepBuilder = new Steps()
  const {
    steps: screenerSteps,
    themes = DEFAULT_THEMES,
github microsoft / fluent-ui-react / build / screener / screener.steps.ts View on Github external
import _ from 'lodash'
import fs from 'fs'
import Steps from 'screener-runner/src/steps'
import keys from 'screener-runner/src/keys'

const DEFAULT_THEMES: ScreenerThemes = ['teams']

Steps.prototype.resetExternalLayout = function resetExternalLayout() {
  return this.executeScript(`window.resetExternalLayout()`)
}

Steps.prototype.switchTheme = function switchTheme(themeName: ScreenerThemeName) {
  return this.executeScript(`window.switchTheme("${themeName}")`)
}

const getScreenerSteps = (pageUrl: string, stepsModulePath: string): any[] => {
  if (!fs.existsSync(`${stepsModulePath}.ts`)) {
    return undefined
  }

  const stepsBuilder: ScreenerStepBuilder = new Steps()
  const {
    steps: screenerSteps,
    themes = DEFAULT_THEMES,
  }: ScreenerTestsConfig = require(stepsModulePath).default

  _.forEach(themes, themeName => {
    stepsBuilder.switchTheme(themeName).snapshot(`Theme: ${themeName}`)
github screener-io / screener-storybook / src / validate.js View on Github external
var Joi = require('joi');
var stepsSchema = require('screener-runner/src/validate').stepsSchema;
var resolutionSchema = require('screener-runner/src/validate').resolutionSchema;
var browsersSchema = require('screener-runner/src/validate').browsersSchema;
var sauceSchema = require('screener-runner/src/validate').sauceSchema;
var vstsSchema = require('screener-runner/src/validate').vstsSchema;
var browserStackSchema = require('screener-runner/src/validate').browserStackSchema;

exports.storybookConfig = function(value) {
  var schema = Joi.object().keys({
    apiKey: Joi.string().required(),
    projectRepo: Joi.string().max(100).required(),
    storybookConfigDir: Joi.string().required(),
    storybookStaticDir: Joi.string(),
    storybookStaticBuildDir: Joi.string(),
    storybookPort: Joi.number().required(),
    storybookPreview: Joi.string().required(),
    storybook: Joi.array().min(0).items(
      Joi.object().keys({
        kind: Joi.string().required(),
        stories: Joi.array().min(1).items(
          Joi.object().keys({
            name: Joi.string().required(),
github screener-io / screener-storybook / src / validate.js View on Github external
var Joi = require('joi');
var stepsSchema = require('screener-runner/src/validate').stepsSchema;
var resolutionSchema = require('screener-runner/src/validate').resolutionSchema;
var browsersSchema = require('screener-runner/src/validate').browsersSchema;
var sauceSchema = require('screener-runner/src/validate').sauceSchema;
var vstsSchema = require('screener-runner/src/validate').vstsSchema;
var browserStackSchema = require('screener-runner/src/validate').browserStackSchema;

exports.storybookConfig = function(value) {
  var schema = Joi.object().keys({
    apiKey: Joi.string().required(),
    projectRepo: Joi.string().max(100).required(),
    storybookConfigDir: Joi.string().required(),
    storybookStaticDir: Joi.string(),
    storybookStaticBuildDir: Joi.string(),
    storybookPort: Joi.number().required(),
    storybookPreview: Joi.string().required(),
    storybook: Joi.array().min(0).items(
      Joi.object().keys({
        kind: Joi.string().required(),
github screener-io / screener-storybook / src / validate.js View on Github external
kind: Joi.string().required(),
        stories: Joi.array().min(1).items(
          Joi.object().keys({
            name: Joi.string().required(),
            steps: stepsSchema
          })
        ).required()
      })
    ).required(),
    build: Joi.string().max(40),
    branch: Joi.string().max(100),
    commit: Joi.string(),
    pullRequest: Joi.string(),
    resolution: resolutionSchema,
    resolutions: Joi.array().min(1).items(
      resolutionSchema
    ),
    browsers: browsersSchema,
    cssAnimations: Joi.boolean(),
    ignore: Joi.string(),
    hide: Joi.string(),
    includeRules: Joi.array().min(0).items(
      Joi.string(),
      Joi.object().type(RegExp)
    ),
    excludeRules: Joi.array().min(0).items(
      Joi.string(),
      Joi.object().type(RegExp)
    ),
    baseBranch: Joi.string().max(100),
    initialBaselineBranch: Joi.string().max(100),
    useNewerBaseBranch: Joi.string().valid('accepted', 'latest'),
github screener-io / screener-storybook / src / validate.js View on Github external
var Joi = require('joi');
var stepsSchema = require('screener-runner/src/validate').stepsSchema;
var resolutionSchema = require('screener-runner/src/validate').resolutionSchema;
var browsersSchema = require('screener-runner/src/validate').browsersSchema;
var sauceSchema = require('screener-runner/src/validate').sauceSchema;
var vstsSchema = require('screener-runner/src/validate').vstsSchema;
var browserStackSchema = require('screener-runner/src/validate').browserStackSchema;

exports.storybookConfig = function(value) {
  var schema = Joi.object().keys({
    apiKey: Joi.string().required(),
    projectRepo: Joi.string().max(100).required(),
    storybookConfigDir: Joi.string().required(),
    storybookStaticDir: Joi.string(),
    storybookStaticBuildDir: Joi.string(),
    storybookPort: Joi.number().required(),
    storybookPreview: Joi.string().required(),
    storybook: Joi.array().min(0).items(
      Joi.object().keys({
        kind: Joi.string().required(),
        stories: Joi.array().min(1).items(
github screener-io / screener-storybook / src / validate.js View on Github external
var Joi = require('joi');
var stepsSchema = require('screener-runner/src/validate').stepsSchema;
var resolutionSchema = require('screener-runner/src/validate').resolutionSchema;
var browsersSchema = require('screener-runner/src/validate').browsersSchema;
var sauceSchema = require('screener-runner/src/validate').sauceSchema;
var vstsSchema = require('screener-runner/src/validate').vstsSchema;
var browserStackSchema = require('screener-runner/src/validate').browserStackSchema;

exports.storybookConfig = function(value) {
  var schema = Joi.object().keys({
    apiKey: Joi.string().required(),
    projectRepo: Joi.string().max(100).required(),
    storybookConfigDir: Joi.string().required(),
    storybookStaticDir: Joi.string(),
    storybookStaticBuildDir: Joi.string(),
    storybookPort: Joi.number().required(),
    storybookPreview: Joi.string().required(),
    storybook: Joi.array().min(0).items(
github screener-io / screener-storybook / src / validate.js View on Github external
var Joi = require('joi');
var stepsSchema = require('screener-runner/src/validate').stepsSchema;
var resolutionSchema = require('screener-runner/src/validate').resolutionSchema;
var browsersSchema = require('screener-runner/src/validate').browsersSchema;
var sauceSchema = require('screener-runner/src/validate').sauceSchema;
var vstsSchema = require('screener-runner/src/validate').vstsSchema;
var browserStackSchema = require('screener-runner/src/validate').browserStackSchema;

exports.storybookConfig = function(value) {
  var schema = Joi.object().keys({
    apiKey: Joi.string().required(),
    projectRepo: Joi.string().max(100).required(),
    storybookConfigDir: Joi.string().required(),
    storybookStaticDir: Joi.string(),
    storybookStaticBuildDir: Joi.string(),
    storybookPort: Joi.number().required(),
    storybookPreview: Joi.string().required(),
    storybook: Joi.array().min(0).items(
      Joi.object().keys({
        kind: Joi.string().required(),
        stories: Joi.array().min(1).items(
          Joi.object().keys({