Skip to content

Commit

Permalink
enh: improve document capture, fix icon buttons, add capture tips (#36)
Browse files Browse the repository at this point in the history
* redesign: change back button icon / font color

* redesign: switch close icon

* redesign: reinstate tips for back of document capture

* redesign: remove auto margin for actions on id entry screens

* enh: add "Skip this step" button for back of id photo

this shows up only when a document-type does not exist

* 1.0.0-beta.23

* redesign: use image-frame to crop id image
  • Loading branch information
tamssokari authored Sep 29, 2023
1 parent 6fab3f2 commit 1e3896e
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 52 deletions.
163 changes: 163 additions & 0 deletions cypress/e2e/skip-back-of-id.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
context('SmartCameraWeb - Skip Back of ID Document Capture', () => {
beforeEach(() => {
cy.visit('/capture-back-of-id');
});

context('when a document type does not exist', () => {
it('should switch from the back of ID entry screen to the thanks screen on clicking the "Skip this step" button', () => {
cy
.get('smart-camera-web')
.shadow()
.find('#request-camera-access')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#start-image-capture')
.click();

cy
.wait(8000);

cy
.get('smart-camera-web')
.shadow()
.find('#select-selfie')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen')
.should('be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen #take-photo')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen')
.should('not.be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#capture-id-image')
.click();

cy
.wait(2000);

cy
.get('smart-camera-web')
.shadow()
.find('#select-id-image')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#back-of-id-entry-screen')
.should('be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#back-of-id-entry-screen #skip-this-step')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#back-of-id-entry-screen')
.should('not.be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#thanks-screen')
.should('be.visible');
});
});

context('when a document-type exists', () => {
beforeEach(() => {
cy
.get('smart-camera-web')
.invoke('attr', 'document-type', 'GREEN_BOOK');
});

it('should not show the "skip this step" button', () => {
cy
.get('smart-camera-web')
.shadow()
.find('#request-camera-access')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#start-image-capture')
.click();

cy
.wait(8000);

cy
.get('smart-camera-web')
.shadow()
.find('#select-selfie')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen')
.should('be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen #take-photo')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#id-entry-screen')
.should('not.be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#capture-id-image')
.click();

cy
.wait(2000);

cy
.get('smart-camera-web')
.shadow()
.find('#select-id-image')
.click();

cy
.get('smart-camera-web')
.shadow()
.find('#back-of-id-entry-screen')
.should('be.visible');

cy
.get('smart-camera-web')
.shadow()
.find('#back-of-id-entry-screen #skip-this-step')
.should('not.exist');
});
});
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smile_identity/smart-camera-web",
"version": "1.0.0-beta.22",
"version": "1.0.0-beta.23",
"description": "WebComponent for smartly capturing images on the web, for use with SmileIdentity",
"main": "smart-camera-web.js",
"scripts": {
Expand Down
Loading

0 comments on commit 1e3896e

Please sign in to comment.