Skip to content

Commit 8e9d99b

Browse files
chore: remove deprecated function validatePagination (#847)
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
1 parent db51964 commit 8e9d99b

File tree

11 files changed

+101
-57
lines changed

11 files changed

+101
-57
lines changed

e2e/tests/ui/pages/Pagination.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -47,53 +47,6 @@ export class Pagination {
4747
await expect(this._pagination.locator("input")).toHaveValue("1");
4848
}
4949

50-
/**
51-
* @deprecated use fixtures/PaginationMatchers instead
52-
*/
53-
async validatePagination() {
54-
// Verify next buttons are enabled as there are more than 11 rows present
55-
const nextPageButton = this._pagination.locator(
56-
"button[data-action='next']",
57-
);
58-
await expect(nextPageButton).toBeVisible();
59-
await expect(nextPageButton).not.toBeDisabled();
60-
61-
// Verify that previous buttons are disabled being on the first page
62-
const prevPageButton = this._pagination.locator(
63-
"button[data-action='previous']",
64-
);
65-
await expect(prevPageButton).toBeVisible();
66-
await expect(prevPageButton).toBeDisabled();
67-
68-
// Verify that navigation button to last page is enabled
69-
const lastPageButton = this._pagination.locator(
70-
"button[data-action='last']",
71-
);
72-
await expect(lastPageButton).toBeVisible();
73-
await expect(lastPageButton).not.toBeDisabled();
74-
75-
// Verify that navigation button to first page is disabled being on the first page
76-
const firstPageButton = this._pagination.locator(
77-
"button[data-action='first']",
78-
);
79-
await expect(firstPageButton).toBeVisible();
80-
await expect(firstPageButton).toBeDisabled();
81-
82-
// Navigate to next page
83-
await nextPageButton.click();
84-
85-
// Verify that previous buttons are enabled after moving to next page
86-
await expect(prevPageButton).toBeVisible();
87-
await expect(prevPageButton).not.toBeDisabled();
88-
89-
// Verify that navigation button to first page is enabled after moving to next page
90-
await expect(firstPageButton).toBeVisible();
91-
await expect(firstPageButton).not.toBeDisabled();
92-
93-
// Moving back to the first page
94-
await firstPageButton.click();
95-
}
96-
9750
// TODO: This seems not belonging here. This matches two entities: Pagination and Table so cannot moved to fixtures/PaginationMatchers.ts. Needs refactoring.
9851
async validateItemsPerPage(columnName: string, table: Table) {
9952
// Verify that only 10 items are displayed

e2e/tests/ui/pages/advisory-details/vulnerabilities/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { VulnerabilitiesTab } from "./VulnerabilitiesTab";
@@ -17,7 +18,15 @@ test.describe.skip("Pagination validations", { tag: "@tier1" }, () => {
1718
);
1819
const pagination = await vulnerabilitiesTab.getPagination();
1920

20-
await pagination.validatePagination();
21+
// Verify first page
22+
await expect(pagination).toBeFirstPage();
23+
await expect(pagination).toHaveNextPage();
24+
25+
// Navigate to next page
26+
await pagination.getNextPageButton().click();
27+
28+
// Verify that previous buttons are enabled after moving to next page
29+
await expect(pagination).toHavePreviousPage();
2130
});
2231

2332
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/advisory-list/pagination.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../assertions";
34
import { test } from "../../fixtures";
45
import { login } from "../../helpers/Auth";
56
import { AdvisoryListPage } from "./AdvisoryListPage";
@@ -13,7 +14,16 @@ test.describe("Pagination validations", { tag: "@tier1" }, () => {
1314
const listPage = await AdvisoryListPage.build(page);
1415

1516
const pagination = await listPage.getPagination();
16-
await pagination.validatePagination();
17+
18+
// Verify first page
19+
await expect(pagination).toBeFirstPage();
20+
await expect(pagination).toHaveNextPage();
21+
22+
// Navigate to next page
23+
await pagination.getNextPageButton().click();
24+
25+
// Verify that previous buttons are enabled after moving to next page
26+
await expect(pagination).toHavePreviousPage();
1727
});
1828

1929
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/package-details/sboms/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { SbomsTab } from "./SbomsTab";
@@ -16,7 +17,15 @@ test.describe.skip("Pagination validations", { tag: "@tier1" }, () => {
1617
});
1718
const pagination = await sbomTab.getPagination();
1819

19-
await pagination.validatePagination();
20+
// Verify first page
21+
await expect(pagination).toBeFirstPage();
22+
await expect(pagination).toHaveNextPage();
23+
24+
// Navigate to next page
25+
await pagination.getNextPageButton().click();
26+
27+
// Verify that previous buttons are enabled after moving to next page
28+
await expect(pagination).toHavePreviousPage();
2029
});
2130

