Cypress Test Runner

  • valek.josef/cypress-test-runner
  • Modified
  • Users 8
  • Runs 985
  • Created by Author's avatarJosef V谩lek

Run your Cypress tests on the Apify Platform effectively and easily. Just set up your test environment using a user-friendly UI and let the platform do the rest.

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.

# Set API token
API_TOKEN=<YOUR_API_TOKEN>

# Prepare Actor input
cat > input.json <<'EOF'
{
  "specCode": "describe('spec', () => {\n    it('test that should succeed', () => {\n        cy.visit('/');\n        cy.get('h1').should('contain', 'Example Domain');\n        cy.screenshot();\n    });\n\n     it('test that should fail', () => {\n        cy.visit('/');\n        cy.get('h1', { timeout: 1000 }).should('contain', 'Some different text');\n    });\n});",
  "baseUrl": "https://example.com"
}
EOF

# Run the Actor
curl "https://api.apify.com/v2/acts/valek.josef~cypress-test-runner/runs?token=$API_TOKEN" \
  -X POST \
  -d @input.json \
  -H 'Content-Type: application/json'