E2e testing: Fix attached DOM issues (#5555)

This commit is contained in:
RachelElysia 2022-05-10 12:50:32 -04:00 committed by GitHub
parent d172128183
commit 5ab79ffba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 8 deletions

View file

@ -88,7 +88,11 @@ describe("Query flow (seeded)", () => {
cy.findByText(/query updated/i).should("be.visible");
});
it("saves an existing query as new query", () => {
cy.getAttached(".name__cell .button--text-link").eq(1).click();
cy.getAttached(".name__cell .button--text-link")
.eq(1)
.within(() => {
cy.findByText(/get authorized/i).click();
});
cy.findByText(/run query/i).should("exist");
cy.getAttached(".ace_scroller")
.click()

View file

@ -636,7 +636,11 @@ describe("Premium tier - Global Admin user", () => {
});
// Access the Settings - Team details page
cy.getAttached("tbody").within(() => {
cy.findByText(/apples/i).click();
cy.getAttached(".name__cell .button--text-link")
.eq(0)
.within(() => {
cy.findByText(/apples/i).click();
});
});
cy.findByText(/apples/i).should("exist");
cy.findByText(/manage users with global access here/i).should("exist");

View file

@ -237,6 +237,7 @@ describe("Premium tier - Team Admin user", () => {
cy.findByText(/advanced/i).should("not.exist");
});
it("creates a new team scheduled query", () => {
cy.getAttached(".no-schedule__cta-buttons").should("exist");
cy.getAttached(".no-schedule__schedule-button").click();
cy.getAttached(".schedule-editor-modal__form").within(() => {
cy.findByText(/select query/i).click();
@ -248,6 +249,7 @@ describe("Premium tier - Team Admin user", () => {
cy.findByText(/successfully added/i).should("be.visible");
});
it("edit a team's scheduled query successfully", () => {
cy.getAttached(".manage-schedule-page");
cy.getAttached("tbody>tr")
.should("have.length", 1)
.within(() => {
@ -265,12 +267,17 @@ describe("Premium tier - Team Admin user", () => {
cy.findByText(/successfully updated/i).should("be.visible");
});
it("remove a team's scheduled query successfully", () => {
cy.getAttached(".manage-schedule-page");
cy.getAttached("tbody>tr")
.should("have.length", 1)
.within(() => {
cy.findByText(/6 hours/i).should("exist");
cy.findByText(/action/i).click();
cy.findByText(/remove/i).click();
cy.getAttached(".Select-placeholder").within(() => {
cy.findByText(/action/i).click();
});
cy.getAttached(".Select-menu").within(() => {
cy.findByText(/remove/i).click();
});
});
cy.getAttached(".remove-scheduled-query-modal .modal-cta-wrap").within(
() => {

View file

@ -216,7 +216,9 @@ describe("Premium tier - Team observer/maintainer user", () => {
cy.contains("Apples").click({ force: true });
cy.contains("Oranges").click({ force: true });
});
cy.contains(/oranges/i);
cy.getAttached(".team_name__cell").within(() => {
cy.findByText(/oranges/i).should("exist");
});
cy.getAttached(".button-wrap")
.contains("button", /add hosts/i)
.click();
@ -251,10 +253,10 @@ describe("Premium tier - Team observer/maintainer user", () => {
it("should render elements according to role-based access controls", () => {
cy.visit("/schedule/manage");
cy.contains(/oranges/i).should("exist");
cy.contains(/advanced/i).should("not.exist");
cy.getAttached(".no-schedule__cta-buttons").within(() => {
cy.findByRole("button", { name: /schedule a query/i }).click();
cy.contains(/advanced/i).should("not.exist");
});
cy.getAttached(".no-schedule__schedule-button").click();
// Schedule a query on maintaining team
cy.getAttached(".schedule-editor-modal__form").within(() => {
cy.findByText(/select query/i).click();

View file

@ -86,8 +86,8 @@ describe("Teams flow (seeded)", () => {
describe("Manage schedules page", () => {
beforeEach(() => {
cy.loginWithCySession();
cy.visit("/schedule/manage");
cy.seedQueries();
cy.visit("/schedule/manage");
});
it("adds a query to team schedule", () => {
cy.getAttached(".manage-schedule-page__header").within(() => {