odoo-selenium-httpcase


Nameodoo-selenium-httpcase JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryUtilities that make it easy to quickly write and develop Odoo tests using Selenium.
upload_time2023-08-25 19:52:24
maintainer
docs_urlNone
author
requires_python>=3.7.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [//]: # (start-badges)

[![Build Status](https://github.com/Vauxoo/odoo-selenium/actions/workflows/qa.yaml/badge.svg?branch=main)](https://github.com/Vauxoo/odoo-selenium/actions/workflows/qa.yaml?query=branch%3Amain)
[![version](https://img.shields.io/pypi/v/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)
[![wheel](https://img.shields.io/pypi/wheel/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)
[![supported-versions](https://img.shields.io/pypi/pyversions/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)
[![commits-since](https://img.shields.io/github/commits-since/Vauxoo/odoo-selenium/v0.1.3.svg)](https://github.com/Vauxoo/odoo-selenium/compare/v0.1.3...main)

[//]: # (end-badges)


# odoo-selenium
This package provides utilities that make it easy to quickly write and develop Odoo tests using Selenium.

## Usage
Just import `SeleniumCase` and make your Unit Test a subclass of it. Simple as that!
Here is an example that demonstrates it:

```python
from selenium.webdriver.common.by import By

from odoo.tests import tagged

from odoo_selenium import SeleniumCase


@tagged("-at_install", "post_install")
class TestSelenium(SeleniumCase):

    def test_login_page(self):
        self.navigate("/web/login")
        email_input = self.driver.find_element(By.ID, "login")

        self.assertEqual("Email", email_input.get_attribute("placeholder"))
```

## Development
If you wish to contribute, it is easy to set up a development environment. Being a simple library meant to be
integrated with Odoo, all that is needed is to clone the source code and start hacking away. Below you can find
a simple overview of the project and its structure.

### Project Structure
The project is divided in three sections, the library itself, tests and the supporting Docker files to run the test
suite.

#### src
All library code should reside inside this folder. This is the code that will be imported by users on their Odoo tests.

#### tests_odoo
These are Odoo modules and form part of the test suite. Because this package is meant to be used as a utility library
for Odoo, testing does not really make sense without Odoo. These modules only provide tests to be run in Odoo and verify
the library integrates well and does not randomly explode.

### Running the Test Suite
Since an Odoo instance is required to run the test suite, the project relies on Docker to provide this instance and
other required infrastructure, like a PostgreSQL server. Running on a Docker container also means the project itself
is installed as users would, meaning this environment is as close to possible as the 'real world'.

To run the test suite you can simply issue the following command:

```shell
docker compose -f .docker/chrome-compose.yaml up --build --abort-on-container-exit --force-recreate
```

Make sure the working directory when running said command is the repository's root. Docker automatically checks for
changed files so nothing needs to be performed on your part (other than running the command above), this makes testing
iterative changes really easy and quick.

By default, the test suite runs against the newest Odoo version. To run the test suite with a different Odoo version it
is as easy as specifying it:

```shell
ODOO_VERSION=15 docker compose -f .docker/chrome-compose.yaml up --build --abort-on-container-exit --force-recreate
```

The command above will run tests against Odoo 15.0. Images are tagged as: `vauxoo/odoo-selenium:${ODOO_VERSION}` so
if you wanted to inspect the image built above, you can simply use:

```shell
docker run -it --rm --entrypoint=/bin/bash vauxoo/odoo-selenium:15
```

**Note: If your tests fail, and you see old code being referenced, you are using an old image! That's why
`--force-recreate` is used.**


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "odoo-selenium-httpcase",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Vauxoo <info@vauxoo.com>",
    "download_url": "https://files.pythonhosted.org/packages/4b/95/c4fc4ae744ed3d9acd0138f3f1a8800fb665267ac16c4159557048e7476d/odoo_selenium_httpcase-0.1.3.tar.gz",
    "platform": null,
    "description": "[//]: # (start-badges)\n\n[![Build Status](https://github.com/Vauxoo/odoo-selenium/actions/workflows/qa.yaml/badge.svg?branch=main)](https://github.com/Vauxoo/odoo-selenium/actions/workflows/qa.yaml?query=branch%3Amain)\n[![version](https://img.shields.io/pypi/v/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)\n[![wheel](https://img.shields.io/pypi/wheel/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)\n[![supported-versions](https://img.shields.io/pypi/pyversions/odoo-selenium-httpcase.svg)](https://pypi.org/project/odoo-selenium-httpcase)\n[![commits-since](https://img.shields.io/github/commits-since/Vauxoo/odoo-selenium/v0.1.3.svg)](https://github.com/Vauxoo/odoo-selenium/compare/v0.1.3...main)\n\n[//]: # (end-badges)\n\n\n# odoo-selenium\nThis package provides utilities that make it easy to quickly write and develop Odoo tests using Selenium.\n\n## Usage\nJust import `SeleniumCase` and make your Unit Test a subclass of it. Simple as that!\nHere is an example that demonstrates it:\n\n```python\nfrom selenium.webdriver.common.by import By\n\nfrom odoo.tests import tagged\n\nfrom odoo_selenium import SeleniumCase\n\n\n@tagged(\"-at_install\", \"post_install\")\nclass TestSelenium(SeleniumCase):\n\n    def test_login_page(self):\n        self.navigate(\"/web/login\")\n        email_input = self.driver.find_element(By.ID, \"login\")\n\n        self.assertEqual(\"Email\", email_input.get_attribute(\"placeholder\"))\n```\n\n## Development\nIf you wish to contribute, it is easy to set up a development environment. Being a simple library meant to be\nintegrated with Odoo, all that is needed is to clone the source code and start hacking away. Below you can find\na simple overview of the project and its structure.\n\n### Project Structure\nThe project is divided in three sections, the library itself, tests and the supporting Docker files to run the test\nsuite.\n\n#### src\nAll library code should reside inside this folder. This is the code that will be imported by users on their Odoo tests.\n\n#### tests_odoo\nThese are Odoo modules and form part of the test suite. Because this package is meant to be used as a utility library\nfor Odoo, testing does not really make sense without Odoo. These modules only provide tests to be run in Odoo and verify\nthe library integrates well and does not randomly explode.\n\n### Running the Test Suite\nSince an Odoo instance is required to run the test suite, the project relies on Docker to provide this instance and\nother required infrastructure, like a PostgreSQL server. Running on a Docker container also means the project itself\nis installed as users would, meaning this environment is as close to possible as the 'real world'.\n\nTo run the test suite you can simply issue the following command:\n\n```shell\ndocker compose -f .docker/chrome-compose.yaml up --build --abort-on-container-exit --force-recreate\n```\n\nMake sure the working directory when running said command is the repository's root. Docker automatically checks for\nchanged files so nothing needs to be performed on your part (other than running the command above), this makes testing\niterative changes really easy and quick.\n\nBy default, the test suite runs against the newest Odoo version. To run the test suite with a different Odoo version it\nis as easy as specifying it:\n\n```shell\nODOO_VERSION=15 docker compose -f .docker/chrome-compose.yaml up --build --abort-on-container-exit --force-recreate\n```\n\nThe command above will run tests against Odoo 15.0. Images are tagged as: `vauxoo/odoo-selenium:${ODOO_VERSION}` so\nif you wanted to inspect the image built above, you can simply use:\n\n```shell\ndocker run -it --rm --entrypoint=/bin/bash vauxoo/odoo-selenium:15\n```\n\n**Note: If your tests fail, and you see old code being referenced, you are using an old image! That's why\n`--force-recreate` is used.**\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Utilities that make it easy to quickly write and develop Odoo tests using Selenium.",
    "version": "0.1.3",
    "project_urls": {
        "Source": "https://github.com/vauxoo/odoo-selenium"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "595431abd2d3fa963f047e0fc06b8a5207ef39e9d38434a73c69005b8f3dcdd1",
                "md5": "0214b5ccddd1450a30c904985e39e670",
                "sha256": "0fbd950ee79690d49700e3270cb6583d371c851a529251fb536c29268f27357b"
            },
            "downloads": -1,
            "filename": "odoo_selenium_httpcase-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0214b5ccddd1450a30c904985e39e670",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.0",
            "size": 8195,
            "upload_time": "2023-08-25T19:52:23",
            "upload_time_iso_8601": "2023-08-25T19:52:23.164123Z",
            "url": "https://files.pythonhosted.org/packages/59/54/31abd2d3fa963f047e0fc06b8a5207ef39e9d38434a73c69005b8f3dcdd1/odoo_selenium_httpcase-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b95c4fc4ae744ed3d9acd0138f3f1a8800fb665267ac16c4159557048e7476d",
                "md5": "0aaa151732504d50b93502cc5b98b8e2",
                "sha256": "14d9a67a76659a4c8d16166a34fa97c1337ac90749fa50311afbc6cea8256c14"
            },
            "downloads": -1,
            "filename": "odoo_selenium_httpcase-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0aaa151732504d50b93502cc5b98b8e2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 7028,
            "upload_time": "2023-08-25T19:52:24",
            "upload_time_iso_8601": "2023-08-25T19:52:24.292160Z",
            "url": "https://files.pythonhosted.org/packages/4b/95/c4fc4ae744ed3d9acd0138f3f1a8800fb665267ac16c4159557048e7476d/odoo_selenium_httpcase-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-25 19:52:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vauxoo",
    "github_project": "odoo-selenium",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "odoo-selenium-httpcase"
}
        
Elapsed time: 0.11813s