|
1 | 1 | describe('Concept page', () => {
|
| 2 | + it("doesn't contain breadcrumbs for top concepts", () => { |
| 3 | + cy.visit('/yso/en/page/p4762') // go to "objects" concept page |
| 4 | + |
| 5 | + // check that there are no breadcrumbs on the page |
| 6 | + cy.get('#concept-breadcrumbs').should('not.exist') |
| 7 | + }) |
| 8 | + it("contains unshortened breadcrumbs (up to 5 levels)", () => { |
| 9 | + cy.visit('/yso/en/page/p7347') // go to "ancient castles" concept page |
| 10 | + |
| 11 | + // check that there are breadcrumbs on the page |
| 12 | + cy.get('#concept-breadcrumbs').should('exist') |
| 13 | + |
| 14 | + // check that there is no expand link for breadcrumbs |
| 15 | + cy.get('.breadcrumb-toggle').should('not.exist') |
| 16 | + |
| 17 | + // check that there are 5 breadcrumb links |
| 18 | + cy.get('#concept-breadcrumbs ol').find('li').should('have.length', 5) |
| 19 | + |
| 20 | + // check the first breadcrumb |
| 21 | + cy.get('#concept-breadcrumbs ol li').first().invoke('text').should('equal', 'properties') |
| 22 | + |
| 23 | + // check the last breadcrumb |
| 24 | + cy.get('#concept-breadcrumbs ol li').last().invoke('text').should('equal', 'ancient castles') |
| 25 | + cy.get('#concept-breadcrumbs ol li a').last().should('have.class', 'breadcrumb-current') |
| 26 | + }) |
| 27 | + it("contains shortened breadcrumbs (more than 5 levels)", () => { |
| 28 | + cy.visit('/yso/en/page/p1265') // go to "archaeology" concept page |
| 29 | + |
| 30 | + // check that there are breadcrumbs on the page |
| 31 | + cy.get('#concept-breadcrumbs').should('exist') |
| 32 | + |
| 33 | + // check that there is an expand link for breadcrumbs |
| 34 | + cy.get('.breadcrumb-toggle').should('exist') |
| 35 | + |
| 36 | + // check that there are 8 breadcrumb links |
| 37 | + cy.get('#concept-breadcrumbs ol').find('li').should('have.length', 8) |
| 38 | + |
| 39 | + // check that there are 2 hidden breadcrumb links |
| 40 | + cy.get('#concept-breadcrumbs ol').find('li.collapse').should('have.length', 2) |
| 41 | + |
| 42 | + // check that there are no breadcrumb links currently shown |
| 43 | + cy.get('#concept-breadcrumbs ol').find('li.show').should('have.length', 0) |
| 44 | + |
| 45 | + // check the first breadcrumb (expand link) |
| 46 | + cy.get('#concept-breadcrumbs ol li').first().invoke('text').should('equal', '...') |
| 47 | + |
| 48 | + // check the last breadcrumb |
| 49 | + cy.get('#concept-breadcrumbs ol li').last().invoke('text').should('equal', 'archaeology') |
| 50 | + cy.get('#concept-breadcrumbs ol li a').last().should('have.class', 'breadcrumb-current') |
| 51 | + |
| 52 | + // click the expand link |
| 53 | + cy.get('#concept-breadcrumbs ol li').first().click() |
| 54 | + |
| 55 | + // check that there are 2 breadcrumb links currently shown |
| 56 | + cy.get('#concept-breadcrumbs ol').find('li.show').should('have.length', 2) |
| 57 | + }) |
| 58 | + it("contains shortened breadcrumbs (two different paths)", () => { |
| 59 | + cy.visit('/yso/en/page/p38289') // go to "music archaeology" concept page |
| 60 | + |
| 61 | + // check that there are breadcrumbs on the page |
| 62 | + cy.get('#concept-breadcrumbs').should('exist') |
| 63 | + |
| 64 | + // check that there are 2 sets of breadcrumbs |
| 65 | + cy.get('#concept-breadcrumbs').find('ol').should('have.length', 2) |
| 66 | + |
| 67 | + // check that there are 2 expand links for breadcrumbs |
| 68 | + cy.get('#concept-breadcrumbs').find('.breadcrumb-toggle').should('have.length', 2) |
| 69 | + |
| 70 | + // check that there are 4 hidden breadcrumb links |
| 71 | + cy.get('#concept-breadcrumbs ol').find('li.collapse').should('have.length', 4) |
| 72 | + |
| 73 | + // check that there are no breadcrumb links currently shown |
| 74 | + cy.get('#concept-breadcrumbs ol').find('li.show').should('have.length', 0) |
| 75 | + |
| 76 | + // check the first breadcrumb (expand link) |
| 77 | + cy.get('#concept-breadcrumbs ol li').first().invoke('text').should('equal', '...') |
| 78 | + |
| 79 | + // check the last breadcrumb |
| 80 | + cy.get('#concept-breadcrumbs ol li').last().invoke('text').should('equal', 'music archaeology') |
| 81 | + cy.get('#concept-breadcrumbs ol li a').last().should('have.class', 'breadcrumb-current') |
| 82 | + |
| 83 | + // click the expand link |
| 84 | + cy.get('#concept-breadcrumbs ol li').first().click() |
| 85 | + |
| 86 | + // check that there are 2 breadcrumb links currently shown |
| 87 | + cy.get('#concept-breadcrumbs ol').find('li.show').should('have.length', 4) |
| 88 | + }) |
2 | 89 | it('contains concept preflabel', () => {
|
3 | 90 | cy.visit('/yso/en/page/p21685') // go to "music research" concept page
|
4 | 91 |
|
|
0 commit comments