Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
adding yarn start
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilchrist-ledger committed Apr 15, 2022
1 parent 9b6b5ef commit 861001a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 29 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/detox-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

- name: Test iOS app
timeout-minutes: 15
run: yarn detox test -c ios.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
run: yarn start & yarn detox test -c ios.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
# --retries 1 --reuse

- name: Upload test artifacts
Expand All @@ -99,9 +99,6 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Setup Node
uses: actions/setup-node@v2
with:
Expand All @@ -126,17 +123,17 @@ jobs:
JOBS: max
run: yarn --prefer-offline --frozen-lockfile --network-timeout 100000

- name: Gradle cache
uses: gradle/gradle-build-action@v2
# - name: Gradle cache
# uses: gradle/gradle-build-action@v2

- name: AVD cache
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-api-29
# - name: AVD cache
# uses: actions/cache@v2
# id: avd-cache
# with:
# path: |
# ~/.android/avd/*
# ~/.android/adb*
# key: avd-api-29

- name: Build Android app for Detox test run
run: yarn detox build -c android.debug
Expand All @@ -156,7 +153,7 @@ jobs:
$ANDROID_HOME/platform-tools/adb devices
adb logcat -c
adb logcat *:E &
yarn detox test -c android.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
yarn start & yarn detox test -c android.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
# mkdir ./temp
# curl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk
# adb install ./temp/test-butler-app.apk || adb install ./e2e/test-butler-app.apk
Expand All @@ -179,7 +176,7 @@ jobs:
mkdir ./temp
curl -f -o ./temp/test-butler-app.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk
adb install ./temp/test-butler-app.apk || adb install ./e2e/test-butler-app.apk
yarn detox test -c android.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
yarn start & yarn detox test -c android.debug --loglevel verbose --record-logs failing --record-timeline all --take-screenshots failing
# --retries 1 --reuse

- name: Upload test artifacts
Expand Down
7 changes: 2 additions & 5 deletions e2e/bridge/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { Server } from "ws";
import path from "path";
import fs from "fs";
import type { E2EBridgeMessage } from "./client";
import { waitForElement } from "../helpers";
import { NavigatorName } from "../../src/const";

let wss: Server;

export function init(port?: number = 8099) {
export async function init(port?: number = 8099) {
wss = new Server({ port });
log(`Start listening on localhost:${port}`);

Expand Down Expand Up @@ -40,10 +39,7 @@ export async function loadConfig(
if (data.accounts.length) {
postMessage({ type: "importAccounts", payload: data.accounts });
// await $waitFor("PortfolioAccountsList", -1, 10000);
return;
}

await waitForElement("PortfolioEmptyAccount");
}

function navigate(name: string) {
Expand Down Expand Up @@ -102,5 +98,6 @@ function acceptTerms() {
function postMessage(message: E2EBridgeMessage) {
for (const ws of wss.clients.values()) {
ws.send(JSON.stringify(message));
log(`sent the following message: ${{ message }}`);
}
}
1 change: 0 additions & 1 deletion e2e/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { waitFor, element, by } from "detox";
import { readFileSync } from "fs";

const DEFAULT_TIMEOUT = 30000;
Expand Down
5 changes: 1 addition & 4 deletions e2e/setup.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { execSync } from "child_process";
import { device } from "detox";
import * as bridge from "./bridge/server";

// eslint-disable-next-line no-undef
beforeAll(async () => {
// console.log("==============> LAUNCH APP BEFORE ALL");
// await device.launchApp({ newInstance: true });
Expand All @@ -15,8 +13,7 @@ beforeAll(async () => {
setupDemoModeForScreenshots();
});

// eslint-disable-next-line no-undef
afterAll(async () => {
afterAll(() => {
console.log("==============> CLOSING BRIDGE");
bridge.close();
});
Expand Down
1 change: 0 additions & 1 deletion e2e/specs/onboarding.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { device } from "detox";
import OnboardingSteps from "../models/onboarding/onboardingSteps";
import PortfolioPage from "../models/portfolioPage";
// import { expectBitmapsToBeEqual } from "../helpers";
Expand Down
7 changes: 5 additions & 2 deletions e2e/specs/password.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { device } from "detox";
import { loadConfig } from "../bridge/server";
import PortfolioPage from "../models/portfolioPage";
import SettingsPage from "../models/settings/settingsPage";
Expand All @@ -19,7 +18,11 @@ describe("Password Lock Screen", () => {

it("should be able to enter the correct password", async () => {
console.log("==============> STARTING PASSWORD TEST");
await loadConfig("1AccountBTC1AccountETH", true);
try {
await loadConfig("1AccountBTC1AccountETH", true);
} catch (error) {
console.error(error);
}

await PortfolioPage.waitForPageToBeVisible();
await PortfolioPage.navigateToSettings();
Expand Down

0 comments on commit 861001a

Please sign in to comment.