Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Automated tests for saucedemo.com

## Description
This suite of automated tests for the Saucedemo.com website is built using Playwright 🎭, a powerful tool for automating web application testing. The primary goal is to ensure the functionality and stability of the frontend user interface, providing a seamless experience for site visitors.

## Installation
1. Clone the repository
2. Navigate to the project directory
3. Install dependencies: npm install

## Running Tests
- Run all tests: npx playwright test
- Run a specific test: npx playwright test tests/test-name.spec.ts
- Run in UI mode: npx playwright test --ui

## Project Structure

- 📁 **tests/** – Contains all the test files.
- 📁 **pages/** – Includes page object pattern (POP) files for structuring interactions with pages.
- 📄 **<test-name>.spec.ts** – Test files.

- ⚙️ **playwright.config.ts** – Playwright configuration file for browser settings and test environment configurations.

- 📁 **fixtures/** – Contains fixtures.

- 📁 **utils/** – Utility functions for reusable tasks.
18 changes: 0 additions & 18 deletions tests/example.spec.ts

This file was deleted.

15 changes: 15 additions & 0 deletions tests/mainPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,20 @@ test.describe("Main Page tests", () => {
const mainPage = new MainPage(page);
await mainPage.visitMainPage();

//Перевірка, що поле "Username" відображається
await expect(page.locator('input[data-test="username"]')).toBeVisible();

//Перевірка, що поле "Password" відображається
await expect(page.locator('input[data-test="password"]')).toBeVisible();

//Перевірка, що кнопка "Login" відображається і активна
await expect(page.locator('input[data-test="login-button"]')).toBeVisible();
await expect(page.locator('input[data-test="login-button"]')).toBeEnabled();

//Перевірка, що список користувачів відображається
await expect(page.locator('div[data-test="login-credentials"]')).toBeVisible();

//Перевірка, що блок з паролем відображається
await expect(page.locator('div[data-test="login-password"]')).toBeVisible();
});
});