Skip to content

Commit 72031b1

Browse files
authored
feat: Upgrade Universal Viewer to v4 (#52)
* feat: Upgrade Universal Viewer to v4 * ci: keep UV3 for audio, use UV4 for images
1 parent 0082a1b commit 72031b1

File tree

13 files changed

+2659
-639
lines changed

13 files changed

+2659
-639
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
;;
5050
esac
5151
fi
52-
- uses: actions/setup-node@fd4bd829f2dd6b6c1420bd94a93449c54612ffc2
53-
if: env.DESTINATION_DIR
5452
- run: npm install && npm run build
5553
if: env.DESTINATION_DIR
5654
- name: deploy

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
node_modules
33
/dist
44
/public/uv
5+
/public/uv3
56
/public/mejs
67
/public/jquery
8+
/cypress/screenshots
9+
/cypress/videos
710

811

912
# local env files

cypress.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"baseUrl": "http://localhost:8080",
3-
"defaultCommandTimeout": 10000
3+
"defaultCommandTimeout": 10000,
4+
"viewportWidth": 1200,
5+
"viewportHeight": 660
46
}
57

cypress/integration/audio.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ describe('An audio object', () => {
66

77
// UV loads inside an iframe
88
cy.frameLoaded("#universalviewer-iframe", {
9-
url: '/uv.html' + URL_PARAMETERS,
9+
url: '/uv3.html' + URL_PARAMETERS,
1010
});
1111
})
1212

1313

1414
it('loads in Universal Viewer!', () => {
15-
cy.visit('/uv.html' + URL_PARAMETERS)
15+
cy.visit('/uv3.html' + URL_PARAMETERS)
1616

1717
// Shows track title
1818
cy.contains("Side A").should("exist").should("be.visible")
1919

2020
// Settings Button
21-
cy.contains("button", "Settings").should("exist").should("be.visible")
21+
cy.get("button.settings").should("exist").should("be.visible")
2222

2323
// left panel is enabled
2424
cy.get(".leftPanel").should("exist").should("be.visible")
@@ -27,7 +27,7 @@ describe('An audio object', () => {
2727
cy.contains("Print").should("not.exist")
2828

2929
// "Share" is disabled
30-
cy.contains("Share").should("exist").should("not.be.visible")
30+
cy.get("button.share").should("exist").should("not.be.visible")
3131

3232
// Enter / exit fullcreen view
3333
cy.contains("Full Screen").should("exist").should("be.visible")

cypress/integration/image.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ describe('A simple image', () => {
1515
cy.visit('/uv.html' + URL_PARAMETERS)
1616

1717
// Shows title
18-
cy.contains('div.title', "1985 - The California Poppy").should("exist").should("be.visible")
18+
cy.contains('.title', "1985 - The California Poppy").should("exist").should("be.visible")
1919

2020
// Settings Button
21-
cy.contains("button", "Settings").should("exist").should("be.visible")
21+
cy.get("button.settings").should("exist").should("be.visible")
2222

2323
// left panel is disabled
2424
cy.get(".leftPanel").should("exist").should("not.be.visible")

cypress/integration/manuscript.spec.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,31 @@ describe('A manuscript', () => {
1010
});
1111
})
1212

13-
1413
it('loads in Universal Viewer!', () => {
1514
cy.visit('/uv.html' + URL_PARAMETERS)
1615

1716
// Shows title
18-
cy.contains('div.title', "Manuscript No. 1: Gladzor Gospels").should("exist").should("be.visible")
17+
cy.contains('.title', "Manuscript No. 1: Gladzor Gospels").should("exist").should("be.visible")
1918

2019
// Settings Button
21-
cy.contains("button", "Settings").should("exist").should("be.visible")
20+
cy.get("button.settings").should("exist").should("be.visible")
2221

2322
// left panel
2423
// is visible, first page selected
2524
cy.get(".leftPanel").should("exist").should("be.visible")
26-
.get("#thumb0").should("have.class", "selected")
25+
.get("#thumb-0 > .thumb").should("have.class", "selected")
2726
// navigate to 3rd page by clicking thumbnail
28-
cy.get("#thumb2").should("not.have.class", "selected")
29-
.get("#thumb2 > div.wrap.loaded > img").click()
30-
.get("#thumb0").should("not.have.class", "selected")
31-
.get("#thumb1").should("have.class", "selected")
32-
.get("#thumb2").should("have.class", "selected")
27+
cy.get("#thumb-2 > .thumb").should("not.have.class", "selected")
28+
.get("#thumb-2 img").click()
29+
.get("#thumb-0 > .thumb").should("not.have.class", "selected")
30+
.get("#thumb-1 > .thumb").should("have.class", "selected")
31+
.get("#thumb-2 > .thumb").should("have.class", "selected")
3332
// navigate to 4th page by clicking thumbnail
34-
cy.get("#thumb3").should("not.have.class", "selected")
33+
cy.get("#thumb-3 > .thumb").should("not.have.class", "selected")
3534
.contains("[Gladzor Gospels: page 2]").click()
36-
.get("#thumb2").should("not.have.class", "selected")
37-
.get("#thumb3").should("have.class", "selected")
38-
.get("#thumb4").should("have.class", "selected")
35+
.get("#thumb-2 > .thumb").should("not.have.class", "selected")
36+
.get("#thumb-3 > .thumb").should("have.class", "selected")
37+
.get("#thumb-4 > .thumb").should("have.class", "selected")
3938
// collapse left panel
4039
cy.get(".expandFullButton").should("exist").should("not.be.visible")
4140
.get(".collapseButton").should("exist").should("be.visible").click()

0 commit comments

Comments
 (0)