|
1 | 1 | describe('Server page contains expected information', () => { |
2 | | - it('passes', () => { |
3 | | - const expectedEndpoints = [ |
4 | | - '/api/bikes', |
5 | | - '/api/cats', |
6 | | - '/api/images', |
7 | | - '/api/json', |
8 | | - '/api/lambda', |
9 | | - '/api/markdown', |
10 | | - '/api/posts', |
11 | | - '/api/users', |
12 | | - '/api/videos', |
13 | | - '/api/error', |
14 | | - ]; |
15 | | - cy.visit('/'); |
16 | | - cy.get('h1').contains('Running'); |
| 2 | + it('passes', () => { |
| 3 | + const expectedEndpoints = [ |
| 4 | + '/api/bikes', |
| 5 | + '/api/cats', |
| 6 | + '/api/images', |
| 7 | + '/api/json', |
| 8 | + '/api/lambda', |
| 9 | + '/api/markdown', |
| 10 | + '/api/posts', |
| 11 | + '/api/users', |
| 12 | + '/api/videos', |
| 13 | + '/api/error', |
| 14 | + ]; |
| 15 | + cy.visit('/'); |
| 16 | + cy.get('[cy-data="server_status"]').contains('Running'); |
17 | 17 |
|
18 | | - cy.get('h3').contains('Server Address'); |
19 | | - cy.get('h3').contains('Server Port'); |
20 | | - cy.get('h3').contains('Server URL Prefix'); |
21 | | - cy.get('h3').contains('API endpoints'); |
| 18 | + cy.get('[cy-data="server_address"]').contains('Server Address'); |
| 19 | + cy.get('[cy-data="server_port"]').contains('Server Port'); |
| 20 | + cy.get('[cy-data="server_prefix"]').contains('Server URL Prefix'); |
| 21 | + cy.get('[cy-data="server_label"]').contains('API endpoints*'); |
22 | 22 |
|
23 | | - cy.get('[cy-data="server_address"]').contains('localhost'); |
24 | | - cy.get('[cy-data="server_port"]').contains('8000'); |
25 | | - cy.get('[cy-data="url_prefix"]').contains('api'); |
| 23 | + cy.get('[cy-data="server_address"]').contains('localhost'); |
| 24 | + cy.get('[cy-data="server_port"]').contains('8000'); |
| 25 | + cy.get('[cy-data="url_prefix"]').contains('api'); |
26 | 26 |
|
27 | | - const endpoints = cy.get('[cy-data="endpoint"]'); |
| 27 | + const endpoints = cy.get('[cy-data="endpoint"]'); |
28 | 28 |
|
29 | | - endpoints.should('have.length', expectedEndpoints.length); |
| 29 | + endpoints.should('have.length', expectedEndpoints.length); |
30 | 30 |
|
31 | | - endpoints.each((endpoint) => { |
32 | | - expect(expectedEndpoints).to.include(endpoint.text()); |
33 | | - }); |
34 | | - }); |
| 31 | + endpoints.each((endpoint) => { |
| 32 | + expect(expectedEndpoints).to.include(endpoint.text()); |
| 33 | + }); |
| 34 | + }); |
35 | 35 | }); |
0 commit comments