Skip to main content

pytest krtech common library

Project description

Krtech common library for pytest

Selenium web elements wrapper library based on allure report.
Contains base elements, pages and methods (steps).

You can install using pip:
pip install pytest-krtech-common

To configure ```` do:

code:: python
import pytest
from configuration import TestConfig, ConftestOptions

class OverwrittenTestConfig(TestConfig):
myprop = "myprop_value"
mysqldb = "mydb"

tc = OverwrittenTestConfig()
c = ConftestOptions(tc)

def pytest_addoption(parser):

def pytest_runtest_makereport(item, call, __multicall__):
return c.pytest_runtest_makereport(item, call, __multicall__)

def config(request):
op = c.config(request)
yield op


code:: python
from import By
from krtech.decorators import page
from krtech.elements.base_element import BaseElement
from krtech.pages.base_page import BasePage

@page('Profile Page', By.ID, 'profilePageId')
class ProfilePage(BasePage):
HEADER = BaseElement("Profile page header", By.XPATH, ".//h6")


code:: python
from youproject.pages.profile_page import ProfilePage
from krtech.steps.user_steps import UserSteps

@allure.feature('Profile Header')
class TestProfile:

def test_profile_header(self, config):
user = UserSteps(config)
profile_page = ProfilePage(config)

user.should_see_element_matched_to(profile_page.PROFILE, equal_to_ignoring_case(
user.should_see_attribute_value(profile_page.OTHER, 'disabled', True)

Wheel package
To build a wheel package do::
cd pytest-krtech-common/
python bdist_wheel

Package should be available at::

To install from wheel do::
pip install pytest_krtech_common-0.1-py3-none-any.whl

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest_krtech_common-0.1.35-py3-none-any.whl (22.4 kB) Copy SHA256 hash SHA256 Wheel 3.4

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page