forked from mate-academy/js_2048_game
-
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.
- Loading branch information
Ihor Oliinyk
committed
Nov 20, 2020
1 parent
4636ec0
commit 096b769
Showing
2 changed files
with
58 additions
and
8 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,58 @@ | ||
'use strict'; | ||
|
||
describe('2048 game', () => { | ||
beforeEach('Open site', () => { | ||
cy.visit('https://kshvetsova.github.io/js_2048_game/'); | ||
}); | ||
|
||
it('should show the score', () => { | ||
cy.get('button').click(); | ||
cy.get('body').type('{rightArrow}'); | ||
cy.get('body').type('{upArrow}'); | ||
cy.get('body').type('{rightArrow}'); | ||
cy.contains('Score').should('not.have.value', 0); | ||
}); | ||
|
||
it('should show the score', () => { | ||
cy.get('button').click(); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.get('body').type('{upArrow}'); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.contains('Score').should('not.have.value', 0); | ||
}); | ||
|
||
it('should show the score', () => { | ||
cy.get('button').click(); | ||
cy.get('body').type('{rightArrow}'); | ||
cy.get('body').type('{downArrow}'); | ||
cy.get('body').type('{rightArrow}'); | ||
cy.contains('Score').should('not.have.value', 0); | ||
}); | ||
|
||
it('should show the score', () => { | ||
cy.get('button').click(); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.get('body').type('{downArrow}'); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.contains('Score').should('not.have.value', 0); | ||
}); | ||
|
||
it('should reset the score', () => { | ||
cy.get('button').click(); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.get('body').type('{downArrow}'); | ||
cy.get('body').type('{leftArrow}'); | ||
cy.get('[class="game-score"]').should('not.have.value', '0'); | ||
cy.get('button').click(); | ||
cy.get('[class="game-score"]').should('have.value', ''); | ||
}); | ||
|
||
it('should show message wh', () => { | ||
cy.get('button').click(); | ||
for (let n = 0; n < 120; n++) { | ||
cy.get('body').type('{rightArrow}'); | ||
cy.get('body').type('{upArrow}'); | ||
} | ||
cy.get('body').contains('lose'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.