How to use the screener-runner/src/steps.prototype function in screener-runner

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 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}`)