Code Monkey home page Code Monkey logo

cypress-utils's Introduction

ProcessMaker Cypress Testing Utilities

This package provides a collection of utilities designed to enhance and simplify the development of tests for ProcessMaker with Cypress, an end-to-end testing framework. These utilities aim to make your ProcessMaker automated testing workflow more efficient and manageable.

Features

  • Assertion Helpers: Simplify the process of writing assertions by utilizing ready-to-use helper functions.
  • Custom Commands: Extend Cypress's built-in commands with additional functionality for common use cases.
  • Pages: Utilize reusable page objects that encapsulate the structure and behavior of ProcessMaker's pages.
  • Selectors: Access predefined selectors for ProcessMaker's elements to facilitate test writing.

Installation

To start using the cypress-utils in your project, you'll need to add it as a dependency. Assuming you have Node.js and npm installed, you can add the package by running:

npm install --save @processmaker/cypress-utils

Usage

After installing, you can import and use the utilities in your Cypress tests.

First, add some aliases in your cypress.config.js file:

module.exports = defineConfig({
    e2e: {
        setupNodeEvents(on, config) {
            const options = {
                webpackOptions: {
                    resolve: {
                        alias: {
                            "@helpers": "@processmaker/cypress-utils/helpers",
                            "@pages": "@processmaker/cypress-utils/pages",
                            "@selectors": "@processmaker/cypress-utils/selectors",
                            "@support": "@processmaker/cypress-utils/support"
                        },
                    },
                },
            };
        },
        on("file:preprocessor", webpack(options));
    },
});

Then, import and use the utilities in your tests:

import { Login } from "@pages/login";

const login = new Login();

describe("Example Test", () => {
    beforeEach(() => {
        login.navigateToUrl();
        login.login();
    });

    it("Loads the requests page", () => {
        cy.visit("/requests");
        cy.url().should("include", "/requests");
    });
});

cypress-utils's People

Contributors

ana-mauricio avatar github-actions[bot] avatar karlos123testing avatar mayramelisa avatar pablobarrososso avatar paolapellegrini avatar ryancooley avatar wendyfpm avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

mybusybeeinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.