Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress test #187

Merged
merged 5 commits into from
Jul 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions docs-e2e-testing/e2e/jest-preview.cy.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
describe('Tests for Jest Preview', () => {

it('Check internal pages are present, links and buttons work as expected', () => {
cy.visit('https://www.jest-preview.com/')
cy.contains('h1', 'Jest Preview')

// Check CTA Get Started should directed users to Docs page
cy.get('.button').click()
cy.url()
.should('contain', 'docs/getting-started/intro')
cy.contains('h1','Introduction')
cy.visit('https://www.jest-preview.com/');
cy.contains('h1', 'Jest Preview');

// Check CTA Get Started should direct users to Docs page
cy.get('.button').click();
cy.url().should('contain', 'docs/getting-started/intro');
cy.contains('h1', 'Introduction');

// Check Docs page is present
cy.contains("Docs").click()
cy.url()
.should('contain', 'docs/getting-started/intro')
cy.contains('h1','Introduction')

cy.contains('Docs').click();
cy.url().should('contain', 'docs/getting-started/intro');
cy.contains('h1', 'Introduction');

// Check Blog page is present
cy.contains("Blog").click()
cy.url()
.should('contain', '/blog')
cy.contains('Recent posts')

cy.contains('Blog').click();
cy.url().should('contain', '/blog');
cy.contains('Recent posts');

// Check API page is present
cy.contains("API").click()
cy.url()
.should('contain', '/api')
cy.contains('Getting Started')
cy.contains('API').click();
cy.url().should('contain', '/api');
cy.contains('Getting Started');

// Check Demo link is correct and Demo page can be loaded
cy.contains('Demo').should('have.attr', 'href', 'https://stackblitz.com/edit/jest-preview?file=README.md')
})
})
// Check Demo link is correct
cy.contains('Demo').should(
'have.attr',
'href',
'https://stackblitz.com/edit/jest-preview?file=README.md',
);
});
});