From cf4ae4fe48d3ad81201272de004fc187af8e3741 Mon Sep 17 00:00:00 2001 From: Newton Date: Mon, 22 Apr 2019 20:29:54 -0300 Subject: [PATCH 1/7] Converts detox tests to ts --- e2e/config.json | 7 ++--- e2e/{init.js => init.ts} | 11 ++++---- e2e/page-objects/AmountInputPageObject.ts | 15 ++++++++-- e2e/page-objects/QRCodePageObject.ts | 12 ++++++-- e2e/tests/request-money/request-money.spec.ts | 28 +++++++++++-------- package-lock.json | 12 ++++++++ package.json | 2 ++ 7 files changed, 62 insertions(+), 25 deletions(-) rename e2e/{init.js => init.ts} (60%) diff --git a/e2e/config.json b/e2e/config.json index 27c5a8e..ac51d06 100644 --- a/e2e/config.json +++ b/e2e/config.json @@ -1,6 +1,5 @@ { - "setupFilesAfterEnv": [ - "./init.js" - ], - "testEnvironment": "node" + "preset": "ts-jest", + "testEnvironment": "node", + "setupTestFrameworkScriptFile": "./init.ts" } \ No newline at end of file diff --git a/e2e/init.js b/e2e/init.ts similarity index 60% rename from e2e/init.js rename to e2e/init.ts index 0aaf588..8e983e2 100644 --- a/e2e/init.js +++ b/e2e/init.ts @@ -1,12 +1,13 @@ -const detox = require('detox'); +import { cleanup, init } from 'detox'; +import * as adapter from 'detox/runners/jest/adapter'; + const config = require('../package.json').detox; -const adapter = require('detox/runners/jest/adapter'); jest.setTimeout(120000); jasmine.getEnv().addReporter(adapter); beforeAll(async () => { - await detox.init(config); + await init(config, { initGlobals: false }); }); beforeEach(async () => { @@ -15,5 +16,5 @@ beforeEach(async () => { afterAll(async () => { await adapter.afterAll(); - await detox.cleanup(); -}); \ No newline at end of file + await cleanup(); +}); diff --git a/e2e/page-objects/AmountInputPageObject.ts b/e2e/page-objects/AmountInputPageObject.ts index 883bfd0..024ac9d 100644 --- a/e2e/page-objects/AmountInputPageObject.ts +++ b/e2e/page-objects/AmountInputPageObject.ts @@ -1,13 +1,22 @@ +import { by, element } from 'detox'; +import { QRCodePageObject } from './QRCodePageObject'; + export class AmountInputPageObject { - public async getScreen() { - return element(by.id('AmountInputScreen')); + + public async assertIsVisible() { + expect(element(by.id('AmountInputScreen'))).toBeVisible(); } public async fillAmount(amount: number) { await element(by.id('amountInput')).typeText(`${amount}`); } - public async confirm() { + public async assertHasAmountOf(amount: number) { + expect(element(by.text(`${amount}`))).toBeVisible(); + } + + public async confirm(): Promise { await element(by.id('confirmButton')).tap(); + return new QRCodePageObject(); } } diff --git a/e2e/page-objects/QRCodePageObject.ts b/e2e/page-objects/QRCodePageObject.ts index dfd6d7f..7027193 100644 --- a/e2e/page-objects/QRCodePageObject.ts +++ b/e2e/page-objects/QRCodePageObject.ts @@ -1,9 +1,17 @@ +import { by, element } from 'detox'; + export class QRCodePageObject { - public async getScreen() { - return element(by.id('QRCodeScreen')); + + public async assertIsVisible() { + expect(element(by.id('QRCodeScreen'))).toBeVisible(); } public async share() { await element(by.id('shareBtn')).tap(); } + + public async assertIsShared() { + expect(element(by.text('OK'))).toBeVisible(); + } + } diff --git a/e2e/tests/request-money/request-money.spec.ts b/e2e/tests/request-money/request-money.spec.ts index ad5b871..eed9197 100644 --- a/e2e/tests/request-money/request-money.spec.ts +++ b/e2e/tests/request-money/request-money.spec.ts @@ -1,4 +1,6 @@ -const { reloadApp } = require('detox-expo-helpers'); +import { reloadApp } from 'detox-expo-helpers'; +import { AmountInputPageObject } from '../../page-objects/AmountInputPageObject'; +import { QRCodePageObject } from '../../page-objects/QRCodePageObject'; describe('Request money', () => { beforeAll(async () => { @@ -6,22 +8,26 @@ describe('Request money', () => { }); it('should show amount input screen', async () => { - await expect(element(by.id('AmountInputScreen'))).toBeVisible(); + const amountInputPage = new AmountInputPageObject(); + await amountInputPage.assertIsVisible(); }); - it('should type request money amount', async () => { - await element(by.id('amountInput')).typeText('5'); + it('should fill the requested amount', async () => { + const amountInputPage = new AmountInputPageObject(); + await amountInputPage.fillAmount(5); + await amountInputPage.assertHasAmountOf(5); }); - it('should confirm request money', async () => { - await element(by.id('confirmButton')).tap(); + it('should confirm the requested amount', async () => { + const amountInputPage = new AmountInputPageObject(); + const qrCodePage = await amountInputPage.confirm(); + await qrCodePage.assertIsVisible(); }); - it('should should show qrcode screen', async () => { - await element(by.id('QRCodeScreen')).toBeVisible(); + it('should share the QR code', async () => { + const qrCodePage = new QRCodePageObject(); + await qrCodePage.share(); + await qrCodePage.assertIsShared(); }); - it('should share the qrcode', async () => { - await element(by.id('shareButton')).tap(); - }); }); diff --git a/package-lock.json b/package-lock.json index dea243a..bf862d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3214,6 +3214,12 @@ "@babel/types": "^7.3.0" } }, + "@types/detox": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@types/detox/-/detox-9.0.5.tgz", + "integrity": "sha512-4nbHjo4GRK3oUneeVL6Qbrd4FRNiDp+pwHZLFjGFKcxmV61jMkSatONYdDN9GGe9dKddVR4NIkPd9HMf/gt1vA==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -3259,6 +3265,12 @@ "integrity": "sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg==", "dev": true }, + "@types/jasmine": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.3.12.tgz", + "integrity": "sha512-lXvr2xFQEVQLkIhuGaR3GC1L9lMU1IxeWnAF/wNY5ZWpC4p9dgxkKkzMp7pntpAdv9pZSnYqgsBkCg32MXSZMg==", + "dev": true + }, "@types/jest": { "version": "24.0.11", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.11.tgz", diff --git a/package.json b/package.json index f767529..613507b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,9 @@ "react-navigation": "3.6.1" }, "devDependencies": { + "@types/detox": "^9.0.5", "@types/expo": "32.0.9", + "@types/jasmine": "^3.3.12", "@types/jest": "24.0.11", "@types/react": "16.8.12", "@types/react-native": "0.57.42", From bca515dcc601b79af9ca9aff20e5aadab066e732 Mon Sep 17 00:00:00 2001 From: Newton Date: Mon, 22 Apr 2019 20:37:12 -0300 Subject: [PATCH 2/7] Fixes ts compiling problems --- e2e/index.d.ts | 5 +++++ e2e/page-objects/AmountInputPageObject.ts | 2 +- e2e/page-objects/QRCodePageObject.ts | 2 +- tsconfig.json | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 e2e/index.d.ts diff --git a/e2e/index.d.ts b/e2e/index.d.ts new file mode 100644 index 0000000..f54b712 --- /dev/null +++ b/e2e/index.d.ts @@ -0,0 +1,5 @@ +declare module 'detox-expo-helpers' { + + export function reloadApp(): void; + +} diff --git a/e2e/page-objects/AmountInputPageObject.ts b/e2e/page-objects/AmountInputPageObject.ts index 024ac9d..ad5f640 100644 --- a/e2e/page-objects/AmountInputPageObject.ts +++ b/e2e/page-objects/AmountInputPageObject.ts @@ -1,4 +1,4 @@ -import { by, element } from 'detox'; +import { by, element, expect } from 'detox'; import { QRCodePageObject } from './QRCodePageObject'; export class AmountInputPageObject { diff --git a/e2e/page-objects/QRCodePageObject.ts b/e2e/page-objects/QRCodePageObject.ts index 7027193..a36314b 100644 --- a/e2e/page-objects/QRCodePageObject.ts +++ b/e2e/page-objects/QRCodePageObject.ts @@ -1,4 +1,4 @@ -import { by, element } from 'detox'; +import { by, element, expect } from 'detox'; export class QRCodePageObject { diff --git a/tsconfig.json b/tsconfig.json index de89c0d..3633632 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,8 @@ }, "include": [ "./**/*.ts", - "./**/*.tsx" + "./**/*.tsx", + "e2e/index.d.ts", ], "exclude": [ "**/node_modules/*" From 8ecdff6a7d0a0b0c37dc7e53e62adffe89c2f2a4 Mon Sep 17 00:00:00 2001 From: Newton Date: Tue, 23 Apr 2019 06:50:54 -0300 Subject: [PATCH 3/7] =?UTF-8?q?Adiciona=20o=20=C3=BAltimo=20passo=20no=20t?= =?UTF-8?q?este=20de=20happy=20path=20do=20detox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/tests/request-money/request-money.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2e/tests/request-money/request-money.spec.ts b/e2e/tests/request-money/request-money.spec.ts index eed9197..0431396 100644 --- a/e2e/tests/request-money/request-money.spec.ts +++ b/e2e/tests/request-money/request-money.spec.ts @@ -30,4 +30,9 @@ describe('Request money', () => { await qrCodePage.assertIsShared(); }); + it('should should show amount input screen again', async () => { + const qrCodePage = new AmountInputPageObject(); + await qrCodePage.assertIsVisible(); + }); + }); From 017d1eb1e54fcb2bac25797e2f1d07e9cb59b5d9 Mon Sep 17 00:00:00 2001 From: Newton Date: Wed, 24 Apr 2019 06:55:35 -0300 Subject: [PATCH 4/7] Faz o downgrade do detox para que ele funcione com o expo --- package-lock.json | 273 ++-------------------------------------------- package.json | 10 +- 2 files changed, 14 insertions(+), 269 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf862d1..6d50a8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6022,15 +6022,15 @@ "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=" }, "detox": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/detox/-/detox-12.4.0.tgz", - "integrity": "sha512-QWITfaX4ra+zjl/VJdnCiiG4F8q6NzLhs2geOACKkgseLc7XJdczGS7qkKhTCoilGWvbgrMGPi4GXcK1kB3Cdw==", + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/detox/-/detox-11.0.2.tgz", + "integrity": "sha512-psvFs/wlIKM+uEI+3dVvQtK54dUJAsk5RB/DmdfBvZf7gvOb0D7LKrm1PdvZap3VAfkpqkrZyiGAk9wSTtuLKw==", "dev": true, "requires": { "bunyan": "^1.8.12", "bunyan-debug-stream": "^1.1.0", - "chalk": "^2.4.2", "child-process-promise": "^2.2.0", + "commander": "^2.15.1", "fs-extra": "^4.0.2", "get-port": "^2.1.0", "ini": "^1.3.4", @@ -6039,85 +6039,12 @@ "proper-lockfile": "^3.0.2", "sanitize-filename": "^1.6.1", "shell-utils": "^1.0.9", - "tail": "^2.0.0", + "tail": "^1.2.3", "telnet-client": "0.15.3", "tempfile": "^2.0.0", - "ws": "^1.1.1", - "yargs": "^13.0.0", - "yargs-parser": "^13.0.0" + "ws": "^1.1.1" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "bunyan": { - "version": "1.8.12", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", - "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", - "dev": true, - "requires": { - "dtrace-provider": "~0.8", - "moment": "^2.10.6", - "mv": "~2", - "safe-json-stringify": "~1" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, "fs-extra": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", @@ -6129,33 +6056,6 @@ "universalify": "^0.1.0" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -6164,155 +6064,6 @@ "requires": { "graceful-fs": "^4.1.6" } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" - } - }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, @@ -6401,12 +6152,6 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.125.tgz", "integrity": "sha512-XxowpqQxJ4nDwUXHtVtmEhRqBpm2OnjBomZmZtHD0d2Eo0244+Ojezhk3sD/MBSSe2nxCdGQFRXHIsf/LUTL9A==" }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -15993,9 +15738,9 @@ "dev": true }, "tail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tail/-/tail-2.0.2.tgz", - "integrity": "sha512-raFipiKWdGKEzxbvZwnhUGqjvsv0gpa/1A479rL//NOxnNwYZDN4MPk6xJJdUFs8P2Xrff3nbH5fcyYRLU4UHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tail/-/tail-1.4.0.tgz", + "integrity": "sha512-wjwfZw6wcMFTB1Po7NFUf4TdCDwX8duZjdTMhnHBEC677Q6mFRcVZE7f/nZDhG2Fpf/wEEKOJP9L7/b11/vlHQ==", "dev": true }, "tar": { diff --git a/package.json b/package.json index 613507b..d15fa7d 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "@types/react": "16.8.12", "@types/react-native": "0.57.42", "@types/react-test-renderer": "16.8.1", - "babel-preset-expo": "5.0.0", - "bunyan": "1.8.12", - "detox": "12.4.0", - "detox-expo-helpers": "0.6.0", - "expo-detox-hook": "1.0.10", + "babel-preset-expo": "^5.0.0", + "bunyan": "^1.8.12", + "detox": "^11.0.2", + "detox-expo-helpers": "^0.6.0", + "expo-detox-hook": "^1.0.10", "jest": "24.7.1", "jest-fetch-mock": "2.1.2", "react-native-testing-library": "1.7.0", From fb38284d86615e5fc51c6704837a167d28af73ef Mon Sep 17 00:00:00 2001 From: Newton Date: Wed, 24 Apr 2019 07:05:40 -0300 Subject: [PATCH 5/7] Fixes detox init --- e2e/config.json | 2 +- e2e/{init.ts => init.js} | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) rename e2e/{init.ts => init.js} (60%) diff --git a/e2e/config.json b/e2e/config.json index ac51d06..3fecc21 100644 --- a/e2e/config.json +++ b/e2e/config.json @@ -1,5 +1,5 @@ { "preset": "ts-jest", "testEnvironment": "node", - "setupTestFrameworkScriptFile": "./init.ts" + "setupTestFrameworkScriptFile": "./init.js" } \ No newline at end of file diff --git a/e2e/init.ts b/e2e/init.js similarity index 60% rename from e2e/init.ts rename to e2e/init.js index 8e983e2..0aaf588 100644 --- a/e2e/init.ts +++ b/e2e/init.js @@ -1,13 +1,12 @@ -import { cleanup, init } from 'detox'; -import * as adapter from 'detox/runners/jest/adapter'; - +const detox = require('detox'); const config = require('../package.json').detox; +const adapter = require('detox/runners/jest/adapter'); jest.setTimeout(120000); jasmine.getEnv().addReporter(adapter); beforeAll(async () => { - await init(config, { initGlobals: false }); + await detox.init(config); }); beforeEach(async () => { @@ -16,5 +15,5 @@ beforeEach(async () => { afterAll(async () => { await adapter.afterAll(); - await cleanup(); -}); + await detox.cleanup(); +}); \ No newline at end of file From c8275d2f2782db43737f55b527d16ba6cd94b536 Mon Sep 17 00:00:00 2001 From: Newton Date: Wed, 24 Apr 2019 15:02:24 -0300 Subject: [PATCH 6/7] Atualiza o expo --- package-lock.json | 383 +++------------------------------------------- package.json | 2 +- 2 files changed, 26 insertions(+), 359 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d50a8f..c09befb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -271,16 +271,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", - "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0", - "@babel/plugin-syntax-async-generators": "^7.2.0" - } - }, "@babel/plugin-proposal-class-properties": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz", @@ -309,15 +299,6 @@ "@babel/plugin-syntax-export-default-from": "^7.2.0" } }, - "@babel/plugin-proposal-json-strings": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", - "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.2.0" - } - }, "@babel/plugin-proposal-nullish-coalescing-operator": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.3.tgz", @@ -354,24 +335,6 @@ "@babel/plugin-syntax-optional-chaining": "^7.2.0" } }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.0.tgz", - "integrity": "sha512-h/KjEZ3nK9wv1P1FSNb9G079jXrNYR0Ko+7XkOx85+gM24iZbPn0rh4vCftk+5QKY7y1uByFataBTmX7irEF1w==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0", - "regexpu-core": "^4.5.4" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", - "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-syntax-decorators": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz", @@ -404,14 +367,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-syntax-json-strings": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", - "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-syntax-jsx": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz", @@ -478,14 +433,6 @@ "@babel/helper-remap-async-to-generator": "^7.1.0" } }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", - "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-block-scoping": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.0.tgz", @@ -526,24 +473,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.3.tgz", - "integrity": "sha512-9Arc2I0AGynzXRR/oPdSALv3k0rM38IMFyto7kOCwb5F9sLUt2Ykdo3V9yUPR+Bgr4kb6bVEyLkPEiBhzcTeoA==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.4.3", - "regexpu-core": "^4.5.4" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz", - "integrity": "sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-exponentiation-operator": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", @@ -587,23 +516,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz", - "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz", - "integrity": "sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw==", - "requires": { - "@babel/helper-module-transforms": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-modules-commonjs": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.3.tgz", @@ -614,40 +526,6 @@ "@babel/helper-simple-access": "^7.1.0" } }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.0.tgz", - "integrity": "sha512-gjPdHmqiNhVoBqus5qK60mWPp1CmYWp/tkh11mvb0rrys01HycEGD7NvvSoKXlWEfSM9TcL36CpsK8ElsADptQ==", - "requires": { - "@babel/helper-hoist-variables": "^7.4.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", - "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", - "requires": { - "@babel/helper-module-transforms": "^7.1.0", - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.2.tgz", - "integrity": "sha512-NsAuliSwkL3WO2dzWTOL1oZJHm0TM8ZY8ZSxk2ANyKkt5SQlToGA4pzctmq1BEjoacurdwZ3xp2dCQWJkME0gQ==", - "requires": { - "regexp-tree": "^0.1.0" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.0.tgz", - "integrity": "sha512-6ZKNgMQmQmrEX/ncuCwnnw1yVGoaOW5KpxNhoWI7pCQdA0uZ0HqHGqenCUIENAnxRjy2WwNQ30gfGdIgqJXXqw==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-object-assign": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.2.0.tgz", @@ -656,15 +534,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-object-super": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz", - "integrity": "sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.1.0" - } - }, "@babel/plugin-transform-parameters": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.3.tgz", @@ -675,14 +544,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-property-literals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz", - "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-react-display-name": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", @@ -718,14 +579,6 @@ "regenerator-transform": "^0.13.4" } }, - "@babel/plugin-transform-reserved-words": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz", - "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-runtime": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.3.tgz", @@ -771,14 +624,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz", - "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==", - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, "@babel/plugin-transform-typescript": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.0.tgz", @@ -798,61 +643,6 @@ "regexpu-core": "^4.5.4" } }, - "@babel/preset-env": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.4.3.tgz", - "integrity": "sha512-FYbZdV12yHdJU5Z70cEg0f6lvtpZ8jFSDakTm7WXeJbLXh4R0ztGEu/SW7G1nJ2ZvKwDhz8YrbA84eYyprmGqw==", - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", - "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.4.3", - "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.0", - "@babel/plugin-syntax-async-generators": "^7.2.0", - "@babel/plugin-syntax-json-strings": "^7.2.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", - "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.4.0", - "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.4.0", - "@babel/plugin-transform-classes": "^7.4.3", - "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.4.3", - "@babel/plugin-transform-dotall-regex": "^7.4.3", - "@babel/plugin-transform-duplicate-keys": "^7.2.0", - "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-for-of": "^7.4.3", - "@babel/plugin-transform-function-name": "^7.4.3", - "@babel/plugin-transform-literals": "^7.2.0", - "@babel/plugin-transform-member-expression-literals": "^7.2.0", - "@babel/plugin-transform-modules-amd": "^7.2.0", - "@babel/plugin-transform-modules-commonjs": "^7.4.3", - "@babel/plugin-transform-modules-systemjs": "^7.4.0", - "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.2", - "@babel/plugin-transform-new-target": "^7.4.0", - "@babel/plugin-transform-object-super": "^7.2.0", - "@babel/plugin-transform-parameters": "^7.4.3", - "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.4.3", - "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.2.0", - "@babel/plugin-transform-sticky-regex": "^7.2.0", - "@babel/plugin-transform-template-literals": "^7.2.0", - "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.4.3", - "@babel/types": "^7.4.0", - "browserslist": "^4.5.2", - "core-js-compat": "^3.0.0", - "invariant": "^2.2.2", - "js-levenshtein": "^1.1.3", - "semver": "^5.5.0" - } - }, "@babel/register": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.4.0.tgz", @@ -1155,8 +945,9 @@ } }, "@expo/vector-icons": { - "version": "github:expo/vector-icons#d0fb774a001b047d223cfa5e9537220b20591efd", - "from": "github:expo/vector-icons#expo-font-fix", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-9.0.0.tgz", + "integrity": "sha512-k5ndrW3oueW5jRDLt3o8iXKmiU+CvvCZPewOvxY7eRMivi8hIr6TkW6tMCGE1vS5fwmXffIkIpKGZkSbX7TxwA==", "requires": { "lodash": "^4.17.4", "react-native-vector-icons": "6.0.0" @@ -4383,11 +4174,6 @@ "resolve": "^1.4.0" } }, - "babel-plugin-react-native-web": { - "version": "0.9.13", - "resolved": "https://registry.npmjs.org/babel-plugin-react-native-web/-/babel-plugin-react-native-web-0.9.13.tgz", - "integrity": "sha512-cgHJcA+jDIcEH0g0JSCjRxGlKIMVR5GWCgVSFwfjIP1HCvjFOtjUWGHPEnlMShp9mHl/WtL2v59sRWzVnoK3CA==" - }, "babel-plugin-syntax-class-properties": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", @@ -4659,7 +4445,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-5.0.0.tgz", "integrity": "sha512-pDtkAIafvQLAZ5dQ/6I9okkiZLw9IBR8ItRzAyUO4j2rUMB9ey6yZTTE77AKWq5HhxhY53Hic8Zl0vSDMTXI0A==", - "dev": true, "requires": { "@babel/plugin-proposal-decorators": "^7.1.0", "babel-plugin-module-resolver": "^3.1.1", @@ -5044,16 +4829,6 @@ } } }, - "browserslist": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.5.tgz", - "integrity": "sha512-0QFO1r/2c792Ohkit5XI8Cm8pDtZxgNl2H6HU4mHrpYz7314pEYcsAVVatM0l/YmxPnEzh9VygXouj4gkFUTKA==", - "requires": { - "caniuse-lite": "^1.0.30000960", - "electron-to-chromium": "^1.3.124", - "node-releases": "^1.1.14" - } - }, "bs-logger": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", @@ -5257,11 +5032,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" }, - "caniuse-lite": { - "version": "1.0.30000962", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000962.tgz", - "integrity": "sha512-WXYsW38HK+6eaj5IZR16Rn91TGhU3OhbwjKZvJ4HN/XBIABLKfbij9Mnd3pM0VEwZSlltWjoWg3I8FQ0DGgNOA==" - }, "capture-exit": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", @@ -5670,34 +5440,6 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz", "integrity": "sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==" }, - "core-js-compat": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.0.1.tgz", - "integrity": "sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g==", - "requires": { - "browserslist": "^4.5.4", - "core-js": "3.0.1", - "core-js-pure": "3.0.1", - "semver": "^6.0.0" - }, - "dependencies": { - "core-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.1.tgz", - "integrity": "sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==" - }, - "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" - } - } - }, - "core-js-pure": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.1.tgz", - "integrity": "sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -6147,11 +5889,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "electron-to-chromium": { - "version": "1.3.125", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.125.tgz", - "integrity": "sha512-XxowpqQxJ4nDwUXHtVtmEhRqBpm2OnjBomZmZtHD0d2Eo0244+Ojezhk3sD/MBSSe2nxCdGQFRXHIsf/LUTL9A==" - }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -6414,12 +6151,12 @@ } }, "expo": { - "version": "32.0.0", - "resolved": "https://registry.npmjs.org/expo/-/expo-32.0.0.tgz", - "integrity": "sha512-y8qB9LF3rKvwMJjS4WdKW+skBcalPua0GqrjsKQVRjjntNuCMdmtXzCnI7ukcXMnV9Awa0txKtH/2pfsE08e5Q==", + "version": "32.0.6", + "resolved": "https://registry.npmjs.org/expo/-/expo-32.0.6.tgz", + "integrity": "sha512-LMFtWZY+lwMHkoThTBwirctPB/5WeZtGrVM8MVoCI1e7jlONOfNQceM6X2j06BO5HxcCF/ASJSUDiTIIStAeaA==", "requires": { "@babel/runtime": "^7.1.2", - "@expo/vector-icons": "github:expo/vector-icons#expo-font-fix", + "@expo/vector-icons": "~9.0.0", "@expo/websql": "^1.0.1", "@types/fbemitter": "^2.0.32", "@types/invariant": "^2.2.29", @@ -6456,7 +6193,7 @@ "expo-image-loader-interface": "~2.0.0", "expo-local-authentication": "~2.0.0", "expo-localization": "~2.0.0", - "expo-location": "~2.0.0", + "expo-location": "~2.0.1", "expo-media-library": "~2.0.0", "expo-payments-stripe": "~2.0.0", "expo-permissions": "~2.0.0", @@ -6480,10 +6217,10 @@ "prop-types": "^15.6.0", "qs": "^6.5.0", "react-native-branch": "2.2.5", - "react-native-gesture-handler": "1.0.12", - "react-native-maps": "github:expo/react-native-maps#v0.22.1-exp.0", + "react-native-gesture-handler": "~1.0.14", + "react-native-maps": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2", "react-native-reanimated": "1.0.0-alpha.11", - "react-native-screens": "1.0.0-alpha.19", + "react-native-screens": "1.0.0-alpha.22", "react-native-svg": "8.0.10", "react-native-view-shot": "2.5.0", "serialize-error": "^2.1.0", @@ -6491,27 +6228,9 @@ "whatwg-fetch": "^2.0.4" }, "dependencies": { - "babel-preset-expo": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-5.1.1.tgz", - "integrity": "sha512-aboINGtepZW4s5IKu9dpNY7RUzTlM4S55xw2cuQ39DiEWY1fr8TsbLyK4lMC5LXrGhoTGypnn85/Y4yPEdnK5g==", - "requires": { - "@babel/core": "^7.1.0", - "@babel/plugin-proposal-decorators": "^7.1.0", - "@babel/preset-env": "^7.3.1", - "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-react-native-web": "^0.9.6", - "metro-react-native-babel-preset": "^0.49.0" - } - }, "react-native-maps": { "version": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2", "from": "github:expo/react-native-maps#v0.22.1-exp.0" - }, - "react-native-screens": { - "version": "1.0.0-alpha.19", - "resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-1.0.0-alpha.19.tgz", - "integrity": "sha512-+a7GdwzLWYWYVUJMg+XuyBoRFGD8GdGyBfebuTNBY+xwUZpTXCaK/GlLGL6EE3h0iBHZu83do7zViEailWRNyA==" } } }, @@ -6827,21 +6546,6 @@ "babel-preset-expo": "^5.0.0", "expo-core": "~2.0.0", "expo-errors": "~1.0.0" - }, - "dependencies": { - "babel-preset-expo": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-5.1.1.tgz", - "integrity": "sha512-aboINGtepZW4s5IKu9dpNY7RUzTlM4S55xw2cuQ39DiEWY1fr8TsbLyK4lMC5LXrGhoTGypnn85/Y4yPEdnK5g==", - "requires": { - "@babel/core": "^7.1.0", - "@babel/plugin-proposal-decorators": "^7.1.0", - "@babel/preset-env": "^7.3.1", - "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-react-native-web": "^0.9.6", - "metro-react-native-babel-preset": "^0.49.0" - } - } } }, "expo-react-native-adapter": { @@ -7388,8 +7092,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -7407,13 +7110,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7426,18 +7127,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -7540,8 +7238,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -7551,7 +7248,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7564,20 +7260,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7594,7 +7287,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -7667,8 +7359,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -7678,7 +7369,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -7754,8 +7444,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -7785,7 +7474,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7803,7 +7491,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7842,13 +7529,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -11409,11 +11094,6 @@ "integrity": "sha1-uEF7dQZho5K+4sJTfGiyqdSXfNU=", "dev": true }, - "js-levenshtein": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", - "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -12681,14 +12361,6 @@ "which": "^1.3.0" } }, - "node-releases": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.15.tgz", - "integrity": "sha512-cKV097BQaZr8LTSRUa2+oc/aX5L8UkZtPQrMSTgiJEeaW7ymTDCoRaGCoaTqk0lqnalcoSHu4wjSl0Cmj2+bMw==", - "requires": { - "semver": "^5.3.0" - } - }, "node-version": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/node-version/-/node-version-1.2.0.tgz", @@ -13947,9 +13619,9 @@ "integrity": "sha1-QHTdY7SXPmOX2c5Q6XtXx3pRjp0=" }, "react-native-gesture-handler": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.0.12.tgz", - "integrity": "sha512-Qp5FjRmqUFeCevSu2IYQG1Xw+YXZ9YOzqze/ZxaIvWzYAoKsRchlgHhNoxvCqElp/befrnVFIjAEQyUxcmBKJw==", + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.0.17.tgz", + "integrity": "sha512-0czy7SZvF4q2aCQUGFaBu/yBjYYEbcqSU1/r2bZ/IoXj+DgYuIPBL60SSXhJdYJU8G3brfUHmtgSdcNte8Lh0w==", "requires": { "hoist-non-react-statics": "^2.3.1", "invariant": "^2.2.2", @@ -14316,11 +13988,6 @@ } } }, - "regexp-tree": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz", - "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==" - }, "regexpu-core": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", diff --git a/package.json b/package.json index d15fa7d..d6b993d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test:e2e": "jest --silent --config jest.config.js e2e" }, "dependencies": { - "expo": "32.0.0", + "expo": "32.0.6", "react": "16.5.0", "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz", "react-native-qrcode": "0.2.7", From 06705d2c9ded5a02a336a76687d4d64fc266ac01 Mon Sep 17 00:00:00 2001 From: Newton Date: Wed, 24 Apr 2019 16:21:49 -0300 Subject: [PATCH 7/7] Fixes e2e tests --- README.md | 21 +++++++++++++++++++-- e2e/page-objects/AmountInputPageObject.ts | 5 +++-- e2e/page-objects/QRCodePageObject.ts | 6 +++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 359ed52..7b1266c 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,29 @@ Start the application npm start ``` -## :heavy_check_mark: Running tests +## :heavy_check_mark: Running unit and integration tests ```sh npm run test:unit npm run test:integration -npm run test:e2e +``` + +## :heavy_check_mark: Running E2E tests + +Download the latest Expo client from https://expo.io/tools#client and extract it to a folder named `bin/Exponent.app` inside the project. Run the following commands: + +```sh +brew tap wix/brew +brew install applesimutils +npm install -g detox-cli +detox test +``` + +Do not forget to start the mocked server running the following commands: + +```sh +cd server +npm start ``` ## :sparkles: Running lint diff --git a/e2e/page-objects/AmountInputPageObject.ts b/e2e/page-objects/AmountInputPageObject.ts index ad5f640..6429072 100644 --- a/e2e/page-objects/AmountInputPageObject.ts +++ b/e2e/page-objects/AmountInputPageObject.ts @@ -4,15 +4,16 @@ import { QRCodePageObject } from './QRCodePageObject'; export class AmountInputPageObject { public async assertIsVisible() { - expect(element(by.id('AmountInputScreen'))).toBeVisible(); + await expect(element(by.id('AmountInputScreen'))).toBeVisible(); } public async fillAmount(amount: number) { + await element(by.id('amountInput')).tap(); await element(by.id('amountInput')).typeText(`${amount}`); } public async assertHasAmountOf(amount: number) { - expect(element(by.text(`${amount}`))).toBeVisible(); + await expect(element(by.text(`${amount}`))).toBeVisible(); } public async confirm(): Promise { diff --git a/e2e/page-objects/QRCodePageObject.ts b/e2e/page-objects/QRCodePageObject.ts index a36314b..5f3efc5 100644 --- a/e2e/page-objects/QRCodePageObject.ts +++ b/e2e/page-objects/QRCodePageObject.ts @@ -3,15 +3,15 @@ import { by, element, expect } from 'detox'; export class QRCodePageObject { public async assertIsVisible() { - expect(element(by.id('QRCodeScreen'))).toBeVisible(); + await expect(element(by.id('QRCodeScreen'))).toBeVisible(); } public async share() { - await element(by.id('shareBtn')).tap(); + await element(by.id('shareButton')).tap(); } public async assertIsShared() { - expect(element(by.text('OK'))).toBeVisible(); + await expect(element(by.text('OK'))).toBeVisible(); } }