Skip to main content

Vauxoo Logo

Build Status codecov version wheel supported-versions commits-since

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:

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:

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:

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:

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.

Maintainer

This project is maintained by Vauxoo.

A Latin American company that provides training, coaching, development and implementation of enterprise management systems and bases its entire operation strategy in the use of Open Source Software and its main product Odoo.

Metadata

Release files for odoo-selenium 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for odoo-selenium 0.1.6
File Size Uploaded
odoo_selenium-0.1.6.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for odoo-selenium 0.1.6
File Interpreter ABI Platform
odoo_selenium-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / odoo_selenium-0.1.6.tar.gz

Download URL odoo_selenium-0.1.6.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c1313aee29e7605aa23bf52ccc44f09b7f512e91fd83d0ed1cb318f8ca26aad1
BLAKE2b-256 checksum
How to use checksums
a9e794e9c32232da35be4925f82a06479333b5d9cf8b43f9636b41cbf83363ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / odoo_selenium-0.1.6-py3-none-any.whl

Download URL odoo_selenium-0.1.6-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b7f153244eee5f82aab230eeb447a115b33c777524434222da65c37ebe1d5d2
BLAKE2b-256 checksum
How to use checksums
3b9186799354f31829d479a12c756783a5e655511943e13224dd4e3c28863621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page