Hide selectors behind readable page classes — tests become scenarios
data-testid changes, you hunt it down in every test. The selectors belong in one place.__init__; each user task (login, search) is a method. The selector appears once.self from navigations like goto() so calls can chain: LoginPage(...).goto().login(...).pythonpath = . (pytest ≥ 7) puts the project root on sys.path so from pages… import … resolves.Page classes hide the how, so tests read like scenarios and survive redesigns