m3-academy-template-vtexio-.../tests/cypress.config.mjs

26 lines
817 B
JavaScript
Raw Permalink Normal View History

2022-08-11 13:06:07 +00:00
import "dotenv/config";
import { defineConfig } from "cypress";
import { getCurrentVtexEnvironment } from "./utils/getCurrentVtexEnvironment.mjs";
import { vtexWorkspaceLogin } from "./utils/vtexWorkspaceLogin.mjs";
const { workspace, accountName, userEmail } = await getCurrentVtexEnvironment();
const workspaceUrl = `https://${workspace}--${accountName}.myvtex.com`;
const token = await vtexWorkspaceLogin();
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
env: {
authToken: token.stdout.trim(),
},
baseUrl: workspaceUrl,
// pluginsFile: "cypress/plugins/index.js",
supportFile: "cypress/support/e2e.js",
},
viewportWidth: 1920,
viewportHeight: 1080,
});