Skip to content

Commit

Permalink
adjusting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Dec 11, 2023
1 parent 19c88d5 commit 191ad94
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ describe('Cases', { tags: ['@ess', '@serverless'] }, () => {
);
cy.get(CASE_DETAILS_USERNAMES)
.eq(REPORTER)
.should('have.text', Cypress.env(ELASTICSEARCH_USERNAME));
.should('contain', Cypress.env(ELASTICSEARCH_USERNAME));
cy.get(CASE_DETAILS_USERNAMES)
.eq(PARTICIPANTS)
.should('have.text', Cypress.env(ELASTICSEARCH_USERNAME));
.should('contain', Cypress.env(ELASTICSEARCH_USERNAME));
cy.get(CASE_DETAILS_TAGS).should('have.text', expectedTags);

EXPECTED_METRICS.forEach((metric) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@ describe('Overview Page', { tags: ['@ess', '@serverless'] }, () => {
});
});

describe('Favorite Timelines', () => {
describe('Favorite Timelines', { tags: ['@brokenInServerless'] }, () => {
it('should appear on overview page', () => {
createTimeline(getTimeline())
.then((response) => response.body.data.persistTimeline.timeline.savedObjectId)
.then((timelineId: string) => {
favoriteTimeline({ timelineId, timelineType: 'default' }).then(() => {
visitWithTimeRange(OVERVIEW_URL);
cy.get('[data-test-subj="overview-recent-timelines"]').should(
'contain',
getTimeline().title
);
favoriteTimeline({ timelineId, timelineType: 'default' }).then((response) => {
expect(response.status).to.eq(200);
});
});
visitWithTimeRange(OVERVIEW_URL);
cy.get('[data-test-subj="overview-recent-timelines"]').should('contain', getTimeline().title);
});
});
});
Expand Down
11 changes: 9 additions & 2 deletions x-pack/test/security_solution_cypress/cypress/screens/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { IS_SERVERLESS, CLOUD_SERVERLESS } from '../env_var_names_constants';
import { getDataTestSubjectSelector } from '../helpers/common';
import { GLOBAL_FILTERS_CONTAINER } from './date_picker';

Expand Down Expand Up @@ -204,9 +205,15 @@ export const ALERT_ASSIGNEES_SELECT_PANEL =
export const ALERT_ASSIGNEES_UPDATE_BUTTON =
'[data-test-subj="securitySolutionAssigneesApplyButton"]';

export const ALERT_USER_AVATAR = (assignee: string) =>
`[data-test-subj="securitySolutionUsersAvatar-${assignee}"][title='${assignee}']`;
export const ALERT_USER_AVATAR = (assignee: string) => {
let expectedAssignee = assignee;

if (Cypress.env(IS_SERVERLESS) && !Cypress.env(CLOUD_SERVERLESS)) {
expectedAssignee = `test ${expectedAssignee}`;
}

return `[data-test-subj^="securitySolutionUsersAvatar-"][title='${expectedAssignee}']`;
};
export const ALERT_AVATARS_PANEL = '[data-test-subj="securitySolutionUsersAvatarsPanel"]';

export const ALERT_ASIGNEES_COLUMN =
Expand Down

0 comments on commit 191ad94

Please sign in to comment.