openmairie.robotframework
=========================

RobotFramework Library for functional testing openMairie Framework based apps

.. image:: https://img.shields.io/pypi/v/openmairie.robotframework.svg
    :target: https://pypi.python.org/pypi/openmairie.robotframework/
    :alt: Latest PyPI version

.. contents::

Introduction
------------

openmairie.robotframework is a  `RobotFramework <http://robotframework.org/>`_
library who provide keywords to `openMairie Framework <http://www.openmairie.org/framework/>`_
based projects.


Installation
------------

You just need `pip <https://pip.pypa.io>`_ ::

    pip install openmairie.robotframework


Due to the history of this package all the keywords are declared in .robot
files. So you need to call the Reload Library in each Suite Setup. ::

    *** Settings ***
    Library  openmairie.robotframework.Library

    *** Keywords ***
    For Suite Setup
        Reload Library  openmairie.robotframework.Library


Keywords Documentation
----------------------

- https://openmairie.gitlab.io/openmairie.robotframework/


How to generate keywords documentation?
---------------------------------------

1. Activate your virtual environment where robotframework is installed.

2. Generate doc

.. code-block:: bash

    mkdir doc/
    cat src/openmairie/robotframework/*.robot > doc/openmairie.robotframework.robot
    python3 -m robot.libdoc -F robot --name="openmairie.robotframework" doc/openmairie.robotframework.robot doc/index.html

3. Open doc/index.html and enjoy!


How to cross-validate ?
-----------------------

In order to fulfill the process of cross-validation before accepting the merge request:

1. Activate the virtual environment in which you wish to install the repository.

2. Install the repository to be tested on your system:

.. code-block:: bash

    pip install git+https://gitlab.com/openmairie/openmairie.robotframework.git@branch_name

3. Verify if the keywords affected by the changes are still functioning correctly.

In case of any doubts, revert to your original configuration using:

.. code-block:: bash

    pip uninstall openmairie.robotframework

To restore your original setup, use:

.. code-block:: bash

    pip install git+https://gitlab.com/openmairie/openmairie.robotframework.git


How to release ?
----------------

1. Install zest.pyreleaser and its friends in a python virtualenv

.. code-block:: bash

    (py-release) ~> pip install zest.releaser zest.releaser[recommended]

2. Create a ~/.pypirc file, with these parameters (the password is your API token generated for PyPI)

.. code-block:: ini

    [distutils]
    index-servers = pypi

    [pypi]
    username: __token__
    password: #the token value, including the 'pypi-' prefix

    [zest.releaser]
    release        = yes
    create-wheel   = yes
    push-changes   = yes
    version-levels = 1

4. Make the fullrelease with zest.releaser

.. code-block:: bash

    (py-release) ~> fullrelease

5. Little help for the questions by release.Dans les questions posée par l'outil de release:
    - The number for the new version must follow semantic versioning
    - Accept the commit for the version change in setup.py and the release date in docs/CHANGES.rst
    - Accept the git tag creation
    - Accept the upload to PyPI
    - Accept the number for then next development version (following semantic versioning)
    - Accept the commit for this new version
    - Accept to push the changes to the git remote

6. Check that the new commits and tags are on the GitLab repo, and that the new release is on PyPI