spring-petclinic / spring-petclinic-angular

Angular 16 version of the Spring Petclinic sample application (frontend)
202 stars 496 forks source link

Test Cases for the components #62

Open simrin051 opened 2 years ago

simrin051 commented 2 years ago

@arey / @vfedoriv

Is it recommended to write test cases for form validation. Can you please advice.

Holger-Mayer commented 3 weeks ago

The currently included e2e test automation tool Protractor reached end-of-life in August 2023.

I am currently working on integrating a Cypress/Cucumber test suite as a test automation tool into the project.

Step one will be form validation tests only. Once these tests are running well (after a verified pull request), it will be easy to enhance this test suite for more complex e2e tests.

The test suite will live under e2e/cypress with added configuration changes in package.json and tsconfig.json and an additional cypress.config.ts in the project’s root directory.

The test suite comprises:

There are several node modules for the dev environment to install. A detailed installation description will be part of the pull request (probably next week).

Why Cypress?

free to use

common test automation tool

You can use it for E2E, component, and API tests.

JavaScript/Typescript as test language

Why Cucumber extension?

arey commented 2 weeks ago

@Holger-Mayer I've been hearing a lot about Playwright recently. But Cypress remains a safe bet. Using Gherkin is a good idea. We could use it for testing the REST API.

Holger-Mayer commented 2 weeks ago

Antoine,

The Gherkin feature files should be reusable. Besides an import for Gherkin the Cucumber glue code is independent from the test tool. Page objects and support functions are filled with cypress functions, but with some refactoring and introduction of a test tool independent layer it should be possible to prepare a test suite that is easy to port from one test tool to another as long as it is Javascript/Typescript based.