Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit b6b523e

Browse files
committed
Add e2e tests for new context menu action
1 parent 2356088 commit b6b523e

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

experimental/traffic-portal/cypress/e2e/servers/servers.table.cy.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,44 @@
1515
describe("Servers table page", () => {
1616
beforeEach(() => {
1717
cy.login();
18+
cy.visit("/core/servers");
1819
});
1920
it("Filters servers by hostname", () => {
20-
cy.visit("/core/servers");
2121
cy.get("input[name=fuzzControl]").focus().type("edge");
2222
cy.window().its("location.search").should("contain", "search=edge");
2323
});
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+
});
2458
});

experimental/traffic-portal/src/app/shared/generic-table/generic-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<button mat-flat-button type="button" title="clear all active filters" (click)="clearFilters()"><mat-icon>filter_list</mat-icon> Clear</button>
1818
<button mat-flat-button type="button"*ngFor="let btn of tableTitleButtons" (click)="emitTitleButtonAction(btn.action)">{{btn.text}}</button>
1919
<div class="toggle-columns" role="group" title="Select Table Columns">
20-
<button type="button" mat-flat-button [matMenuTriggerFor]="menu" #trigger="matMenuTrigger">
20+
<button type="button" mat-flat-button aria-label="column visibility menu" [matMenuTriggerFor]="menu" #trigger="matMenuTrigger">
2121
<mat-icon>view_column</mat-icon>&nbsp;
2222
<mat-icon class="caret" [ngClass]="{'rotate': trigger.menuOpen}">expand_more</mat-icon>
2323
</button>

0 commit comments

Comments
 (0)