Temporarily comment out failing e2e tests and add coverage to manual QA (#1859)

- Commented out the following e2e tests because they're consistently failing in the GitHub CI:
  - Delete a host from the **Host details** page
  - Query a host from the **Host details** page
  - As a global maintainer, delete a host
- Add coverage for the commented out tests in the manual QA doc
This commit is contained in:
noahtalerman 2021-08-30 15:34:28 -04:00 committed by GitHub
parent 44b66a8f27
commit 63df5881c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 99 additions and 82 deletions

View file

@ -61,95 +61,101 @@ describe(
}
);
it("Can delete a host from host details page", () => {
let hostname = "";
// Test commented out
// Pending fix to prevent consistent failing in GitHub
cy.visit("/hosts/manage");
// it("Can delete a host from host details page", () => {
// let hostname = "";
cy.get("tbody").within(() => {
cy.get(".button--text-link").first().as("hostLink");
});
// cy.visit("/hosts/manage");
cy.get("@hostLink")
// Set hostname variable for later assertions
.then((el) => {
console.log(el);
hostname = el.text();
return el;
})
.click()
.then(() => {
cy.findByText(/about this host/i).should("exist");
cy.findByText(hostname).should("exist");
// cy.get("tbody").within(() => {
// cy.get(".button--text-link").first().as("hostLink");
// });
// Open delete host modal and cancel
cy.get('img[alt="Delete host icon"]').click();
cy.get(".modal__modal_container").within(() => {
cy.findByText(/delete host/i).should("exist");
cy.findByRole("button", { name: /cancel/i }).click();
});
cy.findByText(/delete host/i).should("not.exist");
// cy.get("@hostLink")
// // Set hostname variable for later assertions
// .then((el) => {
// console.log(el);
// hostname = el.text();
// return el;
// })
// .click()
// .then(() => {
// cy.findByText(/about this host/i).should("exist");
// cy.findByText(hostname).should("exist");
// Open delete host modal and delete host
cy.get('img[alt="Delete host icon"]').click();
cy.get(".modal__modal_container")
.within(() => {
cy.findByText(/delete host/i).should("exist");
cy.findByRole("button", { name: /delete/i }).click();
})
.then(() => {
cy.findByText(/successfully deleted/i).should("exist");
cy.findByText(/kinda empty in here/i).should("exist");
cy.findByText(/about this host/i).should("not.exist");
cy.findByText(hostname).should("not.exist");
});
});
});
// // Open delete host modal and cancel
// cy.get('img[alt="Delete host icon"]').click();
// cy.get(".modal__modal_container").within(() => {
// cy.findByText(/delete host/i).should("exist");
// cy.findByRole("button", { name: /cancel/i }).click();
// });
// cy.findByText(/delete host/i).should("not.exist");
it("Can query a host from host details page", () => {
cy.seedQueries();
// // Open delete host modal and delete host
// cy.get('img[alt="Delete host icon"]').click();
// cy.get(".modal__modal_container")
// .within(() => {
// cy.findByText(/delete host/i).should("exist");
// cy.findByRole("button", { name: /delete/i }).click();
// })
// .then(() => {
// cy.findByText(/successfully deleted/i).should("exist");
// cy.findByText(/kinda empty in here/i).should("exist");
// cy.findByText(/about this host/i).should("not.exist");
// cy.findByText(hostname).should("not.exist");
// });
// });
// });
let hostname = "";
// Test commented out
// Pending fix to prevent consistent failing in GitHub
cy.visit("/hosts/manage");
// it("Can query a host from host details page", () => {
// cy.seedQueries();
cy.get("tbody").within(() => {
cy.get(".button--text-link").first().as("hostLink");
});
// let hostname = "";
cy.get("@hostLink")
// Set hostname variable for later assertions
.then((el) => {
hostname = el.text();
return el;
})
.click()
.then(() => {
cy.findByText(/about this host/i).should("exist");
cy.findByText(hostname).should("exist");
// cy.visit("/hosts/manage");
// Open query host modal and cancel
cy.get('img[alt="Query host icon"]').click();
cy.get(".modal__modal_container").within(() => {
cy.findByText(/select a query/i).should("exist");
cy.get(".modal__ex").click();
});
cy.findByText(/select a query/i).should("not.exist");
// cy.get("tbody").within(() => {
// cy.get(".button--text-link").first().as("hostLink");
// });
// Open query host modal and select query
cy.get('img[alt="Query host icon"]').click();
cy.get(".modal__modal_container")
.within(() => {
cy.findByText(/select a query/i).should("exist");
cy.findByText(/detect presence/i).click();
})
.then(() => {
cy.findByText(/edit & run query/i).should("exist");
cy.get(".target-select").within(() => {
cy.findByText(hostname).should("exist");
});
});
});
});
// cy.get("@hostLink")
// // Set hostname variable for later assertions
// .then((el) => {
// hostname = el.text();
// return el;
// })
// .click()
// .then(() => {
// cy.findByText(/about this host/i).should("exist");
// cy.findByText(hostname).should("exist");
// // Open query host modal and cancel
// cy.get('img[alt="Query host icon"]').click();
// cy.get(".modal__modal_container").within(() => {
// cy.findByText(/select a query/i).should("exist");
// cy.get(".modal__ex").click();
// });
// cy.findByText(/select a query/i).should("not.exist");
// // Open query host modal and select query
// cy.get('img[alt="Query host icon"]').click();
// cy.get(".modal__modal_container")
// .within(() => {
// cy.findByText(/select a query/i).should("exist");
// cy.findByText(/detect presence/i).click();
// })
// .then(() => {
// cy.findByText(/edit & run query/i).should("exist");
// cy.get(".target-select").within(() => {
// cy.findByText(hostname).should("exist");
// });
// });
// });
// });
}
);

View file

@ -53,10 +53,13 @@ describe(
});
cy.contains("button", /transfer/i).should("not.exist");
cy.contains("button", /delete/i)
.should("exist")
.click();
cy.contains("button", /cancel/i).click();
// Test commented out
// Pending fix to prevent consistent failing in GitHub
// cy.contains("button", /delete/i)
// .should("exist")
// .click();
// cy.contains("button", /cancel/i).click();
cy.contains("button", /query/i).click();
cy.contains("button", /create custom query/i).click();

View file

@ -56,6 +56,14 @@ go run agent.go --host_count 200 --enroll_secret <your enroll secret goes here>
After about 10 seconds, the Fleet UI should be populated with 200 simulated hosts.
### Host details page
Select a host from the "Hosts" table as a global user with the Maintainer role.
You should be able to see and select the "Delete" button on this host's **Host details** page.
You should be able to see and select the "Query" button on this host's **Host details** page.
### Label flow
`Flow is covered by e2e testing`