cypress-guerrillamail
Version:
Cypress plugin that helps manipulate login/forgot password flow
38 lines (33 loc) • 1.26 kB
JavaScript
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "cypress-wait-until";
import "./guerrillamail";
if (Cypress.config("hideXHRInCommandLog")) {
const cypressLogOriginal = Cypress.log;
// const cypressLogDomainsHidden = ["fontawesome.com"];
Cypress.log = function (opts, ...other) {
// console.log("opts", opts);
const logFetchIs = ["fetch", "xhr"].includes(opts.displayName);
const logFetchDomainMatch =
logFetchIs ||
(opts.name === "uncaught exception" &&
opts.message.startsWith("Error: Mismatched anonymous define() module"));
if (logFetchDomainMatch) return;
return cypressLogOriginal(opts, ...other);
};
}
// Alternatively you can use CommonJS syntax:
// require('./commands')