fleet/cypress/integration/basic/observer.spec.ts
Martavis Parker 672db9e2a7
Host Status Dropdown (#1556)
* #1372 created dropdown for status

* #1372 fixed default state for dropdown

* #1372 added help text and styling

* clean up

* fixed linting

* created changes log

* fixed e2e test

* created new header

* clean up

* added logic to edit and delete label using icons

* reworked selectedFilter to support status & label

* fixed multiple params in url

* comment clean up

* fixed tests

* linting fixes

* fixed height of status dropdown

* bug fix for selecting status 1st, label 2nd

* fixed e2e test

* minor style fix for side panel label scroll

* fixed label e2e test

* removed SQL editor for label selection

* removed edit and delete for platform labels

* fixed bugs loading hosts for every label click

* fixed linting

* fixed basic e2e test

* fixed observer basic e2e test

* modified changes file

* fixed bug with label replacement logic for url
2021-08-06 15:09:49 -07:00

74 lines
2.1 KiB
TypeScript

describe("Basic tier - Observer user", () => {
beforeEach(() => {
cy.setup();
cy.login();
cy.seedBasic();
cy.seedQueries();
cy.addDockerHost("apples");
cy.logout();
});
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");
// 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");
});
cy.contains("button", /transfer/i).should("not.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/i }).click();
cy.get(".target-select").within(() => {
cy.findByText(/Label name, host name, IP address, etc./i).click();
cy.findByText(/teams/i).should("exist");
});
});
// 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("Hosts").should("exist");
// Nav restrictions
cy.findByText(/settings/i).should("not.exist");
cy.findByText(/schedule/i).should("not.exist");
cy.visit("/settings/organization");
cy.findByText(/you do not have permissions/i).should("exist");
cy.visit("/packs/manage");
cy.findByText(/you do not have permissions/i).should("exist");
cy.visit("/schedule/manage");
cy.findByText(/you do not have permissions/i).should("exist");
cy.contains(".table-container .data-table__table th", "Team").should(
"be.visible"
);
});
});