Cypress Test Runner avatar
Cypress Test Runner
Try for free

No credit card required

View all Actors
Cypress Test Runner

Cypress Test Runner

valek.josef/cypress-test-runner
Try for free

No credit card required

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.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "specCode": `describe('spec', () => {
11            it('test that should succeed', () => {
12                cy.visit('/');
13                cy.get('h1').should('contain', 'Example Domain');
14                cy.screenshot();
15            });
16        
17             it('test that should fail', () => {
18                cy.visit('/');
19                cy.get('h1', { timeout: 1000 }).should('contain', 'Some different text');
20            });
21        });`,
22    "baseUrl": "https://example.com"
23};
24
25(async () => {
26    // Run the Actor and wait for it to finish
27    const run = await client.actor("valek.josef/cypress-test-runner").call(input);
28
29    // Fetch and print Actor results from the run's dataset (if any)
30    console.log('Results from dataset');
31    console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
32    const { items } = await client.dataset(run.defaultDatasetId).listItems();
33    items.forEach((item) => {
34        console.dir(item);
35    });
36})();
37
38// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Apify
Actor metrics
  • 6 monthly users
  • 94.9% runs succeeded
  • 0.0 days response time
  • Created in Apr 2023
  • Modified 3 months ago