From 8a77d64e655ca41a05d1a2ccc46dc13c28503a6c Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Wed, 16 Jun 2021 13:39:51 -0400 Subject: [PATCH] Test basic global observer only (#1101) --- cypress/integration/basic/observer.spec.ts | 35 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/cypress/integration/basic/observer.spec.ts b/cypress/integration/basic/observer.spec.ts index 8ec713423c..c60272719c 100644 --- a/cypress/integration/basic/observer.spec.ts +++ b/cypress/integration/basic/observer.spec.ts @@ -5,17 +5,48 @@ if (Cypress.env("FLEET_TIER") === "basic") { cy.login(); cy.seedBasic(); cy.seedQueries(); + cy.addDockerHost(); cy.logout(); }); - it("Can perform the appropriate actions", () => { + afterEach(() => { + cy.stopDockerHost(); + }); + + it("Can perform the appropriate basic global observer actions", () => { cy.login("oliver@organization.com", "user123#"); cy.visit("/"); // Ensure page is loaded cy.contains("All hosts"); - // TODO write the test! + // Host manage page: Can see team column + cy.visit("/hosts/manage"); + + cy.get("thead").within(() => { + cy.findByText(/team/i).should("exist"); + }); + + // Host details page: Can see team on host + cy.get("tbody").within(() => { + // Test host text varies + cy.findByRole("button").click(); + }); + cy.get(".title").within(() => { + cy.findByText("Team").should("exist"); + }); + + // Query pages: Can see team in select targets dropdown + cy.visit("/queries/manage"); + + cy.findByText(/detect presence/i).click(); + + cy.findByRole("button", { name: /run query/i }).click(); + + cy.get(".target-select").within(() => { + cy.findByText(/Label name, host name, IP address, etc./i).click(); + cy.findByText(/teams/i).should("exist"); + }); }); it("Should verify Teams on Hosts page", () => {