Skip to content

End to end tests for the Fyle Integrations App

License

Notifications You must be signed in to change notification settings

fylein/fyle-integrations-app-e2e-tests

Repository files navigation

fyle-integrations-app-e2e-tests

End to end tests for the Fyle Integrations App

Installation

Install nvm

If not already present, install nvm on your mac following the instructions here

Install node version 22

nvm install 22
nvm use 22

Install node modules

npm install
npx playwright install

Setup a .env file

Create a .env file in the root folder of the repo, and ping @Viswas for its contents.

Running tests

Running inside VS Code / Cursor (recommended)

You absolutely should run Playwright using the VS Code extension. It will make your life 10x easier.

Follow the steps in this article

Running in your terminal

Switch to using node v22 in the terminal.

nvm use 22
node --version # confirm that it is version 22

Do this if you want to see what the test does visually

npx playwright test --headed

If you want to see detailed traces while test is executing visually

npx playwright test --ui

If you want to run tests in headless mode

npx playwright test

This is boring - you dont see magical stuff happening. This would be useful in a CI/CD situation

If account creation fails (404)

The test creates a new Fyle account via the signup API. If you see Failed to create account: 404 Not Found:

  • Ensure .env has valid API_DOMAIN and INTERNAL_SIGNUP_TOKEN (get these from the team), or
  • For local dev with an existing account, set LOCAL_DEV_EMAIL in .env to your existing Fyle user email. The test will skip signup and use that account instead.

Best practices

  • Read Playwright best practices doc
  • Test independence
    • Ideally, each test case should be independent
    • However, setup can be expensive
    • Group tests in groups and make each test group independent
    • Setup an org from scratch for every test group
  • When “locating” elements, use only visual cues
    • If you tweak DOM structure, test shouldn’t fail
  • Use Page Object Model sparingly
    • With POM, you can’t generate code from recording slowing down test writing
    • Only if you have a solid reason, such as a particular block of code being reused across tests/files, should you consider POM
    • POM files are located in the common/pom/ folder
  • Don’t use sleep

About

End to end tests for the Fyle Integrations App

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6