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

E2E oss/ee versions helpers cleanup (#20775)

* Use human readable names for vars

* Apply new version syntax to the related tests
parent 4cb7eaad
No related branches found
No related tags found
No related merge requests found
export const describeWithToken = Cypress.env("HAS_ENTERPRISE_TOKEN")
? describe
: describe.skip;
export const isEE = Cypress.env("HAS_ENTERPRISE_TOKEN");
export const isOSS = !isEE;
export const describeWithoutToken = !Cypress.env("HAS_ENTERPRISE_TOKEN")
? describe
: describe.skip;
export const describeWithToken = isEE ? describe : describe.skip;
export const describeWithoutToken = isOSS ? describe : describe.skip;
......@@ -3,6 +3,7 @@ import {
popover,
describeWithToken,
mockSessionProperty,
isEE,
} from "__support__/e2e/cypress";
function typeField(label, value) {
......@@ -155,7 +156,7 @@ describe("scenarios > admin > databases > add", () => {
});
it("EE should ship with Oracle and Vertica as options", () => {
cy.onlyOn(!!Cypress.env("HAS_ENTERPRISE_TOKEN"));
cy.onlyOn(isEE);
cy.visit("/admin/databases/create");
cy.contains("Database type")
......
......@@ -5,6 +5,8 @@ import {
describeWithToken,
setupMetabaseCloud,
describeWithoutToken,
isOSS,
isEE,
} from "__support__/e2e/cypress";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
......@@ -17,7 +19,7 @@ describe("scenarios > admin > settings", () => {
});
it("should prompt admin to migrate to the hosted instance", () => {
cy.skipOn(!!Cypress.env("HAS_ENTERPRISE_TOKEN"));
cy.onlyOn(isOSS);
cy.visit("/admin/settings/setup");
cy.findByText("Have your server maintained for you.");
cy.findByText("Migrate to Metabase Cloud.");
......@@ -240,9 +242,7 @@ describe("scenarios > admin > settings", () => {
});
it("should display the order of the settings items consistently between OSS/EE versions (metabase#15441)", () => {
const lastItem = Cypress.env("HAS_ENTERPRISE_TOKEN")
? "Whitelabel"
: "Caching";
const lastItem = isEE ? "Whitelabel" : "Caching";
cy.visit("/admin/settings/setup");
cy.get(".AdminList .AdminList-item")
......
import { restore, visitQuestion } from "__support__/e2e/cypress";
import { restore, visitQuestion, isEE, isOSS } from "__support__/e2e/cypress";
const embeddingPage = "/admin/settings/embedding_in_other_applications";
const licenseUrl = "https://metabase.com/license/embedding";
......@@ -6,9 +6,6 @@ const upgradeUrl = "https://www.metabase.com/upgrade/";
const licenseExplanation = `In plain English, when you embed charts or dashboards from Metabase in your own application, that application isn't subject to the Affero General Public License that covers the rest of Metabase, provided you keep the Metabase logo and the "Powered by Metabase" visible on those embeds. You should, however, read the license text linked above as that is the actual license that you will be agreeing to by enabling this feature.`;
const isEE = Cypress.env("HAS_ENTERPRISE_TOKEN");
const isOSS = !isEE;
describe("scenarios > embedding > smoke tests", () => {
beforeEach(() => {
restore();
......
import { restore } from "__support__/e2e/cypress";
import { restore, isEE } from "__support__/e2e/cypress";
describe.skip("issue 18021", () => {
beforeEach(() => {
// Run the test only for EE version
cy.onlyOn(!!Cypress.env("HAS_ENTERPRISE_TOKEN"));
cy.onlyOn(isEE);
restore();
cy.signInAsAdmin();
......
......@@ -5,6 +5,7 @@ import {
popover,
sidebar,
mockSlackConfigured,
isOSS,
} from "__support__/e2e/cypress";
import { USERS } from "__support__/e2e/cypress_data";
const { admin } = USERS;
......@@ -276,7 +277,7 @@ describe("scenarios > dashboard > subscriptions", () => {
describe("OSS email subscriptions", () => {
beforeEach(() => {
cy.skipOn(!!Cypress.env("HAS_ENTERPRISE_TOKEN"));
cy.onlyOn(isOSS);
cy.visit(`/dashboard/1`);
setupSMTP();
});
......
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