-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
36 lines (28 loc) · 968 Bytes
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defineConfig } from 'cypress'
import { pages } from './cypress/fixtures/pagesToScrape'
import { getApiLinks } from './util/getApiLinks'
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import browserify from '@badeball/cypress-cucumber-preprocessor/browserify'
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config)
on(
'file:preprocessor',
browserify(config, {
typescript: require.resolve('typescript'),
})
)
// getApiLinks pre-processes the list of anchors links
// the spec uses with cypress-each plugin
config.env.links = await getApiLinks(pages)
return config
}
export default defineConfig({
e2e: {
baseUrl: 'https://www.w3.org',
specPattern: ['cypress/e2e/**/*.spec.{js,jsx,ts,tsx}', '**/*.feature'],
setupNodeEvents,
},
})