Skip to content

Commit

Permalink
feat: add playwright config to multistep checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrandiaz committed Jan 24, 2024
1 parent 97bc401 commit 88289f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/cli/src/constructs/multi-step-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { pathToPosix } from '../services/util'
import { Content, Entrypoint } from './construct'
import CheckTypes from '../constants'
import { CheckDependency } from './browser-check'
import { PlaywrightConfig } from './playwright-config'

export interface MultiStepCheckProps extends CheckProps {
/**
* A valid piece of Node.js javascript code describing a multi-step interaction
* with the Puppeteer or Playwright frameworks.
*/
code: Content|Entrypoint
code: Content|Entrypoint,
playwrightConfig?: PlaywrightConfig
}

/**
Expand All @@ -27,6 +29,7 @@ export class MultiStepCheck extends Check {
script: string
scriptPath?: string
dependencies?: Array<CheckDependency>
playwrightConfig?: PlaywrightConfig

/**
* Constructs the multi-step instance
Expand All @@ -42,6 +45,8 @@ export class MultiStepCheck extends Check {
MultiStepCheck.applyDefaultMultiStepCheckConfig(props)
super(logicalId, props)

this.playwrightConfig = props.playwrightConfig

if (!Session.availableRuntimes[this.runtimeId!]?.multiStepSupport) {
throw new Error('This runtime does not support multi step checks.')
}
Expand Down Expand Up @@ -128,6 +133,7 @@ export class MultiStepCheck extends Check {
script: this.script,
scriptPath: this.scriptPath,
dependencies: this.dependencies,
playwrightConfig: this.playwrightConfig,
}
}
}

0 comments on commit 88289f6

Please sign in to comment.