This repository contains automated tests for Uplink Web that can be run using Playwright, a Node.js library to automate Chromium, Firefox, and WebKit browsers.
Tests running using GitHub Actions:
Before you begin, ensure you have met the following requirements:
- Node.js: Node.js is installed. You can download it from nodejs.org.
- npm: npm is installed. It comes with Node.js.
- First, clone the original Uplink Web Repository
git clone https://github.com/Satellite-im/UplinkWeb.git
- Install Dependencies from Uplink Web:
npm install
- Run instance in localhost from Uplink Web:
npm run dev
- Clone this testing repository:
git clone [email protected]:Satellite-im/automated-tests-web.git
- Install testing repository dependencies
npm install
- Install Playwright and its dependencies in your local machine
npx playwright install --with-deps
- Now, browse into the testing repository folder that you cloned before and run the following command on CLI
npx playwright test
- If you would like to open the Playwright UI to run the test cases, you can use the following command
npx playwright test --ui
Tests are typically located in the tests
directory. Here is an example of a basic test:
import { test, expect } from "@playwright/test";
test("basic test", async ({ page }) => {
await page.goto("https://example.com");
const title = await page.title();
expect(title).toBe("Example Domain");
});
To run a specific test file:
npx playwright test tests/your-test-file.spec.js
Any contributions to the repository are welcome!