Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update spec to handle scenario nav
  • Loading branch information
jbdalton committed Jan 9, 2026
commit ba9200afc72160aa931fe9fe4bfe1168605dec7a
18 changes: 18 additions & 0 deletions playwright/pages/item-metadata.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,24 @@ export default class ItemMetadataPage {
);
}

async verifyLanguageText(): Promise<void> {
await expect(this.languageHeading).toBeVisible();
await expect(this.languageText).toContainText(
ItemMetadataPage.EXPECTED_LANGUAGE_VALUE
);
}

async verifyLanguageLinks(): Promise<void> {
const languageLink = this.languageText.getByRole("link");

// If it's visible and has the right text, Playwright has already
// confirmed it's a functional link role.
await expect(languageLink).toBeVisible();
await expect(languageLink).toHaveText(
ItemMetadataPage.EXPECTED_LANGUAGE_VALUE
);
}

async verifyRightsContent(): Promise<void> {
// Structural check: Ensure the element exists and is visible
await expect(this.rightsHeading).toBeVisible();
Expand Down
58 changes: 39 additions & 19 deletions playwright/tests/item-metadata.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ let itemMetadataPage: ItemMetadataPage;

test.beforeEach(async ({ page }) => {
itemMetadataPage = new ItemMetadataPage(page);
await itemMetadataPage.loadPage(ItemMetadataPage.itemResultURL);
});

test.describe("Verify Metadata Fields", () => {
test.describe("Verify Default Test Record", () => {
test.beforeEach(async ({ page }) => {
await itemMetadataPage.loadScenario("DEFAULT");
});

test("should display Title heading and corresponding text", async () => {
await expect(itemMetadataPage.titleHeading).toBeVisible();
await itemMetadataPage.verifyTitleTextContent();
Expand Down Expand Up @@ -49,29 +52,46 @@ test.describe("Verify Metadata Fields", () => {
await itemMetadataPage.verifyCatalogLinkIsPresent();
});
});
});

test.describe("Other Identifiers", () => {
test("should include Shelf Locator", async () => {
await itemMetadataPage.verifyShelfLocatorIsPresent();
test.describe("Other Identifiers", () => {
test("should include Shelf Locator", async () => {
await itemMetadataPage.verifyShelfLocatorIsPresent();
});
});
});

test.describe("Names", () => {
test.beforeEach(async ({ page }) => {
await expect(itemMetadataPage.nameHeading).toBeVisible();
await expect(itemMetadataPage.nameText).toBeVisible();
});
test.describe("Names", () => {
test.beforeEach(async ({ page }) => {
await expect(itemMetadataPage.nameHeading).toBeVisible();
await expect(itemMetadataPage.nameText).toBeVisible();
});

test("should display the correct number of expected name fields", async () => {
await itemMetadataPage.verifyNameCount();
});
test("should display the correct number of expected name fields", async () => {
await itemMetadataPage.verifyNameCount();
});

test("should display link for name and text for Role", async () => {
await itemMetadataPage.verifyNameLinks();
});

test("should display link for name and text for Role", async () => {
await itemMetadataPage.verifyNameLinks();
test("should display correct name and role values", async () => {
await itemMetadataPage.verifyNameDataValues();
});
});
});

test("should display correct name and role values", async () => {
await itemMetadataPage.verifyNameDataValues();
test.describe("Verify Sample Record 2", () => {
test.describe("Languages", () => {
test.beforeEach(async ({ page }) => {
// Load the SPECIFIC LANGUAGE-modified URL before each test in this block
await itemMetadataPage.loadScenario("SAMPLE2");
});

test("should include correct language values", async () => {
await itemMetadataPage.verifyLanguageText();
});

test("should contain links that are clickable", async () => {
await itemMetadataPage.verifyLanguageLinks();
});
});
});