Skip to content

Commit d361084

Browse files
Improved Part 4 instructions
1 parent c7b77f9 commit d361084

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

workshop/4-page-objects.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,20 +331,32 @@ If we add more test functions in the future, that construction code will become
331331
Page object fixtures will help our code stay concise.
332332

333333
In pytest, shared fixtures belong in a module under the `tests` directory named `conftest.py`.
334-
Create `tests/conftest.py` and add the following code:
334+
Create a new file at `tests/conftest.py`.
335+
The new project directory layout should look like this:
336+
337+
```
338+
tau-playwright-workshop
339+
├── pages
340+
│ ├── __init__.py
341+
│ ├── search.py
342+
│ └── result.py
343+
└── tests
344+
├── conftest.py
345+
└── test_search.py
346+
```
347+
348+
Then, add the following code to `tests/conftest.py`:
335349

336350
```python
337351
import pytest
338352

339353
from pages.result import DuckDuckGoResultPage
340354
from pages.search import DuckDuckGoSearchPage
341355

342-
343356
@pytest.fixture
344357
def result_page(page):
345358
return DuckDuckGoResultPage(page)
346359

347-
348360
@pytest.fixture
349361
def search_page(page):
350362
return DuckDuckGoSearchPage(page)

0 commit comments

Comments
 (0)