diff --git a/cypress/integration/basic/observer.spec.ts b/cypress/integration/basic/observer.spec.ts index c60272719c..7c0decb52d 100644 --- a/cypress/integration/basic/observer.spec.ts +++ b/cypress/integration/basic/observer.spec.ts @@ -5,7 +5,7 @@ if (Cypress.env("FLEET_TIER") === "basic") { cy.login(); cy.seedBasic(); cy.seedQueries(); - cy.addDockerHost(); + cy.addDockerHost("apples"); cy.logout(); }); @@ -49,25 +49,20 @@ if (Cypress.env("FLEET_TIER") === "basic") { }); }); - it("Should verify Teams on Hosts page", () => { - cy.login("marco@organization.com", "user123#"); + // Pseudo code for team observer only + // TODO: Rebuild this test according to new manual QA + it("Can perform the appropriate basic team observer only actions", () => { + cy.login("toni@organization.com", "user123#"); cy.visit("/hosts/manage"); cy.findByText("All hosts which have enrolled in Fleet").should("exist"); - // TODO: can see the "Team" column in the Hosts table - // cy.contains(".table-container .data-table__table th", "Team").should("be.visible"); - }); - - it("Should verify hidden items on Hosts page", () => { - cy.login("marco@organization.com", "user123#"); - cy.visit("/hosts/manage"); - cy.findByText("Packs").should("not.exist"); - cy.findByText("Queries").should("not.exist"); + cy.findByText("Settings").should("not.exist"); - // TODO: can see the "Team" column in the Hosts table - // cy.contains(".table-container .data-table__table th", "Team").should("be.visible"); + cy.contains(".table-container .data-table__table th", "Team").should( + "be.visible" + ); }); }); } diff --git a/tools/api/fleet/teams/create_basic b/tools/api/fleet/teams/create_basic index 785e219506..39e873d02e 100755 --- a/tools/api/fleet/teams/create_basic +++ b/tools/api/fleet/teams/create_basic @@ -75,3 +75,20 @@ data='{ ] }' curl -X POST $CURL_FLAGS -H "Authorization: Bearer $TOKEN" "$SERVER_URL/$create_user_endpoint" -d "$data" --insecure + +# Create Toni +data='{ + "name": "Toni", + "username": "Toni", + "email": "toni@organization.com", + "password": "user123#", + "invited_by": 1, + "global_role": null, + "teams": [ + { + "id": 1, + "role": "observer" + } + ] +}' +curl -X POST $CURL_FLAGS -H "Authorization: Bearer $TOKEN" "$SERVER_URL/$create_user_endpoint" -d "$data" --insecure