started tests
This commit is contained in:
parent
49909e76a7
commit
314dc05278
|
@ -1,7 +1,7 @@
|
|||
Scenario: Successful login
|
||||
Given I'm an admin user
|
||||
|
||||
When I open the login page
|
||||
When I go to the admin login page
|
||||
And I fill in the login credentials
|
||||
And I post the form
|
||||
|
||||
|
@ -11,7 +11,7 @@ Scenario: Successful login
|
|||
|
||||
Scenario: Unsuccessful login
|
||||
|
||||
When I open the login page
|
||||
When I go to the admin login page
|
||||
And I fill in wrong login credentials
|
||||
And I post the form
|
||||
|
|
@ -0,0 +1 @@
|
|||
This should contain fixtures that are used in both functional and unit tests
|
|
@ -0,0 +1,48 @@
|
|||
from pytest_bdd import scenario, given, when, then
|
||||
|
||||
|
||||
test_successful_login = scenario(
|
||||
'auth/admin_login.feature',
|
||||
'Successful login',
|
||||
)
|
||||
|
||||
|
||||
@given('I\'m an admin user')
|
||||
def admin_user(user):
|
||||
pass
|
||||
|
||||
|
||||
@when('I go to the admin login page')
|
||||
def go_to_login_page(browser):
|
||||
pass
|
||||
|
||||
|
||||
@when('I fill in the login credentials')
|
||||
def fill_in_login_credentials():
|
||||
pass
|
||||
|
||||
|
||||
@when('I post the form')
|
||||
def post_the_form():
|
||||
pass
|
||||
|
||||
|
||||
@then('I shouldn\'t see an error message')
|
||||
def shouldnt_see_error_message():
|
||||
pass
|
||||
|
||||
|
||||
@then('I should see the Dashboard page')
|
||||
def should_see_dashboard():
|
||||
pass
|
||||
|
||||
|
||||
test_successful_login = scenario(
|
||||
'auth/admin_login.feature',
|
||||
'Unsuccessful login',
|
||||
)
|
||||
|
||||
|
||||
@when('I fill in wrong login credentials')
|
||||
def fill_in_wrong_credentials():
|
||||
pass
|
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
import pytest
|
||||
|
||||
import pytest_bdd_example
|
||||
from .fixtures.auth import *
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def pytestbdd_feature_base_dir():
|
||||
"""Feature files base directory."""
|
||||
return os.path.join(
|
||||
os.path.dirname(
|
||||
os.path.dirname(pytest_bdd_example.__file__)
|
||||
), 'features', 'admin',
|
||||
)
|
|
@ -0,0 +1,6 @@
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def password():
|
||||
return 'asdasd'
|
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
import pytest
|
||||
|
||||
import pytest_bdd_example
|
||||
from .fixtures.auth import *
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def pytestbdd_feature_base_dir():
|
||||
"""Feature files base directory."""
|
||||
return os.path.join(
|
||||
os.path.dirname(
|
||||
os.path.dirname(pytest_bdd_example.__file__)
|
||||
), 'features', 'shop',
|
||||
)
|
Loading…
Reference in New Issue