Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zahid-automate/playwright-crypto
https://github.com/zahid-automate/playwright-crypto
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zahid-automate/playwright-crypto
- Owner: Zahid-Automate
- Created: 2024-11-07T02:50:47.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-07T04:31:57.000Z (3 months ago)
- Last Synced: 2024-11-07T05:21:04.819Z (3 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Encrypted Login Test Project
This project demonstrates automated login testing with encrypted credentials using Playwright and CryptoJS for a Javascript project.
## Project Structure
```
project/
├── utils/ # Utility functions
│ ├── encryption.js # Encryption/decryption logic
│ └── encrypt-env.js # Script to encrypt environment variables
├── tests/ # Test files
│ └── login.spec.js # Login test implementation
├── .env # Environment variables (encrypted)
├── .env.encrypted # Backup of encrypted values
└── .gitignore # Git ignore configuration
```## Setup
1. Install dependencies:
```bash
npm install playwright crypto-js dotenv
```2. Create `.env` file with your credentials:
```env
UN=your_username
PASSWORD=your_password
CRYPTO_SECRET_KEY=your_secret_key
```3. Encrypt your credentials:
```bash
node utils/encrypt-env.js
```4. Update `.env` file with encrypted values from `.env.encrypted`
## Running Tests
```bash
npx playwright test tests/login.spec.js
```## Security Notes
- Never commit `.env` or `.env.encrypted` files to version control
- Store encryption keys securely
- Update `.gitignore` to exclude sensitive files
- Keep original credentials backed up securely## Dependencies
- Playwright
- CryptoJS
- dotenv## Contributing
1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request