2.2.2 • Published 5 months ago

cypress-for-drupal v2.2.2

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Introduction

Welcome to the Cypress Automation Package for Drupal! This package is designed to streamline and enhance the testing experience for Drupal developers by providing a robust set of custom Cypress commands and pre-configured test cases. With this package, you can efficiently automate end-to-end testing for your Drupal site, ensuring that your application performs as expected across various scenarios.

Installation

To get started, follow these steps:

  1. Install dependencies:
    • npm install or yarn install

Running Tests

You can run the tests using either the CLI in headless mode or the Cypress UI.

CLI - Headless Mode

  • Development environment: npm run run:test:dev
  • Production environment: npm run run:test:prod
  • Staging environment: npm run run:test:stage

Cypress UI

  • Development environment: npm run open:test:dev
  • Production environment: npm run open:test:prod
  • Staging environment: npm run open:test:stage

Running Tests with Tags

To run tests with specific tags:

  1. Update the environment and tags in the run:test:tags script:
    • "cypress run --env configFile=<envFile>,TAGS=\"<@tags>\""
  2. Run the tests:
    • npm run run:test:tags

Reusable Keywords

The Cypress Automation Package for Drupal includes a comprehensive set of reusable keywords (custom commands) designed to facilitate testing within Drupal environments. These keywords simplify test development, improve readability, and ensure maintainability.

Benefits of Reusable Keywords

  • Simplification: Reduce complexity in test scripts by using pre-defined keywords that encapsulate common Drupal actions.
  • Readability: Enhance the readability and understandability of test scripts, making them accessible even to non-technical stakeholders.
  • Maintainability: Simplify updates and maintenance by modifying the keyword definition in one place, automatically updating all associated test cases.
  • Reusability: Create modular test cases by combining reusable keywords to cover various test scenarios.

Rules

Naming Conventions

This repository follows three different naming conventions:

  1. Camel Case (testUser):

    • Used for variable names in JavaScript files and folder names.
    • Example: Variable naming in a JS file, folder name - Repo name, e.g., appCV.
  2. Snake Case (test_user):

    • Used for naming keys in .json files.
    • Example: Mapping field name - "<repo_name><section><type>": "value".
  3. Kebab Case (test-user):

    • Used for naming .js and .feature files.
    • Example: Feature files - <repo-name><function>.feature, Mapping file - Only one .json file per repo, e.g., <repo-name>.json, Business keyword - Only one .js file per repo, e.g., <repo-name>.js, Keyword - <action>.js, API - <method><section>.js.

Committing Guidelines

  • Ensure your branch is up-to-date with master.
  • Verify that your script runs without issues in both Staging and Production environments.
  • Confirm that your script is placed in the correct folder and follows the appropriate folder structure.
2.2.2

5 months ago

2.2.1

6 months ago

2.2.0

9 months ago

2.1.0

9 months ago

2.0.2

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.8.0

9 months ago

1.7.0

9 months ago

1.6.0

9 months ago

1.5.0

9 months ago

1.4.0

9 months ago

1.3.0

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.50

9 months ago

1.0.49

9 months ago

1.0.48

9 months ago

1.0.47

9 months ago

1.0.46

9 months ago

1.0.45

9 months ago

1.0.44

9 months ago

1.0.43

9 months ago

1.0.42

9 months ago

1.0.41

9 months ago

1.0.40

9 months ago

1.0.39

9 months ago

1.0.38

9 months ago

1.0.37

9 months ago

1.0.36

9 months ago

1.0.35

9 months ago

1.0.34

9 months ago

1.0.33

9 months ago

1.0.32

9 months ago

1.0.31

9 months ago

1.0.30

9 months ago

1.0.29

9 months ago

1.0.28

9 months ago

1.0.27

9 months ago

1.0.26

9 months ago

1.0.25

9 months ago

1.0.24

9 months ago

1.0.23

9 months ago

1.0.22

9 months ago

1.0.21

9 months ago

1.0.20

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.16

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago