init
This commit is contained in:
27
cypress/e2e/SeoMetadata.cy.ts
Normal file
27
cypress/e2e/SeoMetadata.cy.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
describe('Seo metadata', () => {
|
||||
describe('Verify SEO Metadata', () => {
|
||||
it('should render SEO metadata on Index page', () => {
|
||||
cy.visit('/');
|
||||
|
||||
// The Index page should have a page title
|
||||
cy.title().should('not.be.empty');
|
||||
|
||||
// The Index page should also contain a meta description for SEO
|
||||
cy.get('head meta[name="description"]')
|
||||
.invoke('attr', 'content')
|
||||
.should('not.be.empty');
|
||||
});
|
||||
|
||||
it('should render SEO metadata on About page', () => {
|
||||
cy.visit('/about');
|
||||
|
||||
// The About page should have a page title
|
||||
cy.title().should('not.be.empty');
|
||||
|
||||
// The About page should also contain a meta description for SEO
|
||||
cy.get('head meta[name="description"]')
|
||||
.invoke('attr', 'content')
|
||||
.should('not.be.empty');
|
||||
});
|
||||
});
|
||||
});
|
||||
25
cypress/e2e/navigation.cy.ts
Normal file
25
cypress/e2e/navigation.cy.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
describe('Navigation', () => {
|
||||
describe('Static pages', () => {
|
||||
it('should navigate to the about page', () => {
|
||||
// Start from the index page
|
||||
cy.visit('/');
|
||||
|
||||
// The index page should contain an h1
|
||||
cy.findByRole('heading', {
|
||||
name: 'Boilerplate code for your Nextjs project with Tailwind CSS',
|
||||
});
|
||||
|
||||
// Find a link containing "About" text and click it
|
||||
cy.findByRole('link', { name: 'About' }).click();
|
||||
|
||||
// The new url should include "/about"
|
||||
cy.url().should('include', '/about');
|
||||
|
||||
// The new page should contain two "lorem ipsum" paragraphs
|
||||
cy.findAllByText('Lorem ipsum dolor sit amet', { exact: false }).should(
|
||||
'have.length',
|
||||
2
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user