Skip to content

Commit 7811d85

Browse files
committed
fix: cypress liveness and in-app-messaging
1 parent 0de23d0 commit 7811d85

File tree

9 files changed

+53
-38
lines changed

9 files changed

+53
-38
lines changed

.github/dependency-review/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ allow-licenses:
3535
- 'zlib-acknowledgement'
3636
- 'Zlib'
3737
allow-dependencies-licenses:
38+
# These packages are needed for nextjs (more detailed sharp)
39+
# they are dynamic libraries and thus do not ship the underlying library
40+
# which means they are not under LGPL strictly speaking.
41+
# so an exception is valid here
42+
# ALSO: none of these are shipped to the customer. they're only used for examples.
3843
- 'pkg:npm/%2540img/sharp-libvips-darwin-arm64@1.2.4'
3944
- 'pkg:npm/%2540img/sharp-libvips-darwin-x64@1.2.4'
4045
- 'pkg:npm/%2540img/sharp-libvips-linux-arm@1.2.4'

packages/e2e/cypress/integration/common/fileuploader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ When('I select a file with file name {string}', (fileName: string) => {
77
When(
88
'I select a file with file name {string} and another file with file name {string}',
99
(fileName: string, fileName2: string) => {
10-
cy.fileInputUpload(fileName);
11-
cy.fileInputUpload(fileName2);
10+
cy.fileInputUpload([fileName, fileName2]);
1211
}
1312
);
1413

1514
When('I drag and drop a file with file name {string}', (fileName: string) => {
16-
cy.get('input[type=file]').trigger('drop', {
15+
const input = cy.get('input[type=file]', { timeout: 5000 }).wait(5000);
16+
input.trigger('drop', {
1717
dataTransfer: {
1818
files: [
1919
new File(['file contents'], fileName, { lastModified: Date.now() }),

packages/e2e/cypress/integration/common/shared.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <reference types="../../support/commands" />
44

55
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
6-
import { get, escapeRegExp } from 'lodash';
6+
import { escapeRegExp, get } from 'lodash';
77

88
let language = 'en-US';
99
let window = null;
@@ -290,6 +290,7 @@ When('I click the element with id attribute {string}', (id: string) => {
290290
When('I click the {string} button', (name: string) => {
291291
cy.findByRole('button', {
292292
name: new RegExp(`^${escapeRegExp(name)}$`, 'i'),
293+
timeout: 5000,
293294
}).click();
294295
});
295296

packages/e2e/cypress/integration/ui/components/in-app-messaging/demo/demo.steps.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,22 @@ Given('{string} checkbox is checked', (checkboxName: string) => {
55
.next()
66
.should('have.attr', 'data-checked', 'true');
77
});
8+
Given('{string} checkbox is unchecked', (checkboxName: string) => {
9+
cy.findByText(checkboxName)
10+
.next()
11+
.should('have.attr', 'data-checked', 'false');
12+
});
813

914
Given('{string} layout radio option is selected', (radioOption: string) => {
1015
cy.findByText(radioOption).next().should('have.attr', 'checked');
1116
});
1217

1318
When('I click the {string} layout radio option', (radioOption: string) => {
14-
cy.findByText(radioOption).click();
19+
cy.findByText(radioOption, { timeout: 5000 }).click();
1520
});
1621

1722
When('I toggle {string} checkbox', (checkboxName: string) => {
18-
cy.findByText(checkboxName).click();
23+
cy.findByText(checkboxName, { timeout: 5000 }).click();
1924
});
2025

2126
When('I wait for pinpoint messages to sync', () => {

packages/e2e/cypress/support/commands.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,26 @@ Cypress.Commands.add('typeInInputHandler', (field: string, value: string) => {
9595
Cypress.Commands.add(
9696
'fileInputUpload',
9797
(
98-
fileName: string,
98+
fileName: string | string[],
9999
fileCount: number = 1,
100100
fileSize?: number,
101101
fileType?: string
102102
) => {
103+
let isArray = Array.isArray(fileName);
104+
if (isArray) {
105+
fileCount = fileName.length;
106+
}
103107
const folderFiles = [];
104108
for (let i = 1; i <= fileCount; i++) {
105109
folderFiles.push({
106110
contents: fileSize
107111
? Cypress.Buffer.alloc(fileSize)
108112
: Cypress.Buffer.from(`File ${i} content`),
109-
fileName: `${fileName}-${i}`,
113+
fileName: isArray ? fileName[i] : `${fileName}-${i}`,
110114
mimeType: fileType ?? 'text/plain',
111115
});
112116
}
113117
const input = cy.get('input[type="file"]').wait(5000);
114-
const selected = input.selectFile(folderFiles[0], { force: true });
118+
input.selectFile(folderFiles, { force: true });
115119
}
116120
);

packages/react-liveness/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
"@smithy/signature-v4": "5.1.2",
5959
"@smithy/types": "^4.3.1",
6060
"@mediapipe/face_detection": "^0.4.1646425229",
61-
"@tensorflow-models/face-detection": "./packed/tensorflow-models-face-detection-1.0.3.tgz",
62-
"@tensorflow/tfjs-backend-cpu": "4.22.0",
63-
"@tensorflow/tfjs-backend-wasm": "4.22.0",
64-
"@tensorflow/tfjs-converter": "4.22.0",
65-
"@tensorflow/tfjs-core": "4.22.0",
61+
"@tensorflow-models/face-detection": "./packed/tensorflow-models-face-detection-v1.0.3.tgz",
62+
"@tensorflow/tfjs-backend-cpu": "4.11.0",
63+
"@tensorflow/tfjs-backend-wasm": "4.11.0",
64+
"@tensorflow/tfjs-converter": "4.11.0",
65+
"@tensorflow/tfjs-core": "4.11.0",
6666
"@xstate/react": "^3.2.2",
6767
"tslib": "^2.5.2",
6868
"uuid": "^11.1.0",
-130 KB
Binary file not shown.
136 KB
Binary file not shown.

yarn.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)