-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest_base.py
More file actions
41 lines (33 loc) · 1021 Bytes
/
test_base.py
File metadata and controls
41 lines (33 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pytest
from playwright.sync_api import expect
@pytest.fixture()
def upage(unauthed_page):
unauthed_page.goto("")
yield unauthed_page
@pytest.fixture()
def apage(authed_page):
authed_page.goto("")
yield authed_page
class TestBaseUnauthed:
def test_nav_items(self, upage):
expect(upage.locator("ul.menu > li")).to_have_text(
[
"Organizations",
"Harvest Sources",
"API Documentation",
"Metrics",
"Login",
]
)
class TestBaseAuthed:
def test_nav_items(self, apage):
nav_items_expected = [
("Organizations", 0),
("Harvest Sources", 1),
("API Documentation", 2),
("Metrics", 3),
("Logout", 5),
] # skip logged in user name in index 3
nav_items = apage.locator("ul.menu > li")
for text, index in nav_items_expected:
assert nav_items.nth(index).inner_text() == text