2.2.3 • Published 9 days ago

cypress-crud v2.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

Cypress-Crud Introduction

Index

Structure of the files

Type of Functions

Support

Pre-requisitos

NodeJS must be installed and Cypress must be version 10 or higher for this package to function correctly.

 NodeJs
 Cypress version 10 >

Installation

To install the package in your Cypress project, use the command

npm i cypress

npx cypress open

and

configure cypress

npm i cypress-crud

Configuration

The CRUD was designed to automatically add dependencies and configurations to the e2e.js file and the cypress.config.js file, eliminating the need to manually include anything for the library's functionality.

  • e2e.js:
export {
  crudStorage,
} from "cypress-crud/src/gherkin/bdd.js";
import "cypress-plugin-steps";
export const faker = require("generate-datafaker");
import "cypress-crud";
import "cypress-plugin-api";
import "cypress-mochawesome-reporter/register";
import spok from "cy-spok";
// export default spok;
const applyStyles = require("../../node_modules/cypress-crud/src/style");
if (!Cypress.env("styles") && Cypress.env("crudStyles")) applyStyles();
// close json file in variable
import _ from "lodash";
export function clone(json) {
  return _.cloneDeep(json);
}
  • cypress.config.js:
const { defineConfig } = require("cypress");

module.exports = defineConfig({
  reporter: "cypress-mochawesome-reporter",

  e2e: {
    setupNodeEvents(on, config) {
      require("cypress-mochawesome-reporter/plugin")(on);
      on("task", {
        crudLog(message) {
          console.log(message);
          return null;
        },
      });
      // adjust to print size
      on("before:browser:launch", (browser, launchOptions) => {
        if (browser.family === "chromium" && browser.name !== "electron") {
          launchOptions.args.push("--window-size=1500,1200");
        }
        if (browser.name === "electron") {
          launchOptions.preferences.width = 1500;
          launchOptions.preferences.height = 1200;
        }
        if (browser.family === "firefox") {
          launchOptions.args.push("--width=1500");
          launchOptions.args.push("--height=1200");
        }
        return launchOptions;
      });
    },
    testIsolation: false, //  in e2e:{}
    experimentalRunAllSpecs: true, // in e2e:{}
  },
});
  • cypress.env.json:
{
  "environment": "QA",
  "QA": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },
  "PROD": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },
  "DEV": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },

  "screenshot": false, // active for screenshot un mod run
  "crudStyles": true
  // "title": "TESTING",
  // "subTitle": "Project in Cypress"
}
  • commands.js:
// CREATE COUNTER IMPORT IN FILE .CY.JS

IMPORT IN FILE  // import { des, its } from "../support/commands";

const counter = window;
let compare;
if (!counter.des) {
  counter.des = 1;
  counter.its = 1;
}
const confer = () => counter.des;
console.log(confer());

export let des = () => {
  return String(counter.des++).padStart(2, "0") + " ➠ "  ;
};
export let its = () => {
  if (!compare || confer() !== compare) {
    counter.its = 1;
    compare = confer();
  }
  return String(counter.its++).padStart(2, "0") + " - " ;
};
  • env_qa.js:
const { defineConfig } = require("cypress");

const config = require("./cypress.config");

const e2e = {
  ...config.e2e,
  env: {
    endpoint: "https://restcountries.com/v3.1/translation/germany",
    reqres: "https://reqres.in/api/users/2",
    swagger: "https://fakerestapi.azurewebsites.net/api/v1/",
    location: "https://rickandmortyapi.com/api/location",
    ...config.env,
  },

  testIsolation: false, //  in e2e:{}
  experimentalRunAllSpecs: true, // in e2e:{}
  chromeWebSecurity: false,
};

module.exports = defineConfig({
  ...config,
  e2e,
});

// IN PACKAGE.JSON
// "scripts": {
//     "cy:run:qa": "cypress run --config-file env_qa.js"
//   },
  • package.json
// create new environment DEV env_dev.js, env_prod.js
"scripts": {
    "cy:run:qa": "cypress run --config-file env_qa.js",
    "cy:open:qa": "cypress open --config-file env_qa.js",

  }
  • interface

  • cypress-plugin-api: default

Demonstração do recurso

JSON Fixtures:

{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "getUser"
  }
}

