Skip to content

Commit

Permalink
Merge pull request #37501 from margelo/fix/e2e-tests-ts-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef-lr authored Mar 2, 2024
2 parents af68510 + 6bf6de0 commit 22cb01c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/checkE2ETestCode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check e2e test code builds correctly

on:
workflow_call:
pull_request:
types: [opened, synchronize]
paths:
- 'tests/e2e/**'
- 'src/libs/E2E/**'

jobs:
lint:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Verify e2e tests compile correctly
run: npm run e2e-test-runner-build
20 changes: 4 additions & 16 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,11 @@ jobs:
- name: Rename delta APK
run: mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edelta-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edeltaRelease.apk"

- name: Copy e2e code into zip folder
run: cp -r tests/e2e zip
- name: Compile test runner to be executable in a nodeJS environment
run: npm run e2e-test-runner-build

# Note: we can't reuse the apps tsconfig, as it depends on modules that aren't available in the AWS Device Farm environment
- name: Write tsconfig.json to zip folder
run: |
echo '{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
}
}' > zip/tsconfig.json
- name: Copy e2e code into zip folder
run: cp tests/e2e/dist/index.js zip/testRunner.js

- name: Zip everything in the zip directory up
run: zip -qr App.zip ./zip
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"gh-actions-unused-styles": "./.github/scripts/findUnusedKeys.sh",
"workflow-test": "./workflow_tests/scripts/runWorkflowTests.sh",
"workflow-test:generate": "ts-node workflow_tests/utils/preGenerateTest.js",
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1"
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1",
"e2e-test-runner-build": "ncc build tests/e2e/testRunner.js -o tests/e2e/dist/"
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/TestSpec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ phases:
test:
commands:
- cd zip
- npm install underscore ts-node typescript
- npx ts-node e2e/testRunner.js -- --mainAppPath app-e2eRelease.apk --deltaAppPath app-e2edeltaRelease.apk
- node testRunner.js -- --mainAppPath app-e2eRelease.apk --deltaAppPath app-e2edeltaRelease.apk

artifacts:
- $WORKING_DIRECTORY

0 comments on commit 22cb01c

Please sign in to comment.