Skip to content

Commit a2c6cea

Browse files
committed
Add implementation steps
1 parent 464f8d1 commit a2c6cea

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

docs/test/frontend_testing_methodologies.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,37 @@ A combination for testing HTML structure and content.
216216

217217
## Implementation Steps
218218

219-
1. Set up testing environment:
219+
1. Add testing dependencies to requirements file `requirements/local.txt`:
220+
```text
221+
# Testing Dependencies
222+
selenium>=4.15.2
223+
pytest-xdist>=3.3.1
224+
pytest-cov>=4.1.0
225+
```
226+
227+
2. Update Dockerfile `compose/local/django/Dockerfile` to install Chrome and ChromeDriver:
228+
```dockerfile
229+
# Install Chrome and ChromeDriver for Selenium tests
230+
RUN apt-get update && apt-get install -y \
231+
chromium \
232+
chromium-driver \
233+
&& rm -rf /var/lib/apt/lists/*
234+
```
235+
236+
3. Rebuild Docker container to apply changes:
220237
```bash
221-
pip install selenium pytest pytest-django
238+
docker-compose -f local.yml build django
222239
```
223240

224-
2. Create base test classes:
241+
4. Create test directory structure:
242+
```bash
243+
mkdir -p tests/frontend
244+
touch tests/frontend/__init__.py
245+
touch tests/frontend/base.py
246+
touch tests/frontend/test_setup.py
247+
```
248+
249+
5. Create base test classes:
225250
```python
226251
import pytest
227252
from selenium import webdriver
@@ -238,7 +263,7 @@ class BaseUITest:
238263
pass
239264
```
240265

241-
3. Organize tests by feature:
266+
6. Organize tests by feature:
242267
```python
243268
class TestCollectionManagement(BaseUITest):
244269
def test_create_collection(self):
@@ -250,4 +275,9 @@ class TestCollectionManagement(BaseUITest):
250275
class TestURLPatterns(BaseUITest):
251276
def test_add_include_pattern(self):
252277
pass
253-
```
278+
```
279+
280+
7. Run tests:
281+
```bash
282+
docker-compose -f local.yml run --rm django pytest tests/frontend/test_setup.py -v
283+
```

0 commit comments

Comments
 (0)