forked from marmelab/gremlins.js
-
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
Pierre Haller
committed
Jul 21, 2020
1 parent
84ec323
commit e278b5b
Showing
12 changed files
with
683 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
node_modules | ||
npm-debug.log | ||
cypress/screenshots |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ install: | |
|
||
script: | ||
- npm run test | ||
- npm run cypress:run | ||
|
||
branches: | ||
only: | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"defaultCommandTimeout": 10000, | ||
"video": false | ||
} |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,35 @@ | ||
import Chance from 'chance'; | ||
import { createHorde, species, strategies } from '../../src/index'; | ||
|
||
const seed = 'formFiller'; | ||
|
||
describe('Form filler', () => { | ||
let horde; | ||
beforeEach(() => { | ||
return cy.visit('formFiller.html').then(() => | ||
cy.window().then((pageWindow) => { | ||
horde = createHorde({ | ||
species: [species.formFiller()], | ||
strategies: [strategies.bySpecies({ nb: 10 })], | ||
window: pageWindow, | ||
randomizer: new Chance(seed), | ||
}); | ||
}) | ||
); | ||
}); | ||
it('should fill text input with seeded value', () => { | ||
return cy.wrap(horde.unleash()).then(() => { | ||
cy.get('input[type="text"]').should('have.value', '7uv'); | ||
}); | ||
}); | ||
it('should fill number input with seeded value', () => { | ||
return cy.wrap(horde.unleash()).then(() => { | ||
cy.get('input[type="number"]').should('have.value', '693'); | ||
}); | ||
}); | ||
it('should fill email input with seeded value', () => { | ||
return cy.wrap(horde.unleash()).then(() => { | ||
cy.get('input[type="email"]').should('have.value', '[email protected]'); | ||
}); | ||
}); | ||
}); |
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,9 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<body> | ||
<input type="text" /> | ||
<input type="number" /> | ||
<input type="email" /> | ||
</body> | ||
</html> |
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,2 @@ | ||
// Overwrite cy.visit to visit local html files | ||
Cypress.Commands.overwrite('visit', (visit, path, options = {}) => visit(`./cypress/pages/${path}`, options)); |
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 @@ | ||
import './commands'; |
Oops, something went wrong.