Shared tests for multiple websites/repos #16225
Unanswered
idevelopbugs
asked this question in
Component Testing
Replies: 1 comment 2 replies
-
Do you want to reuse actual tests (like The way I've handled this is custom commands (or custom functions imported to Cypress.command.add('clickOnButton', text => {
cy.get('button').contains(text).click()
}) Then just imported this to our // shared commands
import '@my-org/cypress-shared/commands.js' Is this what you mean? I'm not sure there is anything Cypress specific about sharing code. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm trying to figure out the best way to reuse tests across multiple websites. We have a big platform with react components and import these into the sites. But each web has it's own cypress setup with testscripts, and they pretty much look the same.
The ideal scenario would be to have 1 repo with tests which could easily be imported to each web. Im thinking about maybe having all tests in a repo, then importing them as "commands", and then just executing them in each web by
cy.platformTest('someSelector')
. But it still feels like there should be a better way. Any ideas?Beta Was this translation helpful? Give feedback.
All reactions