Skip to content
Snippets Groups Projects
Unverified Commit fb8dc87c authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Improve Cypress helper functions with log messages (#13749) [ci skip]

- Adds helpful log message to various helper functions in `frontend/test/__support__/cypress.js`.
    - `--- Logging in as ${user} ---` to `signIn()`
    - `--- Signing out ---` to `signOut()` and
    - `--- Restore Data Set ---` to `restore()`
parent d1eef9a1
Branches
Tags
No related merge requests found
......@@ -36,15 +36,19 @@ export const USERS = {
};
export function signIn(user = "admin") {
cy.log(`**--- Logging in as ${user} ---**`);
cy.request("POST", "/api/session", USERS[user]);
}
export function signOut() {
cy.log(`**--- Signing out ---**`);
cy.clearCookie("metabase.SESSION");
}
export function signInAsAdmin() {
signIn("admin");
}
export function signInAsNormalUser() {
signIn("normal");
}
......@@ -52,7 +56,9 @@ export function signInAsNormalUser() {
export function snapshot(name) {
cy.request("POST", `/api/testing/snapshot/${name}`);
}
export function restore(name = "default") {
cy.log(`**--- Restore Data Set ---**`);
cy.request("POST", `/api/testing/restore/${name}`);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment