diff --git a/cypress/e2e/client.cy.js b/cypress/e2e/client.cy.js index 90352133..7132785e 100644 --- a/cypress/e2e/client.cy.js +++ b/cypress/e2e/client.cy.js @@ -11,7 +11,7 @@ describe('Igbo API Homepage', () => { }); it('navigate to Nkọwa okwu website', () => { - cy.findByTestId('nkowaokwu-link').click(); + cy.findByTestId('nkowaokwu-link').click({ force: true }); cy.url().should('equal', 'https://nkowaokwu.com/home'); cy.contains('Internal Server Error').should('not.exist'); }); @@ -28,14 +28,14 @@ describe('Igbo API Homepage', () => { }); it('render the About page', () => { - cy.get('li').contains('About').click(); + cy.get('li').contains('About').click({ force: true }); cy.findByText('Contact'); - cy.contains('Email:'); + cy.contains('kedu@nkowaokwu.com'); }); it('render the Privacy page', () => { cy.findByText('Privacy Policy').click(); - cy.findByText('Privacy Policy').should('exist'); + cy.get('h1').contains('Privacy Policy').should('exist'); }); it('render the Terms or Service page', () => { @@ -46,10 +46,12 @@ describe('Igbo API Homepage', () => { describe('Try it Out', () => { it('enter a word and select flag', () => { cy.visit('/'); - cy.findByTestId('try-it-out-input').clear().type('biko'); + cy.findByTestId('try-it-out-input').clear({ force: true }).type('biko', { force: true }); cy.findByTestId('dialects-flag').click(); cy.get('button').contains('Submit').click(); - cy.get('input[value="http://localhost:8080/api/v1/words?keyword=biko&dialects=true"]'); + cy.get('code') + .contains('http://localhost:8080/api/v1/words?keyword=biko&dialects=true') + .should('exist'); }); }); @@ -103,20 +105,21 @@ describe('Igbo API Homepage', () => { }); it('render the About page', () => { - cy.findByAltText('down arrow as menu icon').click(); - cy.get('button').contains('About').click(); + cy.findByTestId('drop-down-button').click(); + cy.get('button').contains('About').click({ force: true }); cy.findByText('Contact'); - cy.contains('Email:'); + cy.contains('kedu@nkowaokwu.com'); }); it('render the Sign up page', () => { - cy.findByAltText('down arrow as menu icon').click(); - cy.get('button').contains('Get an API Key').click(); + cy.findByTestId('drop-down-button').click(); + cy.get('button').contains('Get an API Key').click({ force: true }); cy.findByText('Sign up.'); }); it('navigate to Nkọwa okwu', () => { cy.visit('/'); - cy.findByTestId('nkowaokwu-link').scrollTo(0, -300).click(); + cy.scrollTo(0, -300); + cy.findByTestId('nkowaokwu-link').click({ force: true }); }); }); }); diff --git a/src/pages/components/Navbar/NavigationMenu.tsx b/src/pages/components/Navbar/NavigationMenu.tsx index 3f86b813..6dbdab94 100644 --- a/src/pages/components/Navbar/NavigationMenu.tsx +++ b/src/pages/components/Navbar/NavigationMenu.tsx @@ -13,6 +13,7 @@ const NavigationMenu = () => ( _hover={{ backgroundColor: 'transparent' }} _focus={{ backgroundColor: 'transparent' }} _active={{ backgroundColor: 'transparent' }} + data-test="drop-down-button" /> {navigationLinks.map(({ href, label }) => (