OR
{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "getUser"
  }
}

OR

{
    // our req:{}
    "method": "GET",
    "url": "getUser"
}

File test: Pass afterEach

    afterEach(() => {
    cy.crudScreenshot();
  });

Guide to building the project

For your project setup, you need to create a JSON file inside the Fixtures folder. This file can be placed directly in the folder or within a subfolder for better organization according to your project's needs.

Example path: Fixtures/Token/createToken.json

{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

Or in your test file

let obj = {
  req: {
    method: "GET",
    url: "https://reqres.in/api/users/2",
    body: null,
    qs: null,
    headers: {
      "Content-Type": "application/json",
    },
  },
};

Once your JSON file is set up, you can simply invoke the cy.crud function in your test file to make the request.

Observation: If your JSON file is located in the 'fixtures' folder, simply specify the path including the name of the subfolder and the JSON file to access it.

cy.crud({ payload: "examples/jsonExamples" });

Observation: If your JSON file is outside the 'fixtures' folder, it is necessary to use the import statement.

import json from "../examples/jsonExamples";

cy.crud({ payload: json });

Snippets

A snippet has been created to streamline the test construction process.

  • crud
cy.crud({ payload: "" });
  • .save
.save({path:''})
  • .bodyResponse
.bodyResponse({path:''})
  • .resp
.response({path:''})
  • .expects
.expects({path:''})
  • .schema
.schema({schema:''})

Nested json, with the url like this `the code will look for the endpoint or any name given in the <br> `env:{ endpoint: "http....." }` and concatenate with/users

// get_AllUsers.json get_idUser.json ...
{
  "req": {
    "url": "endpoint/users"
  }
}

cy.crud

The cy.crud function facilitates making requests with a specific payload and assessing the response.

Example:

     cy.crud({ payload: "examples/jsonEndpoint" });

save

The 'save' method reserves a value inserted to be used in the future when requested.

Example:

cy.crud({ payload: "token/createToken.json" }).save({ path: "name" });

console.log("storage", crudStorage.save.name);

explanation: Saves the value 'name' in crudStorage

Another way to use save is by passing aliases, providing an alternative name for a stored value, simplifying its reference and usage in your test code.

cy.crud({ payload: "token/createToken.json" }).save({ path: "name", alias: "user_name" });

console.log('storage', crudStorage.save.user_name)

bodyResponse

The bodyResponse function is used to check if the response body contains a specific value at a given path.

cy.crud({ payload: "token/createToken.json" }).bodyResponse({path: "name", eq:"Jam Batista"})

response

The response function performs the same task as the bodyResponse function, i.e., it checks if the response body contains a specific value at a given path.

cy.crud({ payload: "token/createToken.json" }).response({path: "name", eq:"Jam Batista"})

expects

The expects function performs the same task as the previous functions, i.e., it checks if the response body contains a specific value at a given path.

cy.crud({ payload: "token/createToken.json" }).expects({path: "name", eq:"Jam Batista"})

schema

The schema function performs the same task as the validateSchema command. It ensures that the response of a request adheres to the criteria specified in a particular JSON schema. This validation helps confirm whether the returned structure and data align with the expectations defined in the test.

 cy.crud({ payload: "examples/jsonNotAlias" }).schema({schema: "jsonSchema",});

res

The res function serves the same purpose as the response command. It validates if the response body contains a specific value at a given path. This validation is crucial for ensuring that the response meets the expected criteria defined in the test.

  cy.crud({ payload: put }).res({ path: 'job' }, { path: 'name' })

validateSchema

The validateSchema command is used to ensure that the response of a request meets the criteria defined in a specific JSON schema. This is useful for verifying if the returned structure and data are correct according to the test expectations.

  cy.crud({ payload: "examples/jsonNotAlias" }).validateSchema({schema: "jsonSchema",});

write

This function is used to write data to a JSON file in the Cypress fixtures directory. It creates a JSON file with the provided data from the specified request response. This is useful for generating simulated response files for testing purposes.

cy.crud({ payload: "token/createToken.json" }).write({ path: "user/getUser" });

explanation: create json response in cypress/fixtures/user

read

This function is used to read data from a JSON file in the Cypress fixtures directory. It reads the content of the specified JSON file and makes it available for use in the test

cy.crud({ payload: "token/createToken.json" }).read({ path: "user/getUser" });

cy.read({ path: "user/getUser" }).then((json) => {
  console.log(json);
});

explanation: read json response in cypress/fixtures/user

Type Validations

There are two ways to perform validations: within the test file and within the JSON file. Both are designed to facilitate the construction process.

  • JSON Validation fixtures: After creating the JSON, you can use either the 'validation' or 'expects' key:
{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "validation": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "validation":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "validation":{ "path": "name", "eq": "Jam || Batista" }

}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "expects": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "expects":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "expects":{ "path": "name", "eq": "Jam || Batista" }
}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "expect": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "expect":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "expect":{ "path": "name", "eq": "Jam || Batista" },

  // have property in all json

  "expect":{ "property": "name" }
}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "response": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "response":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "response":{ "path": "name", "eq": "Jam || Batista" }
}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "res": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "res":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "res":{ "path": "name", "eq": "Jam || Batista" }
}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "checks": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "checks":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "checks":{ "path": "name", "eq": "Jam || Batista" }
}

OR

{
  "req": { // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "check": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "check":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "check":{ "path": "name", "eq": "Jam || Batista" }
}

OR

{
// our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "headers": {
      "Content-Type": "application/json"
    },
  "check": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "check":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "check":{ "path": "name", "eq": "Jam || Batista" }
}

Schema Validator

Create schema in path fixtures

{
// our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "headers": {
      "Content-Type": "application/json"
    },
    "schema": "schemas/token",
  "check": [{ "path": "status", "eq": 200 }, { "path": "first_name" }, ...],

  //Or To validate just one field

  "check":{ "path": "status", "eq": 200 },

  // Or validate the field with two values

  "check":{ "path": "name", "eq": "Jam || Batista" }
}
  • Test Validation: The bodyResponse, response, res, and expects functions are responsible for this:
cy.crud({ payload: "token/createToken.json" }).bodyResponse({path: "name", eq:"Jam Batista"})
cy.crud({ payload: "token/createToken.json" }).response({path: "name", eq:"Jam Batista"})
cy.crud({ payload: "token/createToken.json" }).expects({path: "name", eq:"Jam Batista"})
cy.crud({ payload: "token/createToken.json" }).res({ path: "job" }, { path: "nam" })
  • Validation type - file Test: You can use this option to validate the nature of the field, whether it's an Object, a Number, a String, etc.
cy.crud({ payload: "token/createToken.json" }).bodyResponse({path: "name", type:"string"})
cy.crud({ payload: "token/createToken.json" }).response({path: "value", eq: 1, type: "number"})
cy.crud({ payload: "token/createToken.json" }).expects({path: "enterprise", type: "object"})
cy.crud({ payload: "token/createToken.json" }).res({ path: "users", type: "array" })

OR

  • Validation type - JSON fixtures: You can use this option to validate the nature of the field, whether it's an Object, a Number, a String, etc.
{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users/2",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "validation": [{ "path": "name", "type": "string" }],
  // OR

  "expects": [{ "path": "value", "eq": 1, "type": "number" }],

  // OR

  "expect": [{ "path": "value", "eq": 1, "type": "number" }],

  // OR

  "response": [{ "path": "enterprise", "type": "object" }],

  // OR

  "res": [{ "path": "users", "type": "array" }],

  // OR

  "checks": [{ "path": "name", "type": "string" }],

  // OR

  "check": [{ "path": "value", "eq": 1, "type": "number" }]
}

Another validation method introduced is the search for specific values, this way saves this value automatically, but to save it with a specific value, just pass the alias, or as.

{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "validation": [{ "search": "Jam" }, { "search": 200, "alias": "value" }],
  //OR
  "expects": [{ "search": "Jam" }, { "search": 200, "as": "status_code" }],
  //OR
  "expect": [{ "search": "Jam" }, { "search": 200 }],
  //OR
  "response": [{ "search": "Jam" }, { "search": 200 }],
  //OR
  "res": [{ "search": "Jam" }, { "search": 200 }],
  //OR
  "checks": [{ "search": "Jam" }, { "search": 200 }],
  //OR
  "check": [{ "search": "Jam" }, { "search": 200 }]
}

Type save

The save is used to Store the provided value so that it can be retrieved and used later as required.

  • File Test: The value located at the path specified by the path parameter, in this case, "access_token", is retrieved and assigned the name "bearer_token" via the alias. This procedure ensures that the "access_token" value can be accessed and used later in the code under the name "bearer_token".
cy.crud({ payload: "token/createToken.json" }).save({ path: "access_token", alias: "bearer_token" // OR as: "bearer_token"});
  • JSON fixtures: The value located in the path defined by the save parameter, here being "access_token".
{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users",
    "body": null,
    "qs": null,
    "headers": {
      "Content-Type": "application/json"
    },
    "save": { "path": "access_token" },
    "save": { "path": "access_token", "as": "token" }
  }
}
  • Search option: By using the search command to locate the desired field, you can choose to save it with a specific value by employing the term 'alias'.

JSON fixtures:

Inside the JSON file located in the fixtures

{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://reqres.in/api/users",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "validation": [{ "search": "access_token", "alias": "bearer_token" }], // OR as: "bearer_token" }],
  //OR
  "expects": [{ "search": "access_token", "alias": "bearer_token" }],
  //OR
  "expect": [{ "search": "access_token", "alias": "bearer_token" }],
  //OR
  "response": [{ "search": "access_token", "alias": "bearer_token" }],
  //OR
  "res": [{ "search": "access_token", "alias": "bearer_token" }],
  //OR
  "checks": [{ "search": "access_token", "alias": "bearer_token" }],
  //OR
  "check": [{ "search": "access_token", "alias": "bearer_token" }]
}

File Test

creating variable

let payload = {
  req: {
    method: "GET",
    url: "https://reqres.in/api/users",
    headers: {
      "Content-Type": "application/json"
    }
  },

  validation: [{search: "access_token", alias: "bearer_token"}],
  //OR
  expects: [{search: "access_token", alias: "bearer_token"}],
  //OR
  expect: [{search: "access_token", alias: "bearer_token"}],
  //OR
  response: [{search: "access_token", alias: "bearer_token"}],
  //OR
  res: [{search: "access_token", alias: "bearer_token"}],
  //OR
  checks: [{search: "access_token", alias: "bearer_token"}],
  //OR
  check: [{search: "access_token", alias: "bearer_token"}]
}

validation method

cy.crud({payload: "examples/jsonExamples"}).bodyResponse({search: "access_token", alias: "bearer_token"})

// OR

cy.crud({payload: "examples/jsonExamples"}).response({search: "access_token", alias: "bearer_token"})

// OR

cy.crud({payload: "examples/jsonExamples"}).expects({search: "access_token", alias: "bearer_token"})

//OR

cy.crud({payload: "examples/jsonExamples"}).res({search: "access_token", alias: "bearer_token"})

Managing values with Save

To reuse the values ​​stored in other requests, simply reference the path in the JSON file within the fixtures, using the value associated with the alias. If an alias was not specified, the values ​​can be accessed directly using whatever is passed in path or search.

Example 1°: In the previous example, we used the search and path parameters to locate the access_token value, which was then stored under the name bearer_token using the alias parameter. In the following example, we will demonstrate how this stored value is utilized in the Authorization. Furthermore, we use replace to adapt and apply the value to other variables, enabling flexible manipulation of this data in different contexts of the request.

{
  "req": {
    // our req:{}
    "method": "POST",
    "url": "https://reqres.in/api/users",
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer {bearer_token}"
    }
  }
}

Example 2°: For scenarios such as appending a value to the URL being passed, simply include the path variable and the value assigned to alias or use the value specified in search and path.

{
  "req": {
    // our req:{}
    "method": "POST",
    "url": "https://reqres.in/api/users",
    "path": "bearer_token",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

Alternatively, in situations where it is necessary to concatenate the stored value with another value to be passed simultaneously, you can simply use / for concatenation. In the following example, the value is stored in the id key, but the request also requires the city to complete. To achieve this, the city is concatenated with the id value stored in the path, as shown below:

{
  "req": {
    // our req:{}
    "method": "POST",
    "url": "https://reqres.in/api/users",
    "path": "id/city",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

//exit example -> https://reqres.in/api/users/123456789/city

Example 3°: For situations requiring validation of the value stored in the alias or specified in the search and path, In the example below, a value has been stored under the key user, eliminating the need to pass the value itself—only the key is required.

{
  "req": {
    // our req:{}
    "method": "POST",
    "url": "https://reqres.in/api/users",
    "headers": {
      "Content-Type": "application/json"
    }
  },
  "validation": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "expects": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "expect": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "response": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "res": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "checks": [{ "path": "name_user", "eq": "{user}" }],
  //OR
  "check": [{ "path": "name_user", "eq": "{user}" }]
}

Use Mock

For requests that require a mock, simply specify the mock variable and provide the path to where the mock is stored.

Example: The file can be found in fixtures in the mocks folder, called json_mock.

{
  "req": {
    "method": "GET",
    "url": "https://demo0065046.mockable.io/",
    "mock": "mocks/json_mock",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

Mock construction:

{
  "response": {
    "status": 200,
    "body": { "authorization": "Bearer" }
  }
}

In this example, the body field directs to the mock file located in the mocks folder, which contains the predefined structure of the fields to be returned in the response.

Validate mock: To validate the mock, you can simply include the checks in the JSON file itself or embed them in the test file.

  • JSON fixtures
{
  "req": {
    // our req:{}
    "method": "GET",
    "url": "https://demo0065046.mockable.io/",
    "mock": "mocks/json_mock",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

crudSafeData

describe(`Test cypress-crud Property search`, () => {
  let data;
  const token =
    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiIxMjM0NTY3ODkwIiwicGFzc3dvcmQiOiJKb2huIERvZSJ9.d7gibg6eK9oxrpcCob-MuNz65NHMWNK1x4otVLyHPCo";

  before(function () {
    cy.crudSafeData(token).then((safe) => {
      crudStorage.save.email_login = safe.key;
      crudStorage.save.password_login = safe.password;
    });
  });

  it("Decode", () => {
    console.log(crudStorage.save);
  });
});

  OUR

  IN CYPRESS.ENV.JSON

  "dataSafe": "token jwt",
  "hideCredentials": true,
  "hideCredentialsOptions": { "body": ["email", "password"] } // change for your paths

  COMPLETE ENV
    env: {
        hideCredentials: true,
        hideCredentialsOptions: {
          headers: ['authorization'],
          auth: ['pass'],
          body: ['username'],
          query: ['password']
        }
      }

   OUR

  CYPRESS.CONFIG.JS

  env:{
  "dataSafe": "token jwt",
  "hideCredentials": true,
  "hideCredentialsOptions": { "body": ["email", "password"] } // change for your paths
  }

  COMPLETE ENV
    env: {
        hideCredentials: true,
        hideCredentialsOptions: {
          headers: ['authorization'],
          auth: ['pass'],
          body: ['username'],
          query: ['password']
        }
      }

hideReport

// in cypress.env.json

 "hideReport": ["body", "headers"]

 // result

 {
  "method": "POST",
  "url": "https://reqres.in/api/users/2",
  "failOnStatusCode": false,
  "body": "hide active in path",
  "headers": "hide active in path"
}
  • Report

To generate the report, the tests must be executed in run mode. Furthermore, to include screenshots of the request payload in the report, a specific configuration needs to be adjusted in the cypress.config.js file and in your test file.

cypress.config.js: To activate the option, simply add screenshot: true

{
  "environment": "QA",
  "QA": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },
  "PROD": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },
  "DEV": {
    "endpoint": "https://restcountries.com/v3.1/translation/germany",
    "reqres": "https://reqres.in/api/users/2",
    "swagger": "https://fakerestapi.azurewebsites.net/api/v1/",
    "location": "https://rickandmortyapi.com/api/location"
  },

  "screenshot": false, // active for screenshot un mod run
  "crudStyles": true
  // "title": "TESTING",
  // "subTitle": "Project in Cypress"
}

Authors and Contributors

This project is the collaborative effort of Jameson Batista and Gabriel Lopes. We are proud to share our work with the community and hope it can inspire and assist other developers.

For tips, inquiries, or just to connect, follow us on LinkedIn:

2.2.3

9 days ago

2.2.2

9 days ago

2.1.9

10 days ago

2.2.1

10 days ago

2.2.0

10 days ago

2.1.6

10 days ago

2.1.5

10 days ago

2.1.8

10 days ago

2.1.7

10 days ago

2.1.4

13 days ago

2.1.3

14 days ago

2.1.2

14 days ago

2.1.1

15 days ago

2.1.0

15 days ago

2.0.46

16 days ago

2.0.45

16 days ago

2.0.44

17 days ago

2.0.42

17 days ago

2.0.43

17 days ago

2.0.40

17 days ago

2.0.41

17 days ago

2.0.39

18 days ago

2.0.37

20 days ago

2.0.38

20 days ago

2.0.35

20 days ago

2.0.36

20 days ago

2.0.33

20 days ago

2.0.34

20 days ago

2.0.31

20 days ago

2.0.32

20 days ago

2.0.30

20 days ago

2.0.28

21 days ago

2.0.29

21 days ago

2.0.27

21 days ago

2.0.26

22 days ago

2.0.24

23 days ago

2.0.25

23 days ago

2.0.23

25 days ago

2.0.22

25 days ago

2.0.21

25 days ago

2.0.19

26 days ago

2.0.20

26 days ago

2.0.18

26 days ago

2.0.17

29 days ago

2.0.16

1 month ago

2.0.15

1 month ago

2.0.13

1 month ago

2.0.14

1 month ago

2.0.11

1 month ago

2.0.12

1 month ago

2.0.9

1 month ago

2.0.8

1 month ago

2.0.10

1 month ago

2.0.7

2 months ago

2.0.5

2 months ago

2.0.6

2 months ago

2.0.3

2 months ago

2.0.4

2 months ago

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

2 months ago

1.9.99

2 months ago

1.9.98

2 months ago

1.9.97

2 months ago

1.9.96

3 months ago

1.9.95

3 months ago

1.9.94

3 months ago

1.9.93

3 months ago

1.9.92

3 months ago

1.9.91

3 months ago

1.9.9

3 months ago

1.9.8

3 months ago

1.9.7

3 months ago

1.9.6

3 months ago

1.9.5

3 months ago

1.9.4

3 months ago

1.9.3

3 months ago

1.9.2

3 months ago

1.9.1

3 months ago

1.9.0

3 months ago

1.8.8

3 months ago

1.8.7

3 months ago

1.8.6

3 months ago

1.8.5

3 months ago

1.8.4

3 months ago

1.8.2

3 months ago

1.8.3

3 months ago

1.8.1

3 months ago

1.8.0

3 months ago

1.7.9

3 months ago

1.7.8

3 months ago

1.7.7

3 months ago

1.7.6

3 months ago

1.7.5

3 months ago

1.7.4

3 months ago

1.7.3

3 months ago

1.7.1

3 months ago

1.7.0

3 months ago

1.6.9

3 months ago

1.6.7

3 months ago

1.6.6

3 months ago

1.6.5

4 months ago

1.6.4

4 months ago

1.6.3

4 months ago

1.6.2

4 months ago

1.6.1

4 months ago

1.5.9

4 months ago

1.5.8

4 months ago

1.5.7

4 months ago

1.4.6

4 months ago

1.4.5

4 months ago

1.4.4

4 months ago

1.4.3

4 months ago

1.5.6

4 months ago

1.5.5

4 months ago

1.5.4

4 months ago

1.5.3

4 months ago

1.5.2

4 months ago

1.5.1

4 months ago

1.5.0

4 months ago

1.4.9

4 months ago

1.4.8

4 months ago

1.4.7

4 months ago

1.4.2

4 months ago

1.4.1

4 months ago

1.3.9

4 months ago

1.3.7

4 months ago

1.3.8

4 months ago

1.1.1

4 months ago

1.2.8

4 months ago

1.1.9

4 months ago

1.2.7

4 months ago

1.1.8

4 months ago

1.3.5

4 months ago

1.2.6

4 months ago

1.1.7

4 months ago

1.3.4

4 months ago

1.2.5

4 months ago

1.1.6

4 months ago

1.3.3

4 months ago

1.2.4

4 months ago

1.1.5

4 months ago

1.3.2

4 months ago

1.2.3

4 months ago

1.1.4

4 months ago

1.3.1

4 months ago

1.2.2

4 months ago

1.1.3

4 months ago

1.2.1

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago