-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add census functional test and add cypress
Add cypress to packages Generate pages from census too Correct spelling Add in census cypress happy path Update helpers so they include missing attributes Add census selenium happy path test Upadate against codacy comments Update to use camelcased var names Update to use camelcased var names Update to use camelcased var names Update against codacy comments Add cy as global Use browser within selenium tests Correct broken selenium test Add shortcuts for testing census via cypress Call cypress without ui Use string based keys over reading from file Remove unused module Use environment vars Missing semicolons Remove unneccessary debug/timeout Remove unused plugin file Remove prefix filters from generate pages Add call to census tests in travis script Add display result for census tests Add minimal cypress open config and update readme Add cypress yarn entry
- Loading branch information
Showing
15 changed files
with
1,163 additions
and
79 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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
"$": true, | ||
"jQuery": true, | ||
"browser": true, | ||
"cy": true, | ||
"ga": true | ||
}, | ||
"rules": { | ||
|
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,7 @@ | ||
{ | ||
"fixturesFolder": false, | ||
"pluginsFile": false, | ||
"supportFile": false, | ||
"integrationFolder": "tests/functional/cypress/spec/", | ||
"baseUrl": "http://localhost:5000" | ||
} |
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
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,12 @@ | ||
const cypress = require('cypress'); | ||
|
||
cypress.run({ | ||
headed: process.env.EQ_RUN_FUNCTIONAL_TESTS_HEADLESS ? false : true, | ||
config: { | ||
baseUrl: process.env.EQ_FUNCTIONAL_TEST_ENV || "http://localhost:5000", | ||
viewportWidth: 1280, | ||
viewportHeight: 1080, | ||
video: false, | ||
integrationFolder: "tests/functional/cypress/spec/" | ||
} | ||
}); |
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,22 @@ | ||
const _ = require('lodash'); | ||
const generateToken = require('../../jwt_helper'); | ||
|
||
const getUri = uri => cy.config.baseUrl + uri; | ||
|
||
const getRandomString = length => _.sampleSize('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', length).join(''); | ||
|
||
const openCensusQuestionnaire = (schema, sexualIdentity = false, region = 'GB-ENG', language = 'en') => { | ||
return cy | ||
.then(() => { | ||
return generateToken(schema, {userId: getRandomString(10), collectionId: getRandomString(10), periodId: '2011', periodStr: null, regionCode: region, languageCode: language, sexualIdentity: sexualIdentity, country: 'E', displayAddress: '68 Abingdon Road, Goathill'}); | ||
}) | ||
.then(function(token) { | ||
return cy.visit('/session?token=' + token); | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
getUri, | ||
getRandomString, | ||
openCensusQuestionnaire | ||
}; |
Oops, something went wrong.