DEV Community

kadir
kadir

Posted on

E2E Testing with Cypress and Typescript

This post will show you how to install and configure Cypress with Typescript to test simple Form.io forms.

I used formio angular demo application to perform e2e test against. Here is the testing project github-repo.

After creating a project folder and navigating project root directory, as a first step, we need to install Cypress with this command:

  • npm install cypress --save-dev
    then we need to install typescript with this command :

  • npm install --save-dev typescript

After installing Cypress, we need to start Cypress in open mode with npx cypress open to configure it. Starting Cypress will create cypress.config file and other folders. Inside Cypress folder
we need top add tsconfig.json file like below

tsconfig

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["es5", "dom"],
    "types": ["cypress", "node"]
  },
  "include": ["**/*.ts"]
}

Enter fullscreen mode Exit fullscreen mode

After that we can change all js file to ts file and ad our first testing file to run

command to run test in headless mode:

  • npx cypress run

command to run test in open mode:

  • npx cypress open

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up