-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for dev api * Fix: some api's require two different versions, append api version where neccessary * Fix double https appended to web-token endpoint * fix e-signature test
- Loading branch information
Showing
15 changed files
with
230 additions
and
67 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
packages/embed/cypress/pages/enhanced_document_verification_dev.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,44 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
max-width: 100%; | ||
min-height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<script src="js/script.min.js"></script> | ||
|
||
<script> | ||
SmileIdentity({ | ||
token: | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX3BhcmFtcyI6eyJ1c2VyX2lkIjoidXNlci1mZTIwY2JkYS1jMjJiLTRmZmUtOWRlZC05YjZhZGI2MDE1ZmIiLCJqb2JfaWQiOiJqb2ItNjYzY2VhNTUtZWIxYy00MjI2LWI1N2YtOGEwMTAwOTc4ZjViIiwiam9iX3R5cGUiOjF9LCJjYWxsYmFja191cmwiOiJodHRwczovL3dlYmhvb2suc2l0ZS9iZTM0YzkzZC1hOTFmLTQzZGItYWVmMi05MDZjNWNkOTVkNDciLCJpYXQiOjE2MzQyODE0MTAsImV4cCI6MTYzNTkxNTY4NH0.B4JaP4UWbNs38hV9nQ_9_Pnpos0fM3qu2nGG7Eymjs8', | ||
product: 'enhanced_document_verification', | ||
callback_url: | ||
'https://portal.usesmileid.com/api/v2/007/postback/update_status', | ||
environment: 'sandbox', | ||
partner_details: { | ||
name: 'Test Org', | ||
logo_url: 'https://portal.usesmileid.com/favicon.ico', | ||
partner_id: '007', | ||
policy_url: 'https://usesmileid.com/privacy-policy', | ||
theme_color: '#000', | ||
}, | ||
onSuccess: () => {}, | ||
onClose: () => {}, | ||
}); | ||
</script> | ||
</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
89 changes: 89 additions & 0 deletions
89
packages/embed/cypress/tests/enhanced-document-verification-dev.cy.cjs
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,89 @@ | ||
describe('enhanced document verification', () => { | ||
beforeEach(() => { | ||
cy.intercept( | ||
{ | ||
method: 'POST', | ||
url: '*upload*', | ||
}, | ||
{ | ||
upload_url: | ||
'https://smile-uploads-development01.s3.us-west-2.amazonaws.com/videos/212/212-0000060103-0gdzke3mdtlco5k0sdfh6vifzcrd3n/ekyc_smartselfie.zip', | ||
}, | ||
).as('getUploadURL'); | ||
|
||
cy.intercept( | ||
{ | ||
method: 'PUT', | ||
url: 'https://smile-uploads-development01.s3.us-west-2.amazonaws.com/videos/212/212-0000060103-0gdzke3mdtlco5k0sdfh6vifzcrd3n/ekyc_smartselfie.zip', | ||
}, | ||
{ | ||
statusCode: 200, | ||
}, | ||
).as('successfulUpload'); | ||
|
||
cy.loadIDOptions('https://example.smileidentity.com/v1'); | ||
|
||
cy.visit('/enhanced_document_verification_dev'); | ||
|
||
cy.selectVOTERIDType(); | ||
|
||
cy.navigateThroughCameraScreens(); | ||
}); | ||
|
||
it('should capture selfie and id image', () => { | ||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.invoke('attr', 'document-type') | ||
.should('eq', 'VOTER_ID'); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#id-entry-screen') | ||
.should('be.visible'); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#id-entry-screen #take-photo') | ||
.click(); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#id-camera-screen') | ||
.should('be.visible'); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#capture-id-image') | ||
.click(); | ||
|
||
cy.wait(2000); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#id-camera-screen') | ||
.should('not.be.visible'); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#select-id-image') | ||
.click(); | ||
|
||
cy.getIFrameBody() | ||
.find('smart-camera-web') | ||
.shadow() | ||
.find('#id-review-screen') | ||
.should('not.be.visible'); | ||
|
||
cy.wait('@getUploadURL'); | ||
|
||
cy.wait('@successfulUpload'); | ||
|
||
cy.getIFrameBody().find('#complete-screen').should('be.visible'); | ||
}); | ||
}); |
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
Oops, something went wrong.