https://github.com/danielgilortiz/playwright-openweather
This project contains automated API tests for the OpenWeatherMap Current Weather Data API using Playwright.
https://github.com/danielgilortiz/playwright-openweather
api-tests playwright test-automation
Last synced: about 1 year ago
JSON representation
This project contains automated API tests for the OpenWeatherMap Current Weather Data API using Playwright.
- Host: GitHub
- URL: https://github.com/danielgilortiz/playwright-openweather
- Owner: DanielGilOrtiz
- License: mit
- Created: 2025-05-11T12:41:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-19T21:04:20.000Z (about 1 year ago)
- Last Synced: 2025-05-19T22:23:26.997Z (about 1 year ago)
- Topics: api-tests, playwright, test-automation
- Language: HTML
- Homepage:
- Size: 187 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Automated API Testing for OpenWeather using Playwright
This project contains automated API tests for the OpenWeather API using Playwright.
## Prerequisites
- Node.js (v14 or higher)
- NPM (Node Package Manager)
- OpenWeatherMap API key ([Get it here](https://openweathermap.org/api))
## Installation
1. Clone this repository:
```bash
git clone
cd open-weather-map
```
2. Install dependencies:
```bash
npm install
```
3. Install Playwright browsers:
```bash
npx playwright install
```
> Note: While `npm install` will install the Playwright framework, the last command is required to download the browser binaries that Playwright needs to run the tests.
## Configuration
Add your OpenWeatherMap API key to the `.env` file in the root directory:
```
OPENWEATHER_API_KEY = your_api_key_here
```
Replace `your_api_key_here` with your actual OpenWeatherMap API key.
## Running Tests
Run the tests using one of the following npm scripts:
```bash
# Run all tests
npm test
# Run tests with HTML report
npm run test:report
# Show HTML report
npm run show-report
```
## Project Structure
```
├── constants/
│ └── weather-conditions.ts # Weather conditions mapping
├── tests/
│ └── current-weather-data.spec.ts
│ └── five-days-weather-forecast.spec.ts # TBC
├── playwright.config.ts # Playwright configuration
├── package.json # Project dependencies
└── .env # Environment variables
```
## Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| `OPENWEATHER_API_KEY` | Your OpenWeatherMap API key | Yes |
## Additional Resources
- [OpenWeatherMap API Documentation](https://openweathermap.org/current)
- [Playwright Documentation](https://playwright.dev)
- [dotenv Documentation](https://github.com/motdotla/dotenv)