diff --git a/cypress/integration/free/admin.spec.ts b/cypress/integration/free/admin.spec.ts index f8afef1249..5ec6f235a5 100644 --- a/cypress/integration/free/admin.spec.ts +++ b/cypress/integration/free/admin.spec.ts @@ -19,20 +19,11 @@ describe( cy.stopDockerHost(); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => { cy.loginWithCySession("anna@organization.com", "user123#"); cy.visit("/dashboard"); }); - it("displays intended admin dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/fleet test/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended admin top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -55,6 +46,105 @@ describe( }); }); }); + describe("Dashboard", () => { + beforeEach(() => { + cy.loginWithCySession("anna@organization.com", "user123#"); + cy.visit("/dashboard"); + }); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { beforeEach(() => { cy.loginWithCySession("anna@organization.com", "user123#"); diff --git a/cypress/integration/free/maintainer.spec.ts b/cypress/integration/free/maintainer.spec.ts index 104c46454a..00d710eeb6 100644 --- a/cypress/integration/free/maintainer.spec.ts +++ b/cypress/integration/free/maintainer.spec.ts @@ -19,20 +19,11 @@ describe( cy.stopDockerHost(); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => { cy.loginWithCySession("mary@organization.com", "user123#"); cy.visit("/dashboard"); }); - it("displays intended global maintainer dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/fleet test/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended global maintainer top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -46,6 +37,105 @@ describe( }); }); }); + describe("Dashboard", () => { + beforeEach(() => { + cy.loginWithCySession("mary@organization.com", "user123#"); + cy.visit("/dashboard"); + }); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { beforeEach(() => { cy.loginWithCySession("mary@organization.com", "user123#"); diff --git a/cypress/integration/free/observer.spec.ts b/cypress/integration/free/observer.spec.ts index 0bae4a82e0..d2d0513416 100644 --- a/cypress/integration/free/observer.spec.ts +++ b/cypress/integration/free/observer.spec.ts @@ -14,20 +14,11 @@ describe("Free tier - Observer user", () => { cy.stopDockerHost(); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => { cy.loginWithCySession("oliver@organization.com", "user123#"); cy.visit("/dashboard"); }); - it("displays intended global observer dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/fleet test/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended global observer top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -41,6 +32,105 @@ describe("Free tier - Observer user", () => { }); }); }); + describe("Dashboard", () => { + beforeEach(() => { + cy.loginWithCySession("oliver@organization.com", "user123#"); + cy.visit("/dashboard"); + }); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/fleet test/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { beforeEach(() => { cy.loginWithCySession("oliver@organization.com", "user123#"); diff --git a/cypress/integration/premium/admin.spec.ts b/cypress/integration/premium/admin.spec.ts index 48b11a202c..d76ff6b372 100644 --- a/cypress/integration/premium/admin.spec.ts +++ b/cypress/integration/premium/admin.spec.ts @@ -17,17 +17,8 @@ describe("Premium tier - Admin user", () => { beforeEach(() => cy.loginWithCySession("anna@organization.com", "user123#") ); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => cy.visit("/dashboard")); - it("displays intended global admin dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/all teams/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended global admin top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -50,6 +41,102 @@ describe("Premium tier - Admin user", () => { }); }); }); + describe("Dashboard", () => { + beforeEach(() => cy.visit("/dashboard")); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { beforeEach(() => cy.visit("/hosts/manage")); it("displays team column in hosts table", () => { diff --git a/cypress/integration/premium/maintainer.spec.ts b/cypress/integration/premium/maintainer.spec.ts index c2810fac9d..749aa7228a 100644 --- a/cypress/integration/premium/maintainer.spec.ts +++ b/cypress/integration/premium/maintainer.spec.ts @@ -17,17 +17,8 @@ describe("Premium tier - Maintainer user", () => { beforeEach(() => { cy.loginWithCySession("mary@organization.com", "user123#"); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => cy.visit("/dashboard")); - it("displays intended global maintainer dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/all teams/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended global maintainer top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -41,6 +32,102 @@ describe("Premium tier - Maintainer user", () => { }); }); }); + describe("Dashboard", () => { + beforeEach(() => cy.visit("/dashboard")); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { it("renders elements according to role-based access controls", () => { cy.visit("/hosts/manage"); diff --git a/cypress/integration/premium/observer.spec.ts b/cypress/integration/premium/observer.spec.ts index e69d112526..067f155d64 100644 --- a/cypress/integration/premium/observer.spec.ts +++ b/cypress/integration/premium/observer.spec.ts @@ -18,17 +18,8 @@ describe("Premium tier - Observer user", () => { beforeEach(() => { cy.loginWithCySession("oliver@organization.com", "user123#"); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => cy.visit("/dashboard")); - it("displays intended global observer dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/all teams/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.getAttached(".activity-feed").should("exist"); - }); - }); it("displays intended global observer top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -42,6 +33,102 @@ describe("Premium tier - Observer user", () => { }); }); }); + describe("Dashboard", () => { + beforeEach(() => cy.visit("/dashboard")); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + cy.getAttached(".activity-feed").should("exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/all teams/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); describe("Manage hosts page", () => { beforeEach(() => cy.visit("/hosts/manage")); it("should render elements according to role-based access controls", () => { diff --git a/cypress/integration/premium/team_maintainer_observer.spec.ts b/cypress/integration/premium/team_maintainer_observer.spec.ts index 60a5d60c32..31876e8cc1 100644 --- a/cypress/integration/premium/team_maintainer_observer.spec.ts +++ b/cypress/integration/premium/team_maintainer_observer.spec.ts @@ -17,17 +17,8 @@ describe("Premium tier - Team observer/maintainer user", () => { beforeEach(() => { cy.loginWithCySession("marco@organization.com", "user123#"); }); - describe("Dashboard and navigation", () => { + describe("Navigation", () => { beforeEach(() => cy.visit("/dashboard")); - it("displays intended team maintainer and team observer dashboard", () => { - cy.getAttached(".homepage__wrapper").within(() => { - cy.findByText(/apples/i).should("exist"); - cy.getAttached(".hosts-summary").should("exist"); - cy.getAttached(".hosts-status").should("exist"); - cy.getAttached(".home-software").should("exist"); - cy.get(".activity-feed").should("not.exist"); - }); - }); it("displays intended team maintainer and team observer top navigation", () => { cy.getAttached(".site-nav-container").within(() => { cy.findByText(/hosts/i).should("exist"); @@ -41,6 +32,103 @@ describe("Premium tier - Team observer/maintainer user", () => { }); }); }); + describe("Dashboard", () => { + beforeEach(() => cy.visit("/dashboard")); + it("displays cards for all platforms", () => { + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/apples/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-software").should("exist"); + // "get" because we expect it not to exist + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/apples/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/apples/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("displays cards for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.getAttached(".homepage__wrapper").within(() => { + cy.findByText(/apples/i).should("exist"); + cy.getAttached(".hosts-summary").should("exist"); + cy.getAttached(".hosts-status").should("exist"); + cy.getAttached(".home-munki").should("exist"); + cy.getAttached(".home-mdm").should("exist"); + // "get" because we expect it not to exist + cy.get(".home-software").should("not.exist"); + cy.get(".activity-feed").should("not.exist"); + }); + }); + it("views all hosts for all platforms", () => { + cy.findByText(/view all hosts/i).click(); + cy.get(".manage-hosts__label-block").should("not.exist"); + }); + it("views all hosts for windows only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/windows/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/windows/i).should("exist"); + }); + }); + }); + it("views all hosts for linux only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/linux/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/linux/i).should("exist"); + }); + }); + }); + it("views all hosts for macOS only", () => { + cy.getAttached(".homepage__platforms").within(() => { + cy.getAttached(".Select-control").click(); + cy.findByText(/macos/i).click(); + }); + cy.findByText(/view all hosts/i).click(); + cy.getAttached(".manage-hosts__label-block").within(() => { + cy.getAttached(".title").within(() => { + cy.findByText(/macos/i).should("exist"); + }); + }); + }); + }); }); describe("Team observer", () => { beforeEach(() => {