-
-
Notifications
You must be signed in to change notification settings - Fork 201
use explicit manifest #1755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
use explicit manifest #1755
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,20 @@ test.skip("Configuration options", () => {}); | |
| const puppeteer = require("puppeteer"); | ||
| const { BASE_URL } = require("../scripts/testBaseUrl"); | ||
|
|
||
| // Cookbook manifest for viewer control tests | ||
| const COOKBOOK_MANIFEST = | ||
| "https://iiif.io/api/cookbook/recipe/0031-bound-multivolume/manifest.json"; | ||
|
|
||
| // PDF manifest for PDF-specific behaviour | ||
| const PDF_MANIFEST = | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this should be |
||
| "https://digital.library.villanova.edu/Item/vudl:294631/Manifest"; | ||
|
|
||
| const viewerUrl = (manifestUrl) => { | ||
| const separator = BASE_URL.includes("?") ? "&" : "?"; | ||
|
|
||
| return `${BASE_URL}${separator}manifest=${encodeURIComponent(manifestUrl)}`; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this really work? I thought the manifest argument had to be part of the hash parameters, not part of the base query parameters... in other words,
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It did appear to work when I tested yesterday, but you are right that the manifest parameter should probably be part of the hash parameters rather than the base query parameters. I’ll update |
||
| }; | ||
|
|
||
| describe("Universal Viewer", () => { | ||
| let browser; | ||
| let page; | ||
|
|
@@ -85,6 +99,7 @@ describe("Universal Viewer", () => { | |
| await browser.close(); | ||
| }); | ||
|
|
||
| // Default manifest test | ||
| it("has the correct page title", async () => { | ||
| const title = await page.title(); | ||
| expect(title).toBe("Universal Viewer Examples"); | ||
|
|
@@ -194,9 +209,10 @@ describe("Universal Viewer", () => { | |
| expect(isSettingsButtonVisible).toBe(true); | ||
| }); | ||
|
|
||
| // COOKBOOK MANIFEST TEST | ||
| describe("viewer controls", () => { | ||
| afterEach(async () => { | ||
| await page.goto(BASE_URL); | ||
| beforeEach(async () => { | ||
| await page.goto(viewerUrl(COOKBOOK_MANIFEST)); | ||
| }); | ||
|
|
||
| // can navigate back and forth | ||
|
|
@@ -335,8 +351,8 @@ describe("Universal Viewer", () => { | |
| const contentThumbnailsTab = ".thumbs.tab"; | ||
| const contentThumbnailsActiveTab = ".thumbs.tab.on"; | ||
|
|
||
| afterEach(async () => { | ||
| await page.goto(BASE_URL); | ||
| beforeEach(async () => { | ||
| await page.goto(viewerUrl(COOKBOOK_MANIFEST)); | ||
| }); | ||
|
|
||
| // switch content tabs and collapse content panel | ||
|
|
@@ -351,7 +367,9 @@ describe("Universal Viewer", () => { | |
| ).toBe(true); | ||
|
|
||
| expect( | ||
| await page.$eval(contentThumbnailsTab, (el) => el.classList.contains("on")) | ||
| await page.$eval(contentThumbnailsTab, (el) => | ||
| el.classList.contains("on") | ||
| ) | ||
| ).toBe(false); | ||
| }); | ||
|
|
||
|
|
@@ -371,8 +389,8 @@ describe("Universal Viewer", () => { | |
| const moreInfoCollapseBtn = ".rightPanel button.collapseButton"; | ||
| const moreInfoHeader = ".rightPanel div.header"; | ||
|
|
||
| afterEach(async () => { | ||
| await page.goto(BASE_URL); | ||
| beforeEach(async () => { | ||
| await page.goto(viewerUrl(COOKBOOK_MANIFEST)); | ||
| }); | ||
|
|
||
| it("can expand and collapse moreInformation panel", async () => { | ||
|
|
@@ -394,4 +412,24 @@ describe("Universal Viewer", () => { | |
| await page.waitForSelector(moreInfoHeader, { hidden: true }); | ||
| }); | ||
| }); | ||
|
|
||
| // PDF MANIFEST TEST | ||
| describe("PDF manifest", () => { | ||
| beforeEach(async () => { | ||
| await page.goto(viewerUrl(PDF_MANIFEST), { | ||
| waitUntil: "domcontentloaded", | ||
| }); | ||
| }); | ||
|
|
||
| it("loads PDF manifest successfully", async () => { | ||
| expect(page.url()).toContain(encodeURIComponent(PDF_MANIFEST)); | ||
|
|
||
| await page.waitForSelector(".uv", { visible: true }); | ||
|
|
||
| const pageText = await page.evaluate(() => document.body.innerText); | ||
|
|
||
| expect(pageText).not.toContain("Unable to load"); | ||
| expect(pageText).not.toContain("Error loading"); | ||
| }); | ||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| jest.setTimeout(10000); | ||
| jest.setTimeout(60000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should give this a more specific name, since we'll likely have more cookbook manifests in the future -- perhaps
COOKBOOK_BOUND_MULTIVOLUME_MANIFEST?