Skip to content

Commit

Permalink
Merge branch 'main' into renovate/cocoapods-1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
bakoushin authored Dec 16, 2024
2 parents 67aed98 + 1deaa95 commit 0a03ab8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
40 changes: 20 additions & 20 deletions e2e/src/QRScanner.spec.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
import { reloadReactNative } from './utils/retries'
import { quickOnboarding, waitForElementById } from './utils/utils'

const verifyCamera = async () => {
// testID 'Camera' is one of the few that works on Android. iOS uses 'CameraScanInfo' because the camera is behind an opacity overlay
device.getPlatform() === 'ios'
? await waitForElementById('CameraScanInfo')
: await waitForElementById('Camera')
}

describe('Given QR Scanner', () => {
beforeAll(async () => {
await quickOnboarding()
await reloadReactNative()
})

describe('When opening QR scanner', () => {
it('Then should display QR code', async () => {
await reloadReactNative()
await waitForElementById('HomeAction-Receive')
await element(by.id('HomeAction-Receive')).tap()
await waitForElementById('HomeAction-Receive', { tap: true })
await waitForElementById('QRCode')
await expect(element(by.id('QRCode'))).toBeVisible()
})

it('Then should be able to toggle camera', async () => {
await waitForElementById('Scan')
await element(by.id('Scan')).tap()
await waitForElementById('CameraScanInfo')
await expect(element(by.id('CameraScanInfo'))).toBeVisible()
await waitForElementById('Scan', { tap: true })
await verifyCamera()
})

it('Then should be able to toggle to QR code', async () => {
await waitForElementById('My Code')
await element(by.id('My Code')).tap()
await waitForElementById('My Code', { tap: true })
await waitForElementById('QRCode')
await expect(element(by.id('QRCode'))).toBeVisible()
})

it('Then should be able to close QR code scanner', async () => {
await waitForElementById('Times')
await element(by.id('Times')).tap()
await waitForElementById('Times', { tap: true })
await waitForElementById('HomeAction-Send')
await expect(element(by.id('HomeAction-Send'))).toBeVisible()
})
})

describe("When 'scanning' QR", () => {
beforeEach(async () => {
await reloadReactNative()
await waitForElementById('HomeAction-Receive')
await element(by.id('HomeAction-Receive')).tap()
await waitForElementById('Scan')
await element(by.id('Scan')).tap()
await waitForElementById('CameraScanInfo')
await element(by.id('CameraScanInfo')).tap()
await waitForElementById('HomeAction-Receive', { tap: true })
await waitForElementById('Scan', { tap: true })
await verifyCamera()
})

it('Then should be able to handle Celo pay QR', async () => {
// Use instead of waitForElementById as the element is not visible behind opacity overlay
await element(by.id('CameraScanInfo')).tap()
await waitForElementById('ManualInput')
await element(by.id('ManualInput')).replaceText(
'celo://wallet/pay?address=0xe5F5363e31351C38ac82DBAdeaD91Fd5a7B08846'
Expand All @@ -62,6 +60,8 @@ describe('Given QR Scanner', () => {
})

it('Then should handle address only QR', async () => {
// Use instead of waitForElementById as the element is not visible behind opacity overlay
await element(by.id('CameraScanInfo')).tap()
await waitForElementById('ManualInput')
await element(by.id('ManualInput')).replaceText('0xe5F5363e31351C38ac82DBAdeaD91Fd5a7B08846')
await waitForElementById('ManualSubmit')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"babel-jest": "^29.2.1",
"babel-plugin-module-resolver": "^4.1.0",
"chalk": "^4.0.0",
"detox": "^20.18.5",
"detox": "^20.28.0",
"dotenv": "^16.3.1",
"easy-table": "^1.2.0",
"escape-string-regexp": "^1.0.5",
Expand Down
24 changes: 15 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6945,24 +6945,30 @@ detect-node@^2.0.4:
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==

detox@^20.18.5:
version "20.20.3"
resolved "https://registry.yarnpkg.com/detox/-/detox-20.20.3.tgz#c39470523b1a75c4dc895666c5d749978978e42e"
integrity sha512-sca2z+6SYnA5+9jF1pf/t4RBOcvnBO0vmsTtrmnpej76Q5rhX0acZpFbDgvQQPGKu/TDdH+KFYK0tQ2VrTNY1w==
detox-copilot@^0.0.24:
version "0.0.24"
resolved "https://registry.yarnpkg.com/detox-copilot/-/detox-copilot-0.0.24.tgz#e505073866d1f4ff00641f2e48ef441a4dff6bbc"
integrity sha512-42g0QyJS31URl28YRxc4hGozSXhbbB1sKwzxEjZR9WtLoSx6WYDsQkQD8+yP5t1NExiSCZAfvNmBw8PYQwDKwg==

detox@^20.28.0:
version "20.28.0"
resolved "https://registry.yarnpkg.com/detox/-/detox-20.28.0.tgz#7ae848e8df028c17d65cd0672040cd1c18338b25"
integrity sha512-JeUkWNnYE7lqby3S9AeYJP3ttCBKH+qZWACjWXwvSbe3tm6JeXvecVUYkzSoNfC4IzTX5p+rWvG0IPsfOsZSFw==
dependencies:
ajv "^8.6.3"
bunyan "^1.8.12"
bunyan-debug-stream "^3.1.0"
caf "^15.0.1"
chalk "^4.0.0"
child-process-promise "^2.2.0"
detox-copilot "^0.0.24"
execa "^5.1.1"
find-up "^5.0.0"
fs-extra "^11.0.0"
funpermaproxy "^1.1.0"
glob "^8.0.3"
ini "^1.3.4"
jest-environment-emit "^1.0.5"
jest-environment-emit "^1.0.8"
json-cycle "^1.3.0"
lodash "^4.17.11"
multi-sort-stream "^1.0.3"
Expand Down Expand Up @@ -9611,10 +9617,10 @@ jest-each@^29.6.3:
jest-util "^29.6.3"
pretty-format "^29.6.3"

jest-environment-emit@^1.0.5:
version "1.0.7"
resolved "https://registry.yarnpkg.com/jest-environment-emit/-/jest-environment-emit-1.0.7.tgz#14c2197e9fa48affa25b15fc5f4a74690aea7efd"
integrity sha512-/0AYqbL3zrfRTtGyzTZwgRxQZiDXEM8ZUfY7Uscla/XGs9vszx4f0XTSZqAk3CQaiwYAoKvFZkB2vSKm1Q08fQ==
jest-environment-emit@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/jest-environment-emit/-/jest-environment-emit-1.0.8.tgz#ab0dad2c1dd04d3ca092762a99080607b0eef10b"
integrity sha512-WNqvxBLH0yNojHJQ99Y21963aT7UTavxV3PgiBQFi8zwrlnKU6HvkB6LOvQrbk5I8mI8JEKvcoOrQOvBVMLIXQ==
dependencies:
bunyamin "^1.5.2"
bunyan "^2.0.5"
Expand Down

0 comments on commit 0a03ab8

Please sign in to comment.