This repository contains an end-to-end test automation framework for the Faraway Platform demo, built using Playwright and TypeScript. The framework implements the Page Object Model pattern and includes tests for authentication and NFT purchase flows.
Demo: https://sandbox-platform.faraway.com/demo/
- TypeScript - Primary programming language
- Playwright - Test automation framework
- Yarn - Package manager
- GitHub Actions - CI/CD platform
The framework follows these architectural principles:
- Page Object Model (POM) - Separates test logic from page interactions
- Component-based approach - Reusable UI components (Auth, Purchase, Wallet)
- SOLID principles - Maintainable and extensible code structure
- DRY (Don't Repeat Yourself) - Shared utilities and helper functions
- KISS (Keep It Simple, Stupid) - Clear, straightforward implementations
├── .github/
│ └── workflows/
│ └── playwright.yml
├── fixtures/
│ └── metaMaskFixtures.ts
├── interfaces/
│ └── PageModel.interface.ts
├── pages/
│ ├── components/
│ │ ├── AuthComponent.ts
│ │ ├── PurchaseComponent.ts
│ │ └── WalletComponent.ts
│ ├── BasePage.ts
│ ├── FarawayPage.ts
│ └── MetaMaskExtension.ts
├── test-data/
│ ├── metaMaskWallet.ts
│ └── userData.ts
└── tests/
└── e2e/
├── auth.test.ts
└── purchase.test.ts
- Node.js (LTS version)
- Yarn package manager
- Chrome browser
- Clone the repository:
git clone <repository-url>
cd <repository-name>
- Install dependencies:
yarn install
- Install Playwright browsers:
yarn playwright install --with-deps
- Create a
.env
file in the root directory (if needed for sensitive data) - Update test data in
test-data/
directory if necessary
Run all tests:
yarn playwright test
Run specific test file:
yarn playwright test tests/e2e/auth.test.ts
Test results are automatically generated as HTML reports after each test run. To view the report:
- Run the tests
- Open
playwright-report/index.html
in your browser
In CI/CD pipeline, reports are uploaded as artifacts and can be accessed from the GitHub Actions workflow.
The project uses GitHub Actions for continuous integration. The pipeline:
- Runs on push to main/master branches and pull requests
- Installs dependencies and Playwright browsers
- Executes all tests
- Generates and uploads test reports as artifacts
- Login with email in new tab
- Login with email in popup
- Login with email in same tab
- Verification of user session state
- Network selection and configuration
- Wallet connection
- Transaction approval and confirmation
- Purchase completion verification
The project uses:
- ESLint for code linting
- Prettier for code formatting
Run linting:
yarn lint
Format code:
yarn format
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.