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", () => {