Skip to content

Commit f1a382c

Browse files
chore: fix readme and add new run command
1 parent 3df93fe commit f1a382c

2 files changed

Lines changed: 28 additions & 26 deletions

File tree

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
# Page Object Model (POM) Pattern
22

3-
Este projeto é uma suíte de testes automatizados utilizando [Playwright](https://playwright.dev/) para validar fluxos de autenticação e cadastro em uma aplicação web. O projeto adota o padrão **Page Object Model (POM)** para organizar e simplificar a interação com as páginas, tornando os testes mais legíveis, reutilizáveis e de fácil manutenção.
3+
This project is an automated test suite using [Playwright](https://playwright.dev/) to validate authentication and registration flows in a web application. The project adopts the **Page Object Model (POM)** pattern to organize and simplify page interactions, making tests more readable, reusable, and easy to maintain.
44

5-
## Contexto
5+
## Context
66

7-
O objetivo deste repositório é demonstrar como estruturar testes automatizados de ponta a ponta (E2E) utilizando o padrão de projeto **Page Object Model**. Esse padrão encapsula operações e elementos de cada página em classes específicas, expondo métodos de alto nível para os testes, sem que eles precisem conhecer detalhes de implementação dos elementos da interface.
7+
The purpose of this repository is to demonstrate how to structure end-to-end (E2E) automated tests using the **Page Object Model** design pattern. This pattern encapsulates operations and elements of each page in specific classes, exposing high-level methods for the tests, so they do not need to know implementation details of the UI elements.
88

9-
## Sobre o Page Object Model
9+
## About the Page Object Model
1010

11-
O **Page Object Model (POM)** é um padrão de design que promove a criação de classes para cada página da aplicação, centralizando os seletores e ações em um único local. Isso facilita a manutenção dos testes, pois mudanças na interface exigem alterações apenas nos objetos de página correspondentes.
11+
The **Page Object Model (POM)** is a design pattern that promotes the creation of classes for each application page, centralizing selectors and actions in a single location. This makes test maintenance easier, as UI changes require updates only in the corresponding page objects.
1212

13-
**Exemplo:**
13+
**Example:**
1414
```typescript
1515
const loginPage = new LoginPage(page);
1616
await loginPage.login("email@teste.com", "senha");
1717
```
1818

19-
## Estrutura do Projeto
19+
## Project Structure
2020

21-
- `ui/pages/`: Page Objects com os elementos e ações de cada página.
22-
- `tests/`: Arquivos de teste automatizados.
23-
- `playwright.config.ts`: Configuração do Playwright (incluindo baseURL).
21+
- `ui/pages/`: Page Objects with elements and actions for each page.
22+
- `tests/`: Automated test files.
23+
- `playwright.config.ts`: Playwright configuration (including baseURL).
2424

25-
## Comandos Essenciais
25+
## Essential Commands
2626

27-
- **Executar todos os testes:**
27+
- **Run all tests:**
2828
```
2929
npx playwright test
3030
```
3131

32-
- **Executar testes em modo UI interativo:**
32+
- **Run tests in interactive UI mode:**
3333
```
3434
npx playwright test --ui
3535
```
3636

37-
- **Executar testes em um navegador específico:**
37+
- **Run tests in a specific browser:**
3838
```
3939
npx playwright test --project=chromium
4040
```
4141

42-
- **Executar um arquivo de teste específico:**
42+
- **Run a specific test file:**
4343
```
4444
npx playwright test tests/login.test.ts
4545
```
4646

47-
- **Executar em modo debug:**
47+
- **Run in debug mode:**
4848
```
4949
npx playwright test --debug
5050
```
5151

52-
- **Gerar testes automaticamente com Codegen:**
52+
- **Generate tests automatically with Codegen:**
5353
```
5454
npx playwright codegen
5555
```
5656

57-
## Requisitos
57+
## Requirements
5858

59-
- Node.js instalado
60-
- Dependências instaladas com:
59+
- Node at least v18 installed
60+
- Dependencies installed with:
6161
```
62-
npm install
62+
npm run setup
6363
```
6464

65-
## Observações
65+
## Notes
6666

67-
- O projeto utiliza `baseURL` configurado no `playwright.config.ts`, permitindo o uso de caminhos relativos nos testes.
68-
- Como a aplicação de exemplo não possui banco de dados persistente, os dados criados existem apenas durante a sessão.
67+
- The project uses `baseURL` configured in `playwright.config.ts`, allowing the use of relative paths in tests.
68+
- As the sample application does not have a persistent database, created data exists only during the session.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"version": "1.0.0",
44
"description": "automation test patterns",
55
"main": "index.js",
6-
"scripts": {},
6+
"scripts": {
7+
"setup": "npm install && npx playwright install"
8+
},
79
"author": "Alex Alexandre Alves",
810
"license": "ISC",
911
"devDependencies": {
1012
"@playwright/test": "^1.54.0",
1113
"@types/node": "^24.0.13"
1214
}
13-
}
15+
}

0 commit comments

Comments
 (0)