How to use the screener-runner/src/steps 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
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)
    })
  })