2231
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/package-details/vulnerabilities/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { VulnerabilitiesTab } from "./VulnerabilitiesTab";
@@ -16,7 +17,15 @@ test.describe.skip("Pagination validations", { tag: "@tier1" }, () => {
1617
});
1718
const pagination = await vulnerabilitiesTab.getPagination();
1819

19-
await pagination.validatePagination();
20+
// Verify first page
21+
await expect(pagination).toBeFirstPage();
22+
await expect(pagination).toHaveNextPage();
23+
24+
// Navigate to next page
25+
await pagination.getNextPageButton().click();
26+
27+
// Verify that previous buttons are enabled after moving to next page
28+
await expect(pagination).toHavePreviousPage();
2029
});
2130

2231
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/package-list/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../assertions";
34
import { test } from "../../fixtures";
45
import { login } from "../../helpers/Auth";
56
import { PackageListPage } from "./PackageListPage";
@@ -13,7 +14,15 @@ test.describe("Pagination validations", { tag: "@tier1" }, () => {
1314
const listPage = await PackageListPage.build(page);
1415
const pagination = await listPage.getPagination();
1516

16-
await pagination.validatePagination();
17+
// Verify first page
18+
await expect(pagination).toBeFirstPage();
19+
await expect(pagination).toHaveNextPage();
20+
21+
// Navigate to next page
22+
await pagination.getNextPageButton().click();
23+
24+
// Verify that previous buttons are enabled after moving to next page
25+
await expect(pagination).toHavePreviousPage();
1726
});
1827

1928
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/sbom-details/packages/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { PackagesTab } from "./PackagesTab";
@@ -13,7 +14,15 @@ test.describe("Pagination validations", { tag: "@tier1" }, () => {
1314
const packageTab = await PackagesTab.build(page, "quarkus-bom");
1415
const pagination = await packageTab.getPagination();
1516

16-
await pagination.validatePagination();
17+
// Verify first page
18+
await expect(pagination).toBeFirstPage();
19+
await expect(pagination).toHaveNextPage();
20+
21+
// Navigate to next page
22+
await pagination.getNextPageButton().click();
23+
24+
// Verify that previous buttons are enabled after moving to next page
25+
await expect(pagination).toHavePreviousPage();
1726
});
1827

1928
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/sbom-details/vulnerabilities/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { VulnerabilitiesTab } from "./VulnerabilitiesTab";
@@ -16,7 +17,15 @@ test.describe("Pagination validations", { tag: "@tier1" }, () => {
1617
);
1718
const pagination = await vulnerabilityTab.getPagination();
1819

19-
await pagination.validatePagination();
20+
// Verify first page
21+
await expect(pagination).toBeFirstPage();
22+
await expect(pagination).toHaveNextPage();
23+
24+
// Navigate to next page
25+
await pagination.getNextPageButton().click();
26+
27+
// Verify that previous buttons are enabled after moving to next page
28+
await expect(pagination).toHavePreviousPage();
2029
});
2130

2231
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/sbom-list/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../assertions";
34
import { test } from "../../fixtures";
45
import { login } from "../../helpers/Auth";
56
import { SbomListPage } from "./SbomListPage";
@@ -13,7 +14,15 @@ test.describe("Pagination validations", { tag: "@tier1" }, () => {
1314
const listPage = await SbomListPage.build(page);
1415
const pagination = await listPage.getPagination();
1516

16-
await pagination.validatePagination();
17+
// Verify first page
18+
await expect(pagination).toBeFirstPage();
19+
await expect(pagination).toHaveNextPage();
20+
21+
// Navigate to next page
22+
await pagination.getNextPageButton().click();
23+
24+
// Verify that previous buttons are enabled after moving to next page
25+
await expect(pagination).toHavePreviousPage();
1726
});
1827

1928
test("Items per page validations", async ({ page }) => {

e2e/tests/ui/pages/vulnerability-details/advisories/pagination.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import { expect } from "../../../assertions";
34
import { test } from "../../../fixtures";
45
import { login } from "../../../helpers/Auth";
56
import { AdvisoriesTab } from "./AdvisoriesTab";
@@ -14,7 +15,15 @@ test.describe.skip("Pagination validations", { tag: "@tier1" }, () => {
1415
const advisoriesTab = await AdvisoriesTab.build(page, "CVE-2023-2976");
1516
const pagination = await advisoriesTab.getPagination();
1617

17-
await pagination.validatePagination();
18+
// Verify first page
19+
await expect(pagination).toBeFirstPage();
20+
await expect(pagination).toHaveNextPage();
21+
22+
// Navigate to next page
23+
await pagination.getNextPageButton().click();
24+
25+
// Verify that previous buttons are enabled after moving to next page
26+
await expect(pagination).toHavePreviousPage();
1827
});
1928

2029
test("Items per page validations", async ({ page }) => {

0 commit comments

Comments
 (0)