|
| 1 | +it('renders Testing Playground with an example', () => { |
| 2 | + cy.visit('/'); |
| 3 | + |
| 4 | + cy.findByRole('heading', { |
| 5 | + level: 1, |
| 6 | + name: 'Testing Playground mascot Froggy ️ Testing Playground', |
| 7 | + }).should('exist'); |
| 8 | + |
| 9 | + cy.findByRole('link', { |
| 10 | + name: 'Testing Playground mascot Froggy ️ Testing Playground', |
| 11 | + }) |
| 12 | + .should('exist') |
| 13 | + .and('have.attr', 'href', '/'); |
| 14 | + |
| 15 | + cy.findByRole('button', { name: 'playground' }).should('exist'); |
| 16 | + cy.findByRole('button', { name: 'run' }).should('exist'); |
| 17 | + cy.findByRole('button', { name: 'settings' }).should('exist'); |
| 18 | + cy.findByRole('button', { name: 'kebab menu' }).should('exist'); |
| 19 | + |
| 20 | + cy.getMarkupEditor().should('exist'); |
| 21 | + |
| 22 | + cy.getSandboxBody().within(() => { |
| 23 | + cy.findByLabelText('Email address') |
| 24 | + .should('exist') |
| 25 | + .and('have.attr', 'type', 'email') |
| 26 | + .and('have.attr', 'placeholder', 'Enter email'); |
| 27 | + |
| 28 | + cy.findByText("It's safe with us. We hate spam!").should('exist'); |
| 29 | + |
| 30 | + cy.findByLabelText('Password') |
| 31 | + .should('exist') |
| 32 | + .and('have.attr', 'type', 'password') |
| 33 | + .and('have.attr', 'placeholder', 'Password'); |
| 34 | + |
| 35 | + cy.findByLabelText('I accept the terms and conditions') |
| 36 | + .should('exist') |
| 37 | + .and('have.attr', 'type', 'checkbox') |
| 38 | + .and('not.be.checked'); |
| 39 | + |
| 40 | + cy.findByRole('link', { name: 'terms and conditions' }) |
| 41 | + .should('exist') |
| 42 | + .and('have.attr', 'href', 'https://www.example.com'); |
| 43 | + |
| 44 | + cy.findByRole('button', { name: 'Submit' }).should('exist'); |
| 45 | + }); |
| 46 | + |
| 47 | + cy.findByRole('region', { name: 'html preview' }).within(() => { |
| 48 | + cy.findByRole('button', { name: 'expand' }).should('exist'); |
| 49 | + cy.findByText('accessible roles:').should('exist'); |
| 50 | + cy.findByText('generic').should('exist'); |
| 51 | + }); |
| 52 | + |
| 53 | + cy.getQueryEditor().should('exist'); |
| 54 | + |
| 55 | + cy.findByRole('region', { name: 'query suggestion' }).within(() => { |
| 56 | + cy.findByText('> <button type="submit" > Submit </button>').should('exist'); |
| 57 | + cy.findByRole('button', { name: 'expand' }).should('exist'); |
| 58 | + }); |
| 59 | + |
| 60 | + cy.getResult().within(() => { |
| 61 | + cy.findByText('suggested query').should('exist'); |
| 62 | + |
| 63 | + cy.findByText("> getByRole('button', { name: /submit/i })").should('exist'); |
| 64 | + |
| 65 | + cy.findByRole('button', { name: 'copy query' }).should('exist'); |
| 66 | + |
| 67 | + cy.findByText( |
| 68 | + 'There is one thing though. You could make the query a bit more specific by adding the name option.', |
| 69 | + ).should('exist'); |
| 70 | + |
| 71 | + cy.findByRole('heading', { |
| 72 | + level: 3, |
| 73 | + name: '1. Queries Accessible to Everyone', |
| 74 | + }).should('exist'); |
| 75 | + |
| 76 | + cy.findByRole('heading', { |
| 77 | + level: 3, |
| 78 | + name: '2. Semantic Queries', |
| 79 | + }).should('exist'); |
| 80 | + |
| 81 | + cy.findByRole('heading', { |
| 82 | + level: 3, |
| 83 | + name: '3. Test IDs', |
| 84 | + }).should('exist'); |
| 85 | + }); |
| 86 | +}); |
0 commit comments