Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Removing cy.session from Cypress tests #170969

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-an
## Security Solution sub teams - security-engineering-productivity
/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror

Expand Down
13 changes: 3 additions & 10 deletions x-pack/test/security_solution_cypress/cypress/tasks/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export interface User {
}

export const loginWithUser = (user: User): void => {
cy.session(user, () => {
loginWithUsernameAndPassword(user.username, user.password);
});
loginWithUsernameAndPassword(user.username, user.password);
};

/**
Expand Down Expand Up @@ -129,9 +127,7 @@ const loginWithRole = (role: SecurityRoleName): void => {
const password = 'changeme';

cy.log(`origin: ${Cypress.config().baseUrl}`);
cy.session(role, () => {
loginWithUsernameAndPassword(role, password);
});
loginWithUsernameAndPassword(role, password);
};

/**
Expand All @@ -154,10 +150,7 @@ const loginViaEnvironmentCredentials = (): void => {

const username = Cypress.env(ELASTICSEARCH_USERNAME);
const password = Cypress.env(ELASTICSEARCH_PASSWORD);

cy.session([username, password], () => {
loginWithUsernameAndPassword(username, password);
});
loginWithUsernameAndPassword(username, password);
};

/**
Expand Down
Loading