kibana/x-pack/plugins/security_solution/cypress/support/commands.js
MadameSheema b1f2a6e10f
[SIEM] Cypress renaming (#68659) (#68751)
* updates naming in integration

* updates naming in objects

* updates naming in screens

* updates naming in support

* updates naming in tasks

* fixes failing test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-10 15:14:57 +02:00

41 lines
1.4 KiB
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
Cypress.Commands.add('stubSecurityApi', function (dataFileName) {
cy.on('window:before:load', (win) => {
// @ts-ignore no null, this is a temp hack see issue above
win.fetch = null;
});
cy.server();
cy.fixture(dataFileName).as(`${dataFileName}JSON`);
cy.route('POST', 'api/solutions/security/graphql', `@${dataFileName}JSON`);
});