This commit is contained in:
Kar
2022-09-07 00:13:55 +05:30
commit 0faf7e9d31
43 changed files with 7565 additions and 0 deletions

View 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');
});
});
});

View 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
);
});
});
});