-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from AgataBialoskorska/cypress-tests-update
Cypress tests update
- Loading branch information
Showing
6 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
describe('Router', () => { | ||
beforeEach(() => { | ||
cy.visit('http://localhost:5173/') | ||
cy.visit('http://localhost:5173/#/') | ||
}) | ||
|
||
describe('Website Navigation', () => { | ||
it('Should load the main page correctly', () => { | ||
cy.url().should('eq', 'http://localhost:5173/') | ||
cy.url().should('eq', 'http://localhost:5173/#/') | ||
}) | ||
|
||
it('Should load the "More" page correctly', () => { | ||
cy.get('a[href="/more"]').click() | ||
cy.url().should('include', '/more') | ||
cy.get('a[href="#/more"]').click() | ||
cy.url().should('include', 'more') | ||
}) | ||
|
||
it('Should load the "Hangman" game correctly', () => { | ||
cy.visit('http://localhost:5173/more') | ||
cy.get('a[href="/hangman"]').click() | ||
cy.url().should('include', '/hangman') | ||
cy.visit('http://localhost:5173/#/more') | ||
cy.get('a[href="#/hangman"]').click() | ||
cy.url().should('include', 'hangman') | ||
}) | ||
|
||
it('Should redirect to the main page if an invalid URL is entered', () => { | ||
cy.visit('http://localhost:5173/random') | ||
cy.url().should('eq', 'http://localhost:5173/') | ||
cy.visit('http://localhost:5173/#/random') | ||
cy.url().should('eq', 'http://localhost:5173/#/') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters