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

E2E testing setup for desktop app #1560

Merged
merged 3 commits into from
Jan 12, 2024
Merged

E2E testing setup for desktop app #1560

merged 3 commits into from
Jan 12, 2024

Conversation

horacioh
Copy link
Collaborator

@horacioh horacioh commented Jan 8, 2024

New dev setup and testing for the Desktop app

new location of appData in dev mode:

~/appData.local

new env variables set

export VITE_DESKTOP_P2P_PORT="56000"
export VITE_DESKTOP_HTTP_PORT="56001"
export VITE_DESKTOP_GRPC_PORT="56002"
export VITE_DESKTOP_APPDATA="Mintter.dev"
export VITE_DESKTOP_HOSTNAME="http://localhost"

new dev scripts:

  • run-desktop-mainnet: runs the desktop app in dev mode pointing to mainnet (runs this internally: MINTTER_P2P_TESTNET_NAME='' yarn desktop)
  • test-desktop: builds and run the tests for the desktop app
    • will package the app using different env variables to not conflict with either production nor dev
    • will run the tests

new yarn scrips:

  • desktop:test: the script ./dev test-desktop will run
  • desktop:test:package: only package the app for testing (with separate env variables from prod and dev)
  • in the desktop package
    • test: package and run tests
    • test:only: only run tests. this needs the app to be built so make sure you build it first
    • e2e: runs the playwright script
    • e2e:debug: runs the playwright script with PWDEBUG=1
    • e2e:report: show the already generated playwright reports if any

If you want to run a second device of the app, you need to override the next env varaibles:

  • VITE_DESKTOP_P2P_PORT
  • VITE_DESKTOP_HTTP_PORT
  • VITE_DESKTOP_GRPC_PORT
  • VITE_DESKTOP_APPDATA

this variables follow a pattern: the ports follow the 5500x pattern, in dev 5600x and in test 5800x feel free to change it for a new device:

VITE_DESKTOP_P2P_PORT=5700 VITE_DESKTOP_HTTP_PORT=57001 VITE_DESKTOP_GRPC_PORT=57002 VITE_DESKTOP_APPDATA=appData2.local ./dev run-desktop

when running both apps at the same time, the first app running will show a blank screen bc you are rebuilding the frontend files again. just need to reload the affected version of the app and you are good to go.

Testing

Now every push and PR to main will run a new Github Action: test-desktop. this action will build the app (in MacOS only for now) and run all the tests.

the guide to create tests will be in a Mintter publication. Also a more detailed explanation about all this.

ping @horacioh for any questions!

dev Show resolved Hide resolved
@horacioh
Copy link
Collaborator Author

Now that we have a new release, if there's no big objections I would love to merge this asap.
cc @burdiyan @juligasa @ericvicenti @GaboHBeaumont @iskaktoltay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants