-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5988ca2
commit a022ba2
Showing
7 changed files
with
130 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const mazes = [ | ||
'Prims', | ||
'Kruskal', | ||
'Recursive Backtracking', | ||
'Recursive Division', | ||
'Wilson', | ||
'Binary', | ||
'Ellers', | ||
'Side Winder', | ||
'Labyrinth', | ||
]; | ||
|
||
const pathFinders = [ | ||
'Breadth First Search', | ||
'Depth First Search', | ||
'A* Search', | ||
'Greedy Best First', | ||
]; | ||
|
||
describe('path finder', () => { | ||
beforeEach(() => { | ||
cy.visit('/#/path-finder'); | ||
cy.viewport(1440, 900); | ||
}); | ||
|
||
it('should verify the maze dropdowns', () => { | ||
cy.get('#maze').should('contain.text', 'Select a Maze'); | ||
|
||
for (const maze of mazes) { | ||
cy.get('#maze').should('contain.text', maze); | ||
} | ||
}); | ||
|
||
it('should verify the path finder dropdowns', () => { | ||
cy.get('#path-finder').should('contain.text', 'Select a Path finder'); | ||
|
||
for (const pathFinder of pathFinders) { | ||
cy.get('#path-finder').should('contain.text', pathFinder); | ||
} | ||
}); | ||
|
||
it('should verify the grid', () => { | ||
cy.get('[data-cell-type="1"]').should('have.length', 1); | ||
cy.get('[data-cell-type="2"]').should('have.length', 1); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
function verifyMaze() { | ||
cy.get('[data-testid="generate-maze"]').click(); | ||
cy.get('[data-testid="generate-maze"]').should('be.enabled'); | ||
|
||
cy.get('[data-cell-type="1"]').should('have.length', 1); | ||
cy.get('[data-cell-type="2"]').should('have.length', 1); | ||
cy.get('[data-cell-type="0"]').should('have.length', 807); | ||
cy.get('[data-cell-type="3"]').should('have.length', 728); | ||
} | ||
|
||
describe('path finder', () => { | ||
beforeEach(() => { | ||
cy.visit('/#/path-finder'); | ||
cy.viewport(1440, 900); | ||
|
||
const generateMaze = cy.get('[data-testid="generate-maze"]'); | ||
generateMaze.should('be.visible'); | ||
generateMaze.should('be.disabled'); | ||
}); | ||
|
||
it('should verify the grid', () => { | ||
cy.get('[data-cell-type="1"]').should('have.length', 1); | ||
cy.get('[data-cell-type="2"]').should('have.length', 1); | ||
}); | ||
|
||
it('should verify the prims maze generation', () => { | ||
cy.get('#maze').select('Prims'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the kruskal maze generation', () => { | ||
cy.get('#maze').select('Kruskal'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the recursive backtracking maze generation', () => { | ||
cy.get('#maze').select('Recursive Backtracking'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the recursive division maze generation', () => { | ||
cy.get('#maze').select('Recursive Division'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the wilson maze generation', () => { | ||
cy.get('#maze').select('Wilson'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the binary maze generation', () => { | ||
cy.get('#maze').select('Binary'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the ellers maze generation', () => { | ||
cy.get('#maze').select('Ellers'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the side winder maze generation', () => { | ||
cy.get('#maze').select('Side Winder'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the labyrinth maze generation', () => { | ||
cy.get('#maze').select('Labyrinth'); | ||
verifyMaze(); | ||
}); | ||
|
||
it('should verify the random maze generation', () => { | ||
cy.get('#maze').select('Random'); | ||
cy.get('[data-testid="generate-maze"]').click(); | ||
cy.get('[data-testid="generate-maze"]').should('be.enabled'); | ||
|
||
cy.get('[data-cell-type="1"]').should('have.length', 1); | ||
cy.get('[data-cell-type="2"]').should('have.length', 1); | ||
cy.get('[data-cell-type="0"]').should('have.length.greaterThan', 500); | ||
cy.get('[data-cell-type="3"]').should('have.length.greaterThan', 100); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
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