Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: removed API mocks and use actual account #34792

Merged
merged 27 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ad66df5
removed API mocks
hannojg Jan 4, 2024
7b13952
temp: e2eLogin with getting otp code from server
hannojg Jan 4, 2024
a799cf3
fix timing of isSidebarLoaded
hannojg Jan 4, 2024
e0daefd
add waitForAppLoaded in tests
hannojg Jan 4, 2024
c4a696a
WIP CODE, REVERT ME
hannojg Jan 8, 2024
cb18b13
Merge branch 'main' of github.com:Expensify/App into e2e/remove-api-m…
hannojg Jan 19, 2024
0d26932
wip: use partner authentication for e2e tests
hannojg Jan 21, 2024
81a3e8e
Merge branch 'main' of github.com:Expensify/App into e2e/remove-api-m…
hannojg Jan 21, 2024
645fef1
fix: enabled e2e login by merging data into onyx
hannojg Jan 21, 2024
fea9d1b
wip: NetworkInterceptor
hannojg Jan 21, 2024
e5e5179
e2e; finish network interceptor implementation
hannojg Jan 21, 2024
8fc25f4
e2e: reduce logging of NetworkInterceptor
hannojg Jan 21, 2024
e571659
remove debug changes
hannojg Jan 21, 2024
a38b4da
fix chat opening test
hannojg Jan 22, 2024
571e841
fix various bugs with network interceptor
hannojg Jan 22, 2024
2bf2d03
fix reprot typing test
hannojg Jan 22, 2024
74a9710
fix lint
hannojg Jan 22, 2024
7dba001
Merge branch 'main' of github.com:Expensify/App into e2e/remove-api-m…
hannojg Jan 22, 2024
2e240a3
revert wip changes
hannojg Jan 22, 2024
290ce2d
Merge branch 'main' of github.com:Expensify/App into e2e/remove-api-m…
hannojg Jan 22, 2024
d4c670b
remove wip changes
hannojg Jan 22, 2024
a54a0ad
code clean + documentation
hannojg Jan 23, 2024
a6f7b5a
put report ID in e2e test configs
hannojg Jan 23, 2024
e24c232
e2e tests doc update
hannojg Jan 23, 2024
c3ca6cc
provide github env
hannojg Jan 23, 2024
7d3b1ea
Merge branch 'main' of github.com:Expensify/App into e2e/remove-api-m…
hannojg Jan 24, 2024
129b801
update env files correctly
hannojg Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/actions/composite/buildAndroidE2EAPK/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ inputs:
MAPBOX_SDK_DOWNLOAD_TOKEN:
description: The token to use to download the MapBox SDK
required: true
PATH_ENV_FILE:
description: The path to the .env file to use for the build
required: true
EXPENSIFY_PARTNER_NAME:
description: The name of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_PASSWORD:
description: The password of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_USER_ID:
description: The user ID of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_USER_SECRET:
description: The user secret of the Expensify partner to use for the build
required: true
EXPENSIFY_PARTNER_PASSWORD_EMAIL:
description: The email address of the Expensify partner to use for the build
required: true

runs:
using: composite
Expand All @@ -37,9 +55,24 @@ runs:

- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef

- name: Append environment variables to env file
shell: bash
run: |
echo "EXPENSIFY_PARTNER_NAME=${EXPENSIFY_PARTNER_NAME}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD=${EXPENSIFY_PARTNER_PASSWORD}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_ID=${EXPENSIFY_PARTNER_USER_ID}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_USER_SECRET=${EXPENSIFY_PARTNER_USER_SECRET}" >> ${{ inputs.PATH_ENV_FILE }}
echo "EXPENSIFY_PARTNER_PASSWORD_EMAIL=${EXPENSIFY_PARTNER_PASSWORD_EMAIL}" >> ${{ inputs.PATH_ENV_FILE }}

- name: Build APK
run: npm run ${{ inputs.PACKAGE_SCRIPT_NAME }}
shell: bash
env:
EXPENSIFY_PARTNER_NAME: ${{ inputs.EXPENSIFY_PARTNER_NAME }}
EXPENSIFY_PARTNER_PASSWORD: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD }}
EXPENSIFY_PARTNER_USER_ID: ${{ inputs.EXPENSIFY_PARTNER_USER_ID }}
EXPENSIFY_PARTNER_USER_SECRET: ${{ inputs.EXPENSIFY_PARTNER_USER_SECRET }}
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ inputs.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}

- name: Upload APK
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
PACKAGE_SCRIPT_NAME: android-build-e2e
APP_OUTPUT_PATH: android/app/build/outputs/apk/e2e/release/app-e2e-release.apk
MAPBOX_SDK_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
EXPENSIFY_PARTNER_NAME: ${{ secrets.EXPENSIFY_PARTNER_NAME }}
EXPENSIFY_PARTNER_PASSWORD: ${{ secrets.EXPENSIFY_PARTNER_PASSWORD }}
EXPENSIFY_PARTNER_USER_ID: ${{ secrets.EXPENSIFY_PARTNER_USER_ID }}
EXPENSIFY_PARTNER_USER_SECRET: ${{ secrets.EXPENSIFY_PARTNER_USER_SECRET }}
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ secrets.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}
PATH_ENV_FILE: tests/e2e/.env.e2e

buildDelta:
runs-on: ubuntu-latest-xl
Expand Down Expand Up @@ -114,6 +120,12 @@ jobs:
PACKAGE_SCRIPT_NAME: android-build-e2edelta
APP_OUTPUT_PATH: android/app/build/outputs/apk/e2edelta/release/app-e2edelta-release.apk
MAPBOX_SDK_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
EXPENSIFY_PARTNER_NAME: ${{ secrets.EXPENSIFY_PARTNER_NAME }}
EXPENSIFY_PARTNER_PASSWORD: ${{ secrets.EXPENSIFY_PARTNER_PASSWORD }}
EXPENSIFY_PARTNER_USER_ID: ${{ secrets.EXPENSIFY_PARTNER_USER_ID }}
EXPENSIFY_PARTNER_USER_SECRET: ${{ secrets.EXPENSIFY_PARTNER_USER_SECRET }}
EXPENSIFY_PARTNER_PASSWORD_EMAIL: ${{ secrets.EXPENSIFY_PARTNER_PASSWORD_EMAIL }}
PATH_ENV_FILE: tests/e2e/.env.e2edelta

runTestsInAWS:
runs-on: ubuntu-latest
Expand Down
21 changes: 0 additions & 21 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ require('dotenv').config();
const defaultConfig = getDefaultConfig(__dirname);

const isE2ETesting = process.env.E2E_TESTING === 'true';

if (isE2ETesting) {
// eslint-disable-next-line no-console
console.log('⚠️⚠️⚠️⚠️ Using mock API ⚠️⚠️⚠️⚠️');
}

const e2eSourceExts = ['e2e.js', 'e2e.ts'];

/**
Expand All @@ -26,21 +20,6 @@ const config = {
assetExts: [...defaultAssetExts, 'lottie'],
// When we run the e2e tests we want files that have the extension e2e.js to be resolved as source files
sourceExts: [...(isE2ETesting ? e2eSourceExts : []), ...defaultSourceExts, 'jsx'],
resolveRequest: (context, moduleName, platform) => {
const resolution = context.resolveRequest(context, moduleName, platform);
if (isE2ETesting && moduleName.includes('/API')) {
const originalPath = resolution.filePath;
const mockPath = originalPath.replace('src/libs/API.ts', 'src/libs/E2E/API.mock.ts').replace('/src/libs/API.ts/', 'src/libs/E2E/API.mock.ts');
// eslint-disable-next-line no-console
console.log('⚠️⚠️⚠️⚠️ Replacing resolution path', originalPath, ' => ', mockPath);

return {
...resolution,
filePath: mockPath,
};
}
return resolution;
},
},
};

Expand Down
Loading
Loading