-
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.
cypress: minimal testcase with decryption #17
- Loading branch information
1 parent
d4fed8d
commit 6cfd643
Showing
4 changed files
with
22 additions
and
9 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
23 changes: 17 additions & 6 deletions
23
frontend/submission/cypress/integration/1-core/minimal.spec.js
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,17 +1,28 @@ | ||
describe('Minimal test before testing details', () => { | ||
it('Click through wizard and submit the form', () => { | ||
describe('Minimal test, to check the setup before testing details', () => { | ||
it('Click through wizard + submit the form + decrypt formData', () => { | ||
cy.visit('/?token=demoToken') | ||
cy.log('In case of a dev build it might take some time to jit compile…') | ||
cy.log('The next test might fail, when the id is taken by another property with the same name') | ||
// TODO can we change the property name to something namespaced by the form? | ||
cy.log('The next test might fail, when the id is taken by another property with the same name. This sometimes happens with the combination of jsonforms and next dev builds.') | ||
/** TODO We need proper test selectors from jsonforms inputs. | ||
* - selectors should be stable in next dev builds | ||
* - selectors should be uniq when properties are reused at different places or we always need select the parent component (form) first | ||
**/ | ||
cy.get('input[id="#/properties/firstName-input"]', {timeout: 30000}) | ||
.type('Max') | ||
|
||
cy.log('Visit wizards last form step before submission') | ||
cy.visit('/?token=demoToken&step=3') | ||
cy.get('button[title="proceed to next step"]').click() | ||
|
||
cy.get('main').contains('Almost done') | ||
// TODO we need proper selectors for the submit buttons | ||
|
||
cy.get('button[title="submit"]').first().click() | ||
cy.get('main').contains('Successfully submitted') | ||
|
||
cy.log('We expect, the test key is imported (gpg --import backend/data/keys/test.sec.gpg)') // TODO we should use a separate keyring | ||
cy.exec('(cd ../../backend/data/upload/demoToken/; gpg --decrypt --passphrase "test" "$(ls -t formData* | head -n1)")') | ||
.then($result => { | ||
const formData = JSON.parse($result.stdout) | ||
cy.log(formData) | ||
}) | ||
}) | ||
}) |