|
| 1 | +/// <reference types="cypress" /> |
| 2 | + |
| 3 | +context('Documentation', () => { |
| 4 | + beforeEach(() => { |
| 5 | + cy.visit('/') |
| 6 | + }) |
| 7 | + describe('landing article', () => { |
| 8 | + it('should have content prose', () => { |
| 9 | + cy.title('documentation') |
| 10 | + cy.get('h1') |
| 11 | + .contains('Documentation') |
| 12 | + .parents('article') |
| 13 | + .find('section > h2') |
| 14 | + .contains('Alphabetical index') |
| 15 | + .parents('article') |
| 16 | + .contains('Subject index') |
| 17 | + }) |
| 18 | + |
| 19 | + describe('generated indexes', () => { |
| 20 | + it('should contain articles by alphabet', () => { |
| 21 | + cy.get('[name=alphabetical-index]') |
| 22 | + .parents('section') |
| 23 | + .contains('Integration Testing') |
| 24 | + }) |
| 25 | + |
| 26 | + it('should contain articles by subject', () => { |
| 27 | + cy.get('[name=subject-index]') |
| 28 | + .parents('section') |
| 29 | + .contains('Integration Testing') |
| 30 | + }) |
| 31 | + |
| 32 | + }) |
| 33 | + |
| 34 | + it('should have ToC links', () => { |
| 35 | + cy.get('#sidebar') |
| 36 | + .find('.toc') |
| 37 | + .within(($toc) => { |
| 38 | + cy.get('li') |
| 39 | + .contains('Getting Started') |
| 40 | + .click() |
| 41 | + .url() |
| 42 | + .should('include', '#start') |
| 43 | + }) |
| 44 | + }) |
| 45 | + |
| 46 | + describe('navbar', () => { |
| 47 | + it('should enable simple search', () => { |
| 48 | + cy.get('.search-query') |
| 49 | + .type('testing{enter}') |
| 50 | + .url().should('include', 'search.html') |
| 51 | + cy.get('body') |
| 52 | + .find('#f-results') |
| 53 | + .contains('Integration Testing') |
| 54 | + .click() |
| 55 | + .url() |
| 56 | + .should('include', 'integration-testing.xml') |
| 57 | + }) |
| 58 | + |
| 59 | + it('should reference author guidelines', () => { |
| 60 | + cy.get('.navbar') |
| 61 | + .find('#documentation') |
| 62 | + .click() |
| 63 | + .contains('author guidelines') |
| 64 | + .click() |
| 65 | + .url() |
| 66 | + .should('include', 'author-reference.xml') |
| 67 | + }) |
| 68 | + }) |
| 69 | + }) |
| 70 | +}) |
0 commit comments