|
15 | 15 | describe("Servers table page", () => { |
16 | 16 | beforeEach(() => { |
17 | 17 | cy.login(); |
| 18 | + cy.visit("/core/servers"); |
18 | 19 | }); |
19 | 20 | it("Filters servers by hostname", () => { |
20 | | - cy.visit("/core/servers"); |
21 | 21 | cy.get("input[name=fuzzControl]").focus().type("edge"); |
22 | 22 | cy.window().its("location.search").should("contain", "search=edge"); |
23 | 23 | }); |
| 24 | + it("Queues and clears revalidations on a server", () => { |
| 25 | + cy.get("input[name=fuzzControl]").focus().type("edge"); |
| 26 | + |
| 27 | + // We need to force re-rendering of the table every time we do |
| 28 | + // something, or cypress moves too fast and undoes things it's doing |
| 29 | + // before the effects can be seen. This could be fixed by splitting |
| 30 | + // these into separate tests, but that wouldn't be faster and would have |
| 31 | + // the added drawback that it depends on the initial state of the data |
| 32 | + // and the order in which the tests are run. |
| 33 | + const reload = (): void => { |
| 34 | + cy.reload(); |
| 35 | + cy.get("button[aria-label='column visibility menu']").click(); |
| 36 | + cy.get("input[type=checkbox][name='Reval Pending']").check(); |
| 37 | + cy.get("body").click(); // closes the menu so you can interact with other things. |
| 38 | + }; |
| 39 | + |
| 40 | + reload(); |
| 41 | + |
| 42 | + cy.get(".ag-row:visible").first().rightclick(); |
| 43 | + cy.get("button").contains("Queue Content Revalidation").click(); |
| 44 | + reload(); |
| 45 | + |
| 46 | + cy.get(".ag-cell[col-id=revalPending]").first().should("contain.text", "schedule"); |
| 47 | + cy.get(".ag-row:visible").first().rightclick(); |
| 48 | + cy.get("button").contains("Clear Queued Content Revalidations").click(); |
| 49 | + reload(); |
| 50 | + |
| 51 | + cy.get(".ag-cell[col-id=revalPending]").first().should("contain.text", "done"); |
| 52 | + cy.get(".ag-row:visible").first().rightclick(); |
| 53 | + cy.get("button").contains("Queue Content Revalidation").click(); |
| 54 | + reload(); |
| 55 | + |
| 56 | + cy.get(".ag-cell[col-id=revalPending]").first().should("contain.text", "schedule"); |
| 57 | + }); |
24 | 58 | }); |
0 commit comments