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

Add e2e embedding `jwt` helper (#20853)

parent 5bffa46e
No related branches found
No related tags found
No related merge requests found
......@@ -27,5 +27,6 @@ export * from "./helpers/e2e-custom-column-helpers";
export * from "./helpers/e2e-dimension-list-helpers";
export * from "./helpers/e2e-downloads-helpers";
export * from "./helpers/e2e-bi-basics-helpers";
export * from "./helpers/e2e-embedding-helpers";
Cypress.on("uncaught:exception", (err, runnable) => false);
#!/usr/bin/env node
/*eslint-disable import/no-commonjs */
const process = require("process");
const jwt = require("jsonwebtoken");
const payload = process.argv[2];
const METABASE_SECRET_KEY = process.argv[3];
const token = jwt.sign(payload, METABASE_SECRET_KEY);
console.log(token);
import { METABASE_SECRET_KEY } from "__support__/e2e/cypress_data";
const jwtSignLocation =
"frontend/test/__support__/e2e/external/e2e-jwt-sign.js";
export function visitEmbeddedPage(payload) {
const stringifiedPayload = JSON.stringify(payload);
cy.exec(
`node ${jwtSignLocation} '${stringifiedPayload}' ${METABASE_SECRET_KEY}`,
).then(({ stdout: token }) => {
cy.visit("/embed/question/" + token + "#bordered=true&titled=true");
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment