Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom tasks #408

Open
louis-md opened this issue May 11, 2022 · 1 comment
Open

Add custom tasks #408

louis-md opened this issue May 11, 2022 · 1 comment
Assignees

Comments

@louis-md
Copy link

louis-md commented May 11, 2022

Hi,

I am looking to set up custom tasks to execute server-side functions before my tests (such as reset and seed database). I tried adding custom plugins as suggested in #346 but it only concerns Cypress.Commands, not tasks.

To set custom tasks, one should set a plugins.js with

on('task', {
 customTask1: () => {},
 customTask2: () => {},
 ...
})

however, the function on('task', ...) is already called inside @synthetixio/synpress/plugins/index.js, and calling it again in plugins.js does not seem to change anything.

What am I missing?

Thanks in advance

@louis-md
Copy link
Author

For those having the same issue, I found a workaround by using patch-package, and include the missing tasks I need directly in @synthetixio/synpress/plugins/index.js file. It's not great, so any more elegant solution will be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants