Skip to content

Commit 91f0960

Browse files
more explicit cypress config
1 parent e52fe5a commit 91f0960

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

content/en/continuous_integration/tests/javascript.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,16 @@ module.exports = defineConfig({
221221
})
222222
{{< /code-block >}}
223223

224-
Your `supportFile` should look the same as in `cypress<10`:
224+
Add the following line to the **top level** of your `supportFile`:
225225

226226
{{< code-block lang="javascript" filename="cypress/support/e2e.js" >}}
227-
// your previous code is before this line
227+
// Your code can be before this line
228+
// require('./commands')
228229
require('dd-trace/ci/cypress/support')
229-
// also supported:
230+
// Also supported:
230231
// import 'dd-trace/ci/cypress/support'
232+
// Your code can also be after this line
233+
// Cypress.Commands.add('login', (email, pw) => {})
231234
{{< /code-block >}}
232235

233236
If you're using other Cypress plugins, your `cypress.config.js` file should contain the following:
@@ -264,10 +267,13 @@ module.exports = (on, config) => {
264267
}
265268
{{< /code-block >}}
266269

267-
2. Add the following line to the [`supportFile`][4]:
270+
2. Add the following line to the **top level** of your [`supportFile`][4]:
268271
{{< code-block lang="javascript" filename="cypress/support/index.js" >}}
269-
// your previous code is before this line
272+
// Your code can be before this line
273+
// require('./commands')
270274
require('dd-trace/ci/cypress/support')
275+
// Your code can also be after this line
276+
// Cypress.Commands.add('login', (email, pw) => {})
271277
{{< /code-block >}}
272278

273279

0 commit comments

Comments
 (0)