@smileid/web-components 1.0.1-beta → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/components/camera-permission/CameraPermission.js +6 -2
  2. package/components/camera-permission/CameraPermission.stories.js +10 -4
  3. package/components/document/src/DocumentCaptureScreens.js +15 -9
  4. package/components/document/src/DocumentCaptureScreens.stories.js +16 -12
  5. package/components/document/src/document-capture/DocumentCapture.js +295 -217
  6. package/components/document/src/document-capture/DocumentCapture.stories.js +9 -2
  7. package/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +33 -33
  8. package/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +8 -1
  9. package/components/document/src/document-capture-review/DocumentCaptureReview.js +15 -31
  10. package/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +12 -2
  11. package/components/end-user-consent/src/EndUserConsent.js +14 -31
  12. package/components/end-user-consent/src/EndUserConsent.stories.js +8 -2
  13. package/components/navigation/src/Navigation.js +10 -2
  14. package/components/selfie/src/SelfieCaptureScreens.js +36 -10
  15. package/components/selfie/src/SelfieCaptureScreens.stories.js +13 -4
  16. package/components/selfie/src/selfie-capture/SelfieCapture.js +94 -23
  17. package/components/selfie/src/selfie-capture/SelfieCapture.stories.js +14 -1
  18. package/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +50 -44
  19. package/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +8 -1
  20. package/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +3 -4
  21. package/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +8 -1
  22. package/components/signature-pad/package-lock.json +3009 -0
  23. package/components/signature-pad/package.json +6 -6
  24. package/components/signature-pad/src/SignaturePad.js +5 -1
  25. package/components/signature-pad/src/SignaturePad.stories.js +10 -2
  26. package/components/smart-camera-web/src/SmartCameraWeb.js +53 -8
  27. package/components/smart-camera-web/src/SmartCameraWeb.stories.js +22 -9
  28. package/components/totp-consent/src/TotpConsent.js +15 -3
  29. package/cypress/e2e/smart-camera-web-agent-mode.cy.js +144 -0
  30. package/cypress/e2e/smart-camera-web-complete-flow.cy.js +221 -0
  31. package/cypress/e2e/smart-camera-web.cy.js +1 -1
  32. package/cypress/pages/smart-camera-web-agent-mode.html +36 -0
  33. package/cypress/pages/smart-camera-web-complete-flow.html +42 -0
  34. package/domain/camera/src/SmartCamera.js +28 -0
  35. package/package.json +8 -8
  36. package/styles/src/styles.js +14 -3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smileid/signature-pad",
3
- "version": "1.0.0",
3
+ "version": "1.4.2",
4
4
  "private": "true",
5
5
  "exports": {
6
6
  ".": "./index.js"
@@ -15,16 +15,16 @@
15
15
  ],
16
16
  "author": "SmileID <support@usesmileid.com> (https://usesmileid.com)",
17
17
  "dependencies": {
18
- "signature_pad": "^4.1.7"
18
+ "signature_pad": "^5.0.2"
19
19
  },
20
20
  "devDependencies": {
21
21
  "eslint": "^8.57.0",
22
22
  "eslint-config-airbnb-base": "^15.0.0",
23
23
  "eslint-config-prettier": "^9.1.0",
24
- "eslint-plugin-cypress": "^3.0.2",
24
+ "eslint-plugin-cypress": "^3.3.0",
25
25
  "eslint-plugin-import": "^2.29.1",
26
- "eslint-plugin-jest": "^28.5.0",
27
- "eslint-plugin-prettier": "^5.1.3",
28
- "prettier": "^3.2.2"
26
+ "eslint-plugin-jest": "^28.6.0",
27
+ "eslint-plugin-prettier": "^5.2.1",
28
+ "prettier": "^3.3.3"
29
29
  }
30
30
  }
@@ -177,7 +177,7 @@ button[data-variant="text"] {
177
177
  }
178
178
 
179
179
  button[data-variant="solid"] {
180
- --button-color: var(--color-default);
180
+ --button-color: ${this.themeColor};
181
181
  border-radius: 2.5rem;
182
182
  border: 0;
183
183
  background-color: transparent;
@@ -468,6 +468,10 @@ button:disabled {
468
468
  get allowUpload() {
469
469
  return this.hasAttribute('allow-upload');
470
470
  }
471
+
472
+ get themeColor() {
473
+ return this.getAttribute('theme-color') || '#001096';
474
+ }
471
475
  }
472
476
 
473
477
  if ('customElements' in window) {
@@ -1,23 +1,31 @@
1
1
  import './SignaturePad';
2
2
 
3
3
  const meta = {
4
+ args: {
5
+ 'theme-color': '#001096',
6
+ },
7
+ argTypes: {
8
+ 'theme-color': { control: 'color' },
9
+ },
4
10
  component: 'smileid-signature-pad',
5
11
  };
6
12
 
7
13
  export default meta;
8
14
 
9
15
  export const SignaturePad = {
10
- render: () => `
16
+ render: (args) => `
11
17
  <smileid-signature-pad
18
+ theme-color='${args['theme-color']}'
12
19
  >
13
20
  </smileid-signature-pad>
14
21
  `,
15
22
  };
16
23
 
17
24
  export const SignaturePadWithUploads = {
18
- render: () => `
25
+ render: (args) => `
19
26
  <smileid-signature-pad
20
27
  allow-upload
28
+ theme-color='${args['theme-color']}'
21
29
  >
22
30
  </smileid-signature-pad>
23
31
  `,
@@ -9,14 +9,14 @@ import { version as COMPONENTS_VERSION } from '../../../package.json';
9
9
 
10
10
  function scwTemplateString() {
11
11
  return `
12
- ${styles}
12
+ ${styles(this.themeColor)}
13
13
  <div>
14
- <camera-permission ${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'}></camera-permission>
15
- <selfie-capture-screens ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
16
- ${this.hideBackToHost}
14
+ <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'} ${this.hideAttribution}></camera-permission>
15
+ <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
16
+ ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
17
17
  ></selfie-capture-screens>
18
- <document-capture-screens document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
19
- ${this.hideBackOfId} hidden></document-capture-screens>
18
+ <document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
19
+ ${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
20
20
  </div>
21
21
  `;
22
22
  }
@@ -61,21 +61,29 @@ class SmartCameraWeb extends HTMLElement {
61
61
 
62
62
  static get observedAttributes() {
63
63
  return [
64
+ 'allow-agent-mode',
65
+ 'disable-image-tests',
64
66
  'document-capture-modes',
65
67
  'document-type',
68
+ 'hide-attribution',
69
+ 'hide-back-of-id',
66
70
  'hide-back-to-host',
67
71
  'show-navigation',
68
- 'hide-back-of-id',
72
+ 'theme-color',
69
73
  ];
70
74
  }
71
75
 
72
76
  attributeChangedCallback(name) {
73
77
  switch (name) {
78
+ case 'allow-agent-mode':
79
+ case 'disable-image-tests':
74
80
  case 'document-capture-modes':
75
81
  case 'document-type':
82
+ case 'hide-attribution':
76
83
  case 'hide-back-of-id':
77
84
  case 'hide-back-to-host':
78
85
  case 'show-navigation':
86
+ case 'theme-color':
79
87
  this.disconnectedCallback();
80
88
  this.shadowRoot.innerHTML = this.render();
81
89
  this.setUpEventListeners();
@@ -109,7 +117,11 @@ class SmartCameraWeb extends HTMLElement {
109
117
  'selfie-capture-screens.publish',
110
118
  (event) => {
111
119
  this._data.images = event.detail.images;
112
- this.setActiveScreen(this.documentCapture);
120
+ if (!this.captureId) {
121
+ this._publishSelectedImages();
122
+ } else {
123
+ this.setActiveScreen(this.documentCapture);
124
+ }
113
125
  },
114
126
  );
115
127
 
@@ -186,6 +198,10 @@ class SmartCameraWeb extends HTMLElement {
186
198
  );
187
199
  }
188
200
 
201
+ get captureId() {
202
+ return this.hasAttribute('capture-id');
203
+ }
204
+
189
205
  get documentType() {
190
206
  return this.getAttribute('document-type');
191
207
  }
@@ -210,6 +226,18 @@ class SmartCameraWeb extends HTMLElement {
210
226
  return this.hasAttribute('hide-back-to-host') ? 'hide-back-to-host' : '';
211
227
  }
212
228
 
229
+ get allowAgentMode() {
230
+ return this.hasAttribute('allow-agent-mode')
231
+ ? `allow-agent-mode=${this.getAttribute('allow-agent-mode')}`
232
+ : '';
233
+ }
234
+
235
+ get allowAgentModeTests() {
236
+ return this.hasAttribute('show-agent-mode-for-tests')
237
+ ? 'show-agent-mode-for-tests'
238
+ : '';
239
+ }
240
+
213
241
  get title() {
214
242
  return this.hasAttribute('title')
215
243
  ? `title=${this.getAttribute('title')}`
@@ -232,6 +260,23 @@ class SmartCameraWeb extends HTMLElement {
232
260
  return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
233
261
  }
234
262
 
263
+ get hasThemeColor() {
264
+ return (
265
+ this.hasAttribute('theme-color') &&
266
+ ![null, undefined, 'null', 'undefined'].includes(
267
+ this.getAttribute('theme-color'),
268
+ )
269
+ );
270
+ }
271
+
272
+ get themeColor() {
273
+ return this.hasThemeColor ? this.getAttribute('theme-color') : '#001096';
274
+ }
275
+
276
+ get applyComponentThemeColor() {
277
+ return this.hasThemeColor ? `theme-color='${this.themeColor}'` : '';
278
+ }
279
+
235
280
  setActiveScreen(screen) {
236
281
  this.activeScreen?.setAttribute('hidden', '');
237
282
  screen.removeAttribute('hidden');
@@ -1,42 +1,55 @@
1
1
  import './SmartCameraWeb';
2
2
 
3
3
  const meta = {
4
+ args: {
5
+ 'theme-color': '#001096',
6
+ },
7
+ argTypes: {
8
+ 'theme-color': { control: 'color' },
9
+ },
4
10
  component: 'smart-camera-web',
5
11
  };
6
12
 
7
13
  export default meta;
8
14
 
9
15
  export const SmartCameraWeb = {
10
- render: () => `
11
- <smart-camera-web show-navigation>
16
+ render: (args) => `
17
+ <smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation>
12
18
  </smart-camera-web>
13
19
  `,
14
20
  };
15
21
 
16
22
  export const SmartCameraWebWithOutInstructions = {
17
- render: () => `
18
- <smart-camera-web hide-instructions>
23
+ render: (args) => `
24
+ <smart-camera-web theme-color='${args['theme-color']}' capture-id hide-instructions>
19
25
  </smart-camera-web>
20
26
  `,
21
27
  };
22
28
 
23
29
  export const SmartCameraWebWithOutNavigation = {
24
- render: () => `
25
- <smart-camera-web>
30
+ render: (args) => `
31
+ <smart-camera-web theme-color='${args['theme-color']}' capture-id>
26
32
  </smart-camera-web>
27
33
  `,
28
34
  };
29
35
 
30
36
  export const SmartCameraWebWithOutBackToHost = {
31
- render: () => `
32
- <smart-camera-web show-navigation hide-back-to-host>
37
+ render: (args) => `
38
+ <smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-to-host>
33
39
  </smart-camera-web>
34
40
  `,
35
41
  };
36
42
 
37
43
  export const SmartCameraWebWithOutBackId = {
44
+ render: (args) => `
45
+ <smart-camera-web theme-color='${args['theme-color']}' capture-id show-navigation hide-back-of-id>
46
+ </smart-camera-web>
47
+ `,
48
+ };
49
+
50
+ export const SmartCameraWebAgentMode = {
38
51
  render: () => `
39
- <smart-camera-web show-navigation hide-back-of-id>
52
+ <smart-camera-web hide-instructions hide-back-of-id allow-agent-mode='true' show-agent-mode-for-tests>
40
53
  </smart-camera-web>
41
54
  `,
42
55
  };
@@ -196,7 +196,7 @@ function markup() {
196
196
  .back-button-text {
197
197
  font-size: 11px;
198
198
  line-height: 11px;
199
- color: rgb(21, 31, 114);
199
+ color: ${this.themeColor || 'rgb(21, 31, 114)'};
200
200
  }
201
201
 
202
202
  #error,
@@ -290,7 +290,7 @@ function markup() {
290
290
  <button type='button' data-type='icon' id="back-button" class="back-button">
291
291
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
292
292
  <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
293
- <path fill="#001096" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
293
+ <path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
294
294
  </svg>
295
295
  </button>
296
296
  <div class="back-button-text">Back</div>
@@ -337,7 +337,7 @@ function markup() {
337
337
  <button type='button' data-type='icon' id="back-to-entry-button" class="back-button">
338
338
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
339
339
  <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
340
- <path fill="#001096" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
340
+ <path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
341
341
  </svg>
342
342
  </button>
343
343
  <div class="back-button-text">Back</div>
@@ -893,6 +893,18 @@ class TotpConsent extends HTMLElement {
893
893
  return this.getAttribute('token');
894
894
  }
895
895
 
896
+ get themeColor() {
897
+ return this.getAttribute('theme-color') || '#001096';
898
+ }
899
+
900
+ get hideBack() {
901
+ return this.hasAttribute('hide-back');
902
+ }
903
+
904
+ get showNavigation() {
905
+ return this.hasAttribute('show-navigation');
906
+ }
907
+
896
908
  handleTotpConsentGrant() {
897
909
  const customEvent = new CustomEvent('end-user-consent.totp.granted', {
898
910
  detail: {
@@ -0,0 +1,144 @@
1
+ context('SmartCameraWeb', () => {
2
+ beforeEach(() => {
3
+ cy.visit('/smart-camera-web-agent-mode');
4
+ });
5
+
6
+ it('should switch from the selfie mode to agent mode"', () => {
7
+ cy.log('Enable agent mode for tests');
8
+ cy.get('smart-camera-web')
9
+ .invoke('attr', 'allow-agent-mode', 'true')
10
+ .should('have.attr', 'allow-agent-mode', 'true');
11
+
12
+ cy.get('smart-camera-web').invoke(
13
+ 'attr',
14
+ 'show-agent-mode-for-tests',
15
+ 'true',
16
+ );
17
+ cy.get('smart-camera-web').invoke('attr', 'disable-image-tests', '');
18
+
19
+ cy.clock();
20
+ cy.get('smart-camera-web')
21
+ .shadow()
22
+ .find('selfie-capture-instructions')
23
+ .shadow()
24
+ .find('#allow')
25
+ .click();
26
+
27
+ cy.get('smart-camera-web')
28
+ .shadow()
29
+ .find('selfie-capture')
30
+ .should('be.visible');
31
+
32
+ cy.get('smart-camera-web')
33
+ .shadow()
34
+ .find('selfie-capture')
35
+ .shadow()
36
+ .should('contain.text', 'Agent Mode On');
37
+
38
+ cy.get('smart-camera-web')
39
+ .shadow()
40
+ .find('selfie-capture')
41
+ .shadow()
42
+ .find('#switch-camera')
43
+ .click();
44
+
45
+ cy.get('smart-camera-web')
46
+ .shadow()
47
+ .find('selfie-capture')
48
+ .shadow()
49
+ .should('contain.text', 'Agent Mode Off');
50
+
51
+ cy.get('smart-camera-web')
52
+ .shadow()
53
+ .find('selfie-capture')
54
+ .shadow()
55
+ .find('#switch-camera')
56
+ .click();
57
+
58
+ cy.get('smart-camera-web')
59
+ .shadow()
60
+ .find('selfie-capture')
61
+ .shadow()
62
+ .should('contain.text', 'Agent Mode On');
63
+
64
+ cy.get('smart-camera-web')
65
+ .shadow()
66
+ .find('selfie-capture')
67
+ .shadow()
68
+ .should('contain.text', 'Take a Selfie');
69
+
70
+ cy.get('smart-camera-web')
71
+ .shadow()
72
+ .find('selfie-capture')
73
+ .shadow()
74
+ .find('#start-image-capture')
75
+ .click();
76
+
77
+ cy.tick(8000);
78
+
79
+ cy.get('smart-camera-web')
80
+ .shadow()
81
+ .find('selfie-capture')
82
+ .shadow()
83
+ .should('not.be.visible');
84
+
85
+ cy.get('smart-camera-web')
86
+ .shadow()
87
+ .find('selfie-capture-review')
88
+ .should('be.visible');
89
+ });
90
+
91
+ it('should not show the agent mode switch button"', () => {
92
+ cy.get('smart-camera-web')
93
+ .shadow()
94
+ .find('selfie-capture')
95
+ .invoke('attr', 'show-agent-mode-for-tests', 'false');
96
+ cy.get('smart-camera-web').invoke('attr', 'disable-image-tests', '');
97
+
98
+ cy.clock();
99
+ cy.get('smart-camera-web')
100
+ .shadow()
101
+ .find('selfie-capture-instructions')
102
+ .shadow()
103
+ .find('#allow')
104
+ .click();
105
+
106
+ cy.get('smart-camera-web')
107
+ .shadow()
108
+ .find('selfie-capture')
109
+ .should('be.visible');
110
+
111
+ cy.get('smart-camera-web')
112
+ .shadow()
113
+ .find('selfie-capture')
114
+ .shadow()
115
+ .find('#switch-camera')
116
+ .should('not.exist');
117
+
118
+ cy.get('smart-camera-web')
119
+ .shadow()
120
+ .find('selfie-capture')
121
+ .shadow()
122
+ .should('contain.text', 'Take a Selfie');
123
+
124
+ cy.get('smart-camera-web')
125
+ .shadow()
126
+ .find('selfie-capture')
127
+ .shadow()
128
+ .find('#start-image-capture')
129
+ .click();
130
+
131
+ cy.tick(8000);
132
+
133
+ cy.get('smart-camera-web')
134
+ .shadow()
135
+ .find('selfie-capture')
136
+ .shadow()
137
+ .should('not.be.visible');
138
+
139
+ cy.get('smart-camera-web')
140
+ .shadow()
141
+ .find('selfie-capture-review')
142
+ .should('be.visible');
143
+ });
144
+ });
@@ -0,0 +1,221 @@
1
+ const themeColor = '#001093';
2
+ context('SmartCameraWeb', () => {
3
+ beforeEach(() => {
4
+ cy.visit('/smart-camera-web-complete-flow');
5
+ });
6
+
7
+ it('should go from the camera screen through to document review with camera capture', () => {
8
+ cy.clock();
9
+
10
+ cy.get('smart-camera-web')
11
+ .invoke('attr', 'theme-color')
12
+ .should('equal', themeColor);
13
+
14
+ cy.get('smart-camera-web')
15
+ .shadow()
16
+ .find('selfie-capture-instructions')
17
+ .invoke('attr', 'theme-color')
18
+ .should('equal', themeColor);
19
+
20
+ cy.get('smart-camera-web')
21
+ .shadow()
22
+ .find('selfie-capture-instructions')
23
+ .shadow()
24
+ .find('#allow')
25
+ .click();
26
+
27
+ cy.get('smart-camera-web')
28
+ .shadow()
29
+ .find('selfie-capture-instructions')
30
+ .should('not.be.visible');
31
+
32
+ cy.get('smart-camera-web')
33
+ .shadow()
34
+ .find('selfie-capture')
35
+ .should('be.visible');
36
+
37
+ cy.get('smart-camera-web')
38
+ .shadow()
39
+ .find('selfie-capture')
40
+ .invoke('attr', 'theme-color')
41
+ .should('equal', themeColor);
42
+
43
+ cy.get('smart-camera-web')
44
+ .shadow()
45
+ .find('selfie-capture')
46
+ .shadow()
47
+ .should('contain.text', 'Take a Selfie');
48
+
49
+ cy.get('smart-camera-web')
50
+ .shadow()
51
+ .find('selfie-capture')
52
+ .shadow()
53
+ .find('#start-image-capture')
54
+ .click();
55
+
56
+ cy.tick(8000);
57
+
58
+ cy.get('smart-camera-web')
59
+ .shadow()
60
+ .find('selfie-capture')
61
+ .shadow()
62
+ .should('not.be.visible');
63
+
64
+ cy.get('smart-camera-web')
65
+ .shadow()
66
+ .find('selfie-capture-review')
67
+ .should('be.visible');
68
+
69
+ cy.get('smart-camera-web')
70
+ .shadow()
71
+ .find('selfie-capture-review')
72
+ .invoke('attr', 'theme-color')
73
+ .should('equal', themeColor);
74
+
75
+ cy.get('smart-camera-web')
76
+ .shadow()
77
+ .find('selfie-capture-review')
78
+ .shadow()
79
+ .find('#select-id-image')
80
+ .click();
81
+
82
+ cy.get('smart-camera-web')
83
+ .shadow()
84
+ .find('selfie-capture-review')
85
+ .shadow()
86
+ .should('not.be.visible');
87
+
88
+ cy.get('smart-camera-web')
89
+ .shadow()
90
+ .find('document-capture-instructions')
91
+ .should('be.visible');
92
+
93
+ cy.get('smart-camera-web')
94
+ .shadow()
95
+ .find('document-capture-instructions#document-capture-instructions-front')
96
+ .invoke('attr', 'theme-color')
97
+ .should('equal', themeColor);
98
+
99
+ cy.get('smart-camera-web')
100
+ .shadow()
101
+ .find('document-capture-instructions#document-capture-instructions-front')
102
+ .shadow()
103
+ .find('#take-photo')
104
+ .click();
105
+
106
+ cy.get('smart-camera-web')
107
+ .shadow()
108
+ .find('document-capture-instructions#document-capture-instructions-front')
109
+ .should('not.be.visible');
110
+
111
+ cy.get('smart-camera-web')
112
+ .shadow()
113
+ .find('document-capture#document-capture-front')
114
+ .should('be.visible');
115
+
116
+ cy.get('smart-camera-web')
117
+ .shadow()
118
+ .find('document-capture#document-capture-front')
119
+ .invoke('attr', 'theme-color')
120
+ .should('equal', themeColor);
121
+
122
+ cy.get('smart-camera-web')
123
+ .shadow()
124
+ .find('document-capture#document-capture-front')
125
+ .shadow()
126
+ .find('#capture-id-image')
127
+ .click();
128
+
129
+ cy.get('smart-camera-web')
130
+ .shadow()
131
+ .find('document-capture#document-capture-front')
132
+ .should('not.be.visible');
133
+
134
+ cy.get('smart-camera-web')
135
+ .shadow()
136
+ .find('document-capture-review#front-of-document-capture-review')
137
+ .should('be.visible');
138
+
139
+ cy.get('smart-camera-web')
140
+ .shadow()
141
+ .find('document-capture-review#front-of-document-capture-review')
142
+ .invoke('attr', 'theme-color')
143
+ .should('equal', themeColor);
144
+
145
+ cy.get('smart-camera-web')
146
+ .shadow()
147
+ .find('document-capture-review#front-of-document-capture-review')
148
+ .shadow()
149
+ .find('#select-id-image')
150
+ .click();
151
+
152
+ cy.get('smart-camera-web')
153
+ .shadow()
154
+ .find('document-capture-review#front-of-document-capture-review')
155
+ .should('not.be.visible');
156
+
157
+ cy.get('smart-camera-web')
158
+ .shadow()
159
+ .find('document-capture-instructions#document-capture-instructions-back')
160
+ .should('be.visible');
161
+
162
+ cy.get('smart-camera-web')
163
+ .shadow()
164
+ .find('document-capture-instructions#document-capture-instructions-back')
165
+ .invoke('attr', 'theme-color')
166
+ .should('equal', themeColor);
167
+
168
+ cy.get('smart-camera-web')
169
+ .shadow()
170
+ .find('document-capture-instructions#document-capture-instructions-back')
171
+ .shadow()
172
+ .find('#take-photo')
173
+ .click();
174
+
175
+ cy.get('smart-camera-web')
176
+ .shadow()
177
+ .find('document-capture-instructions#document-capture-instructions-back')
178
+ .should('not.be.visible');
179
+
180
+ cy.get('smart-camera-web')
181
+ .shadow()
182
+ .find('document-capture#document-capture-back')
183
+ .should('be.visible');
184
+
185
+ cy.get('smart-camera-web')
186
+ .shadow()
187
+ .find('document-capture#document-capture-back')
188
+ .invoke('attr', 'theme-color')
189
+ .should('equal', themeColor);
190
+
191
+ cy.get('smart-camera-web')
192
+ .shadow()
193
+ .find('document-capture#document-capture-back')
194
+ .shadow()
195
+ .find('#capture-id-image')
196
+ .click();
197
+
198
+ cy.get('smart-camera-web')
199
+ .shadow()
200
+ .find('document-capture#document-capture-back')
201
+ .should('not.be.visible');
202
+
203
+ cy.get('smart-camera-web')
204
+ .shadow()
205
+ .find('document-capture-review#back-of-document-capture-review')
206
+ .should('be.visible');
207
+
208
+ cy.get('smart-camera-web')
209
+ .shadow()
210
+ .find('document-capture-review#back-of-document-capture-review')
211
+ .invoke('attr', 'theme-color')
212
+ .should('equal', themeColor);
213
+
214
+ cy.get('smart-camera-web')
215
+ .shadow()
216
+ .find('document-capture-review#back-of-document-capture-review')
217
+ .shadow()
218
+ .find('#select-id-image')
219
+ .click();
220
+ });
221
+ });
@@ -271,7 +271,7 @@ context('SmartCameraWeb', () => {
271
271
  .should('not.be.visible');
272
272
  });
273
273
 
274
- it('should switch to request screen when "Rest"', () => {
274
+ it('should switch to request screen when "Reset"', () => {
275
275
  cy.get('smart-camera-web').then((element) => {
276
276
  element[0].reset();
277
277
  });