Skip to content

Commit

Permalink
Change cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed May 15, 2020
1 parent 472361d commit c522ded
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { goToEditExternalConnection } from '../tasks/all_cases';
import {
addServiceNowConnector,
openAddNewConnectorOption,
saveChanges,
selectLastConnectorCreated,
} from '../tasks/configure_cases';
import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
Expand All @@ -37,7 +36,6 @@ describe('Cases connectors', () => {
cy.get(TOASTER).should('have.text', "Created 'New connector'");

selectLastConnectorCreated();
saveChanges();

cy.wait('@saveConnector', { timeout: 10000 })
.its('status')
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/cypress/screens/configure_cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

export const ADD_NEW_CONNECTOR_OPTION_LINK =
'[data-test-subj="case-configure-add-connector-button"]';
export const ADD_NEW_CONNECTOR_DROPDOWN_BUTTON =
'[data-test-subj="dropdown-connector-add-connector"]';

export const CONNECTOR = (id: string) => {
return `[data-test-subj='dropdown-connector-${id}']`;
Expand Down
10 changes: 3 additions & 7 deletions x-pack/plugins/siem/cypress/tasks/configure_cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/

import {
ADD_NEW_CONNECTOR_OPTION_LINK,
ADD_NEW_CONNECTOR_DROPDOWN_BUTTON,
CONNECTOR,
CONNECTOR_NAME,
CONNECTORS_DROPDOWN,
PASSWORD,
SAVE_BTN,
SAVE_CHANGES_BTN,
SERVICE_NOW_CONNECTOR_CARD,
URL,
USERNAME,
Expand All @@ -33,15 +32,12 @@ export const openAddNewConnectorOption = () => {
cy.get(MAIN_PAGE).then($page => {
if ($page.find(SERVICE_NOW_CONNECTOR_CARD).length !== 1) {
cy.wait(1000);
cy.get(ADD_NEW_CONNECTOR_OPTION_LINK).click({ force: true });
cy.get(CONNECTORS_DROPDOWN).click({ force: true });
cy.get(ADD_NEW_CONNECTOR_DROPDOWN_BUTTON).click();
}
});
};

export const saveChanges = () => {
cy.get(SAVE_CHANGES_BTN).click();
};

export const selectLastConnectorCreated = () => {
cy.get(CONNECTORS_DROPDOWN).click({ force: true });
cy.get('@createConnector')
Expand Down

0 comments on commit c522ded

Please sign in to comment.