Skip to content

Example project testing bitlinks with TypeScript & Playwright

Notifications You must be signed in to change notification settings

jpolley/bitly-example

Repository files navigation

Bitly example tests using Playwright workflow

This project uses Typescript and Playwright to provide some test coverage for the bitlinks API and some checks on the web app https://app.bitly.com

Dev Setup

1. Clone this repo & cd into root directory

2. Run this script to create .env file in root directory

echo "ACCESS_TOKEN=xxxxxxxx\nACCOUNT_ID=Ch3flJJ0gtq\nAPI_URL=https://api-ssl.bitly.com\[email protected]\nUSER_PASSWORD=yourPassword" > .env

3. Paste your bitly account info into the .env file and save 💾

  • valid API ACCESS_TOKEN
  • ACCOUNT_ID is the value you see in the URL after you login. For example if the URL is app.bitly.com/Ch3flJJ0gtq/home then update the .env file so that ACCOUNT_ID=Ch3flJJ0gtq
  • USER_EMAIL and USER_PASSWORD are credentials used to Log in

4. Install everything by running the setup script:

  npm run setup

5. Run the tests & view report

npx playwright test
npx playwright show-report

6. Optionally, you can run the tests in ✨UI Mode✨ to dig a little depper. You can you explore, run and debug tests. It's pretty neat for reviewing the API request, response, & body.

npx playwright test --ui

Just click the ▶️ play button to kick off the tests: Click the play button

7. If you have Docker installed then you can run tests using this command

docker compose up

About

Example project testing bitlinks with TypeScript & Playwright

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published