-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_ui.py
30 lines (21 loc) · 1017 Bytes
/
test_ui.py
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
import pytest
from pylenium.driver import Pylenium
from veriff import VeriffUI
@pytest.fixture
def veriff(py: Pylenium) -> VeriffUI:
return VeriffUI(py).visit()
VALID_EXAMPLES = [
("Carlos Kidman", "English", "United States of America", "Driver's license", "InContext"),
("张 Zhāng", "中文(简体)", "China", "Passport", "Redirect"),
# ... add more examples including what we've documented in veriff.feature
]
@pytest.mark.parametrize("example", VALID_EXAMPLES)
def test_veriff_valid_flow(example, veriff: VeriffUI):
veriff.launch_veriff_with(*example)
assert veriff.find_QR_code(example[-1]).should().be_visible()
def test_veriff_with_missing_values(veriff: VeriffUI, py: Pylenium):
"""Veriff seems to work even if there are errors or missing data and defaults to English.
This is a bug! What should we show the user instead?
"""
veriff.launch_veriff()
assert veriff.find_QR_code("incontext").is_displayed() is False, "QR code is found instead of an error"