Git Product home page Git Product logo

zebrunner_py_test's Introduction

Zebrunner pytest agent test repository

Prerequisites

  1. python 3.6+
  2. pip
  3. virtualenv
  4. pytest
  5. selenium standalone server to run web tests locally

Installation guide

clone this repo

[email protected]:shukal94/zebrunner_py_test.git navigate to the repo root cd zebrunner_py_test/

OPTIONAL create and activate the virtual environment for this project

python3 -m virtualenv dev && source dev/bin/activate

install all the dependencies, they are at requirements.txt file

pip install -r requirements.txt ####NOTE: zebrunnerpy plugin in this file is 0.6, please - ensure you're using the latest version (https://pypi.org/project/zebrunnerpy/) register the installed plugin in your project at conftest.py


from zebrunnerpy import connector_obj, PyTestZafiraListener

from src.common.logging_config import apply_initial_logging_configuration


pytest_plugins = ['zebrunnerpy.plugin']
is_zafira_plugged_in = True
connector_obj.pytest_listener = PyTestZafiraListener(connector_obj.state)
apply_initial_logging_configuration()


def pytest_configure(config):
    """
    Attaches wrapped hooks as plugin
    """
    config.pluginmanager.register(connector_obj.pytest_listener)

update your config zafira_properties.ini with the corresponding options

service_url = base URL of your Zebrunner tenant
zafira_enabled = True or False
access_token = refresh token you got from zebrunner user settings
driver_instance_name = driver (name of your driver instance - needed for screenshoting)
suite = test suite name (any String)
build = build number (any String)
env = run environment (any String)
test_owners = sshukalovich,dmishin,test1 - list of real usernames of your tenant
test_run_artifact = jenkins-log.log (any Path)
test_run_artifact_url = https://ci.organization.org/pipelines/jenkins-log-20200828.tar.gz (any Url)

define the test maintainers at pytest.ini

[pytest]
#custom pytest markers including test owners
markers=sshukalovich dmishin test1

####NOTE: sshukalovich dmishin test1 are real users for the test tenant example

@pytest.mark.sshukalovich
    def test_passed(self):
        self.LOGGER.info('PASS')
        assert 1 == 1, 'is not as expected'

ensure you have pytest as the default testrunner on your IDE and working directory is the root of the project

start selenium server, the props and capabilities you can find at gui_properties.ini

That's it!

##USAGE just run your tests

zebrunner_py_test's People

Contributors

shukal94 avatar

Watchers

 avatar

Forkers

vdelendik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.