-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_e2e_forms.py
More file actions
executable file
·29 lines (27 loc) · 992 Bytes
/
test_e2e_forms.py
File metadata and controls
executable file
·29 lines (27 loc) · 992 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
import requests
import pytest
def test_fill_simple_form():
"""Testuje wypełnianie prostego formularza przez API coBoarding."""
payload = {
"form_url": "http://localhost:8090/forms/simple-form.html",
"cv_path": "/volumes/cv/example_cv.html"
}
r = requests.post("http://localhost:5000/fill-form", json=payload, timeout=30)
assert r.status_code == 200
data = r.json()
assert data.get("status") == "success"
assert "filled_form_url" in data
@pytest.mark.parametrize("form_url", [
"http://localhost:8090/forms/complex-form.html",
"http://localhost:8090/forms/file-upload-form.html"
])
def test_fill_other_forms(form_url):
payload = {
"form_url": form_url,
"cv_path": "/volumes/cv/example_cv.html"
}
r = requests.post("http://localhost:5000/fill-form", json=payload, timeout=60)
assert r.status_code == 200
data = r.json()
assert data.get("status") == "success"
assert "filled_form_url" in data