1.1.15 • Published 11 months ago

@screept/cypress v1.1.15

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

screept-ai/cypress-recorder

Create Cypress tests in seconds for free

TestRecording

  • No registration.
  • No coding skills required.
  • Create tests 30x faster directly in the Cypress environment.

To start using Screept in your project

Install the module.

npm install -D @screept/cypress

Configure your project to use Screept plugin

npx screept-init

or use manual configuration

Try free version now

To get started, simply install the plugin without API key and begin recording your tests effortlessly.\ With this powerful tool, you can easily create comprehensive tests that involve various actions such as clicks, typing, and assertions.\ The best part is that the plugin automatically generates selectors for you, streamlining the process even further.

Demo project

  • Get demo project on GitHub and try all advanced features right away.
  • It uses Cypress 12 with preinstalled plugin, connected to a demo account.
  • It will show you how to use autoheal, visual testing, email testing, file upload, variables and more.
  • Screept Demo Project

If you need advanced testing tools, try our paid version

AI selectors and automatic test fixing

  • We collect a variety of data that enables us to identify the correct element, even if your user interface undergoes changes.
  • If your selector is not working anymore we will automatically fix it for you.

Example

Your test contains broken selector:

cy.ai.get('#broken-selector', {i: 1}).type('{{generate.email}}');

AI will find the right element, generate new selector and create fixed test for you:

cy.ai.get('[type="email"]', {i: 1}).type('{{generate.email}}');

Email testing

  • You can test receiving of emails in your tests.
cy.ai.get('[type="email"]', {i: 1}).type('{{generate.email}}');
cy.ai.get('button', {i: 2}).click();
cy.ai.openEmail('Verify your email'); // Open email with subject "Verify your email"
cy.ai.get('a', {i: 3, iframe: '.data-box-content>iframe'}).click(); // Click on verification link
cy.ai.closeEmail() // Close the email

PDF testing

  • Download and open PDF files in your tests.
  • You can add assertions to check the content of the PDF file.
cy.ai.get('(//*[contains(@class,"MBeuO")])[1]', {i:6}).click();
cy.ai.openPdf('sample');
cy.ai.get('(//*[@role="presentation"])[1]', {i:8, iframe: 'iframe#pf-pdf-iframe'}).should('include.text', 'A Simple PDF File');
cy.ai.closePdf();

Visual testing

  • Compare screenshots of your application with the reference image.

Visual Testing

    cy.visit('https://www.google.com/');
    cy.ai.get('#logo', {i:2})
        .visualCheck('https://preflightuploadsdev.blob.core.windows.net/uploads/bf026e27-e3b9-49f9-904c-bd91bddf539a', 15);
  

File upload testing

  • Your uploaded files will be stored in cloud and downloaded to your test environment when needed.
  • File Upload Testing
cy.visit('https://www.dropzone.dev/#');
    cy.ai.get('.dropzone', {i:2}).click();
    cy.ai.get('input', {i:3})
        .fileUpload({filename: 'testImage.jpg', url: 'https://preflightuploadsdev.blob.core.windows.net/uploads/66ca812f-9dd9-4939-87f3-933c9192551b'});
    cy.ai.get('(//*[contains(@class,"dz-filename")]/span)[2]', {i:4})
        .should('include.text', 'testImage.jpg');

Generic test data

  • The test will automatically generate random data for you.
cy.ai.get('(//*[@type="text"])[1]', {i: 3}).type('{{name.firstName}}');
  • This code will write random name to the input field.

XPath selector and iFrames support

Test run recording, statistics and simple test edit in modern UI

  • You can keep track of test runs in your Screept.ai account. ScreeptApp

Manual plugin installation

1. Add the following line to cypress/support/commands.js.

require('@screept/cypress'); // Import Screept.ai plugin

2. Import plugin

For Cypress 10 and above Add the following lines to cypress.config.js.

const { defineConfig } = require('cypress')
const screeptAiSetupNode = require("@screept/cypress/cyNodeSetup");

module.exports = defineConfig({
  env: {
      SCREEPT_API_KEY: '[YOUR_API_KEY]'
  },
  e2e: {
    setupNodeEvents(on, config) {
        screeptAiSetupNode(on); // Import Screept.ai plugin
    }    
  }
})

3. Create an account on screept.ai

  • The API key will be generated for you automatically after creating account.
  • Alternatively you can go to Account Settings / API to generate a new one.

4. Set API key in your test environment

  • You can set key in code like Cypress.ScreeptApiKey = '[YOUR_API_KEY]';
  • Or set Cypress env in your cypress.config.js file.
env: {
  SCREEPT_API_KEY: '[YOUR_API_KEY]'
 }

Open Cypress runner and start recording your tests

Recording

1.1.15

11 months ago

1.1.14

11 months ago

1.1.13

11 months ago

1.1.12

11 months ago

1.1.11

11 months ago

1.1.10

11 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.1.7

12 months ago

1.1.6

12 months ago

1.1.5

12 months ago

1.1.4

12 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago