|
1 | 1 | describe('A manuscript', () => { |
2 | | - const URL_PARAMETERS = '#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz0009gx6g%2Fmanifest' |
3 | | - |
4 | | - it('loads Universal Viewer in an iframe', () => { |
5 | | - cy.visit('/' + URL_PARAMETERS) |
6 | | - |
7 | | - // UV loads inside an iframe |
8 | | - cy.frameLoaded("#universalviewer-iframe", { |
9 | | - url: '/uv.html' + URL_PARAMETERS, |
10 | | - }); |
11 | | - }) |
| 2 | + const URL_PARAMETERS = |
| 3 | + '#?manifest=https%3A%2F%2Fiiif.library.ucla.edu%2Fark%253A%252F21198%252Fzz0009gx6g%2Fmanifest' |
12 | 4 |
|
13 | 5 | it('loads in Universal Viewer!', () => { |
14 | | - cy.visit('/uv.html' + URL_PARAMETERS) |
| 6 | + cy.visit('/' + URL_PARAMETERS) |
15 | 7 |
|
16 | 8 | // Shows title |
17 | | - cy.contains('.title', "Manuscript No. 1: Gladzor Gospels").should("exist").should("be.visible") |
| 9 | + cy.contains('.title', 'Manuscript No. 1: Gladzor Gospels').should('exist').should('be.visible') |
18 | 10 |
|
19 | 11 | // Settings Button |
20 | | - cy.get("button.settings").should("exist").should("be.visible") |
| 12 | + cy.get('button.settings').should('exist').should('be.visible') |
21 | 13 |
|
22 | 14 | // left panel |
23 | 15 | // is visible, first page selected |
24 | | - cy.get(".leftPanel").should("exist").should("be.visible") |
25 | | - .get("#thumb-0 > .thumb").should("have.class", "selected") |
| 16 | + cy.get('.leftPanel').should('exist').should('be.visible') |
| 17 | + |
| 18 | + cy.get('#thumb-0 > .thumb').should('have.class', 'selected') |
26 | 19 | // navigate to 3rd page by clicking thumbnail |
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") |
| 20 | + cy.get('#thumb-2 > .thumb').should('not.have.class', 'selected') |
| 21 | + |
| 22 | + cy.get('#thumb-2 img').click() |
| 23 | + |
| 24 | + cy.get('#thumb-0 > .thumb').should('not.have.class', 'selected') |
| 25 | + |
| 26 | + cy.get('#thumb-1 > .thumb').should('have.class', 'selected') |
| 27 | + |
| 28 | + cy.get('#thumb-2 > .thumb').should('have.class', 'selected') |
32 | 29 | // navigate to 4th page by clicking thumbnail |
33 | | - cy.get("#thumb-3 > .thumb").should("not.have.class", "selected") |
34 | | - .contains("[Gladzor Gospels: page 2]").click() |
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") |
| 30 | + cy.get('#thumb-3 > .thumb') |
| 31 | + .should('not.have.class', 'selected') |
| 32 | + .contains('[Gladzor Gospels: page 2]') |
| 33 | + .click() |
| 34 | + |
| 35 | + cy.get('#thumb-2 > .thumb').should('not.have.class', 'selected') |
| 36 | + |
| 37 | + cy.get('#thumb-3 > .thumb').should('have.class', 'selected') |
| 38 | + |
| 39 | + cy.get('#thumb-4 > .thumb').should('have.class', 'selected') |
38 | 40 | // collapse left panel |
39 | | - cy.get(".expandFullButton").should("exist").should("not.be.visible") |
40 | | - .get(".collapseButton").should("exist").should("be.visible").click() |
41 | | - .get(".leftPanel > .main").should("exist").should("not.be.visible") |
| 41 | + cy.get('.expandFullButton').should('exist').should('not.be.visible') |
| 42 | + |
| 43 | + cy.get('.collapseButton').should('exist').should('be.visible').click() |
| 44 | + |
| 45 | + cy.get('.leftPanel > .main').should('exist').should('not.be.visible') |
42 | 46 |
|
43 | 47 | // "Print" is disabled |
44 | | - cy.contains("Print").should("exist").should("not.be.visible") |
| 48 | + cy.contains('Print').should('exist').should('not.be.visible') |
45 | 49 |
|
46 | 50 | // "Share" is disabled |
47 | | - cy.contains("Share").should("exist").should("not.be.visible") |
| 51 | + cy.contains('Share').should('exist').should('not.be.visible') |
48 | 52 |
|
49 | 53 | // Fullscreen button |
50 | | - cy.contains("Full Screen").should("exist").should("be.visible") |
| 54 | + cy.contains('Full Screen').should('exist').should('be.visible') |
51 | 55 |
|
52 | 56 | // Download button |
53 | | - cy.contains('Download').should("exist").should("be.visible") |
| 57 | + cy.contains('Download').should('exist').should('be.visible') |
| 58 | + }) |
| 59 | + |
| 60 | + it('allows deep linking by canvas index', () => { |
| 61 | + cy.visit('/' + URL_PARAMETERS + '&cv=30') |
| 62 | + |
| 63 | + cy.get('.leftPanel #thumb-29 > .thumb') |
| 64 | + .should('exist') |
| 65 | + .should('be.visible') |
| 66 | + .should('have.class', 'selected') |
54 | 67 | }) |
55 | 68 | }) |
0 commit comments