forked from DudyShavit/docker-js-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_edit_profile.py
41 lines (30 loc) · 1.15 KB
/
test_edit_profile.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
31
32
33
34
35
36
37
38
39
40
41
import pytest
import page_object
from pytest_bdd import (
given,
scenario,
then,
when,
)
@pytest.fixture(scope='function')
def context():
return {}
@scenario('edit_profile.feature', 'Edit my profile')
def test_edit_my_profile(context):
pass
@given('I have profile with name "Anna Smith" ,email "anna.smith@example.com", interests "coding"')
def i_am_in_js_app(context):
context['page_home'] = page_object.PageObject()
@when('I want edit the profile with name "Itzhak Stern" ,email "sss@example.com", interests "AI"')
def i_want_to_edit_my_profile(context):
context['page_home'].edit_button()
context['page_home'].edit_name()
context['page_home'].edit_email()
context['page_home'].edit_interests()
context['page_home'].update_button()
@then('The data will be update in the data base')
def the_data_in_mongo_db_is_equal_to_the_data_in_mongo_express(context):
context['page_home'].open_mongo_express()
assert context['page_home'].mongo_express_name() == "Itzhak Stern"
assert context['page_home'].mongo_express_email() == "sss@example.com"
assert context['page_home'].mongo_express_interests() == "AI"