kibana/x-pack/plugins/security_solution/cypress/tasks/security_header.ts
MadameSheema 089e1474a0
[Security Solution] Improves detections tests (#77295) (#78739)
* improves 'Creates and activates a new custom rule' test

* fixes constant problem

* improves 'Creates and activates a new custom rule with override option' test

* improves 'Creates and activates a new threshold rule' test

* refactor

* fixes type check issue

* improves assertions

* removes unused code

* changes variables for constants

* improves 'waitForTheRuleToBeExecuted' test

* improves readability

* fixes jenkins error

* refactor

* refactor

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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-29 17:54:18 +02:00

27 lines
832 B
TypeScript

/*
* 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.
*/
import { KQL_INPUT, REFRESH_BUTTON } from '../screens/security_header';
export const clearSearchBar = () => {
cy.get(KQL_INPUT).clear().type('{enter}');
};
export const kqlSearch = (search: string) => {
cy.get(KQL_INPUT).type(search);
};
export const navigateFromHeaderTo = (page: string) => {
cy.get(page).click({ force: true });
};
export const refreshPage = () => {
cy.get(REFRESH_BUTTON).click({ force: true }).invoke('text').should('not.equal', 'Updating');
};
export const waitForThePageToBeUpdated = () => {
cy.get(REFRESH_BUTTON).should('not.equal', 'Updating');
};