Promium


NamePromium JSON
Version 3.6.3 PyPI version JSON
download
home_pageNone
SummarySelenium wrapper for testing Web UI
upload_time2025-01-10 10:11:08
maintainerNone
docs_urlNone
authorDenis Korytkin, Nataliia Guieva, Roman Zaporozhets, Vladimir Kritov, Oleh Dykusha
requires_python<4,>=3.10
licenseNone
keywords testing ui selenium pageobject selenium wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Promium
=======

.. image:: https://img.shields.io/badge/Python%3A%203.13-blue
   :target: https://pypi.org/project/Promium/

.. image:: https://badge.fury.io/py/Promium.svg
   :target: https://badge.fury.io/py/Promium

Promium is a simple Selenium wrapper designed to facilitate writing UI tests.

`Promium Documentation <https://qa-automation.git-doc.evo.dev/promium>`_

Overview
--------

Promium simplifies the UI testing process using Selenium. The framework is designed for ease of test creation and provides essential tools for working with elements, pages, and test cases. Supports Python 3.13 and works on Linux and macOS.

Installation and Setup
----------------------

**System Requirements**

- Python 3.13
- Systems: Linux, macOS

To install all dependencies:

.. code-block:: text

   pip install -r requirements.txt

**Install Promium**

.. code-block:: text

   pip install promium

**Driver and Chrome Setup**

To use Promium with Chrome, both Google Chrome and ChromeDriver need to be installed. Use the following commands to set up Chrome and ChromeDriver:

.. code-block:: text

   ARG CHROME_MILESTONE=130

   #============================================
   # Google Chrome
   #============================================
   RUN CHROME_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_MILESTONE}) && \
       curl -Lo /tmp/chrome-linux.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROME_VERSION}/linux64/chrome-linux64.zip && \
       apt-get install -y unzip && \
       unzip /tmp/chrome-linux.zip -d /usr/local/ && \
       ln -s /usr/local/chrome-linux64/chrome /usr/local/bin/google-chrome && \
       rm /tmp/chrome-linux.zip

   #============================================
   # ChromeDriver
   #============================================
   RUN CHROME_DRIVER_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone.json | python3 -c "import sys, json; print(json.load(sys.stdin)['milestones'][str(${CHROME_MILESTONE})]['version'])") && \
       wget --no-verbose -O /tmp/chromedriver_linux64.zip https://storage.googleapis.com/chrome-for-testing-public/${CHROME_DRIVER_VERSION}/linux64/chromedriver-linux64.zip && \
       unzip /tmp/chromedriver_linux64.zip -d /opt/selenium && \
       ln -fs /opt/selenium/chromedriver-linux64/chromedriver /usr/bin/chromedriver && \
       rm /tmp/chromedriver_linux64.zip

Usage Examples
--------------

Below is a basic example of how to define a page object and run a simple test. For more examples, refer to the `Examples Documentation <https://github.com/your-repo-path/promium/doc/examples.md>`_.

**Page Object Example**

.. code-block:: text

    from selenium.webdriver.common.by import By
    from promium import Page, Block, Element, InputField, Link

    class ResultBlock(Block):
        title = Link(By.CSS_SELECTOR, 'h3')
        link = Element(By.CSS_SELECTOR, '.f')
        description = Element(By.CSS_SELECTOR, '.st')
        tags = Element.as_list(By.CSS_SELECTOR, '.osl .fl')

    class GoogleResultPage(Page):
        results_blocks = ResultBlock.as_list(By.CSS_SELECTOR, '#rso .srg div.g')

    class GoogleMainPage(Page):
        url = 'https://google.com'
        logo = Element(By.CSS_SELECTOR, '#hplogo')
        search_input = InputField(By.CSS_SELECTOR, '[name="q"]')

        def search(self, text):
            self.search_input.send_keys(text)
            self.search_input.submit()
            return GoogleResultPage(self.driver)


**Test Example**

.. code-block:: text

    from promium.test_case import WebDriverTestCase
    from tests.pages.google_page import GoogleMainPage

    class TestMainGooglePage(WebDriverTestCase):
        def test_search(self):
            main_page = GoogleMainPage(self.driver)
            main_page.open()
            self.soft_assert_element_is_displayed(main_page.logo)
            result_page = main_page.search('Selenium')
            result_block = result_page.results_blocks.first_item
            self.soft_assert_in('Selenium', result_block.title.text)


**Run a Simple Test**

.. code-block:: text

   # all tests
   pytest tests/

   # all tests in suite
   pytest tests/test_google.py

   # only one test
   pytest tests/test_google.py -k test_search

Development and Testing
-----------------------

To set up a development environment and run tests, use the following commands:

- **Build Docker Image**: `docker build -t promium/base-env .`
- **Run Tests**: `docker-compose run test-se`
- **Check Linting**: `docker-compose run flake8`

Additional Documentation
------------------------

For detailed information on using and configuring Promium, refer to the following documentation files:


- `Assertions <./doc/assertions.md>`_ - Description of available assertion methods for validating test conditions.
- `CI Setup <./doc/ci.md>`_ - Configuration of CI/CD for automating integration processes.
- `Commands <./doc/command.md>`_ - List of available commands and their usage within the framework.
- `Containers <./doc/containers.md>`_ - Information on setting up and using containers for an isolated testing environment.
- `Devices(emulation) <./doc/device.md>`_ - Description of supported devices and configurations.
- `Drivers <./doc/driver.md>`_ - Configuration of drivers for browser interaction.
- `Elements <./doc/element.md>`_ - Working with web elements and their properties.
- `Examples <./doc/examples.md>`_ - Sample tests and scenarios to get started with the framework.
- `Exceptions <./doc/exceptions.md>`_ - Handling exceptions and errors during testing.
- `Test Cases <./doc/test_case.md>`_ - Creating and structuring test cases in Promium.




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Promium",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": null,
    "keywords": "Testing UI, Selenium, PageObject, Selenium wrapper",
    "author": "Denis Korytkin, Nataliia Guieva, Roman Zaporozhets, Vladimir Kritov, Oleh Dykusha",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4a/a9/7e9baaea81ddfc7d84ff074ca4931000df5f40aa3de13df3851546c5546c/promium-3.6.3.tar.gz",
    "platform": "linux",
    "description": "Promium\n=======\n\n.. image:: https://img.shields.io/badge/Python%3A%203.13-blue\n   :target: https://pypi.org/project/Promium/\n\n.. image:: https://badge.fury.io/py/Promium.svg\n   :target: https://badge.fury.io/py/Promium\n\nPromium is a simple Selenium wrapper designed to facilitate writing UI tests.\n\n`Promium Documentation <https://qa-automation.git-doc.evo.dev/promium>`_\n\nOverview\n--------\n\nPromium simplifies the UI testing process using Selenium. The framework is designed for ease of test creation and provides essential tools for working with elements, pages, and test cases. Supports Python 3.13 and works on Linux and macOS.\n\nInstallation and Setup\n----------------------\n\n**System Requirements**\n\n- Python 3.13\n- Systems: Linux, macOS\n\nTo install all dependencies:\n\n.. code-block:: text\n\n   pip install -r requirements.txt\n\n**Install Promium**\n\n.. code-block:: text\n\n   pip install promium\n\n**Driver and Chrome Setup**\n\nTo use Promium with Chrome, both Google Chrome and ChromeDriver need to be installed. Use the following commands to set up Chrome and ChromeDriver:\n\n.. code-block:: text\n\n   ARG CHROME_MILESTONE=130\n\n   #============================================\n   # Google Chrome\n   #============================================\n   RUN CHROME_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_MILESTONE}) && \\\n       curl -Lo /tmp/chrome-linux.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROME_VERSION}/linux64/chrome-linux64.zip && \\\n       apt-get install -y unzip && \\\n       unzip /tmp/chrome-linux.zip -d /usr/local/ && \\\n       ln -s /usr/local/chrome-linux64/chrome /usr/local/bin/google-chrome && \\\n       rm /tmp/chrome-linux.zip\n\n   #============================================\n   # ChromeDriver\n   #============================================\n   RUN CHROME_DRIVER_VERSION=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone.json | python3 -c \"import sys, json; print(json.load(sys.stdin)['milestones'][str(${CHROME_MILESTONE})]['version'])\") && \\\n       wget --no-verbose -O /tmp/chromedriver_linux64.zip https://storage.googleapis.com/chrome-for-testing-public/${CHROME_DRIVER_VERSION}/linux64/chromedriver-linux64.zip && \\\n       unzip /tmp/chromedriver_linux64.zip -d /opt/selenium && \\\n       ln -fs /opt/selenium/chromedriver-linux64/chromedriver /usr/bin/chromedriver && \\\n       rm /tmp/chromedriver_linux64.zip\n\nUsage Examples\n--------------\n\nBelow is a basic example of how to define a page object and run a simple test. For more examples, refer to the `Examples Documentation <https://github.com/your-repo-path/promium/doc/examples.md>`_.\n\n**Page Object Example**\n\n.. code-block:: text\n\n    from selenium.webdriver.common.by import By\n    from promium import Page, Block, Element, InputField, Link\n\n    class ResultBlock(Block):\n        title = Link(By.CSS_SELECTOR, 'h3')\n        link = Element(By.CSS_SELECTOR, '.f')\n        description = Element(By.CSS_SELECTOR, '.st')\n        tags = Element.as_list(By.CSS_SELECTOR, '.osl .fl')\n\n    class GoogleResultPage(Page):\n        results_blocks = ResultBlock.as_list(By.CSS_SELECTOR, '#rso .srg div.g')\n\n    class GoogleMainPage(Page):\n        url = 'https://google.com'\n        logo = Element(By.CSS_SELECTOR, '#hplogo')\n        search_input = InputField(By.CSS_SELECTOR, '[name=\"q\"]')\n\n        def search(self, text):\n            self.search_input.send_keys(text)\n            self.search_input.submit()\n            return GoogleResultPage(self.driver)\n\n\n**Test Example**\n\n.. code-block:: text\n\n    from promium.test_case import WebDriverTestCase\n    from tests.pages.google_page import GoogleMainPage\n\n    class TestMainGooglePage(WebDriverTestCase):\n        def test_search(self):\n            main_page = GoogleMainPage(self.driver)\n            main_page.open()\n            self.soft_assert_element_is_displayed(main_page.logo)\n            result_page = main_page.search('Selenium')\n            result_block = result_page.results_blocks.first_item\n            self.soft_assert_in('Selenium', result_block.title.text)\n\n\n**Run a Simple Test**\n\n.. code-block:: text\n\n   # all tests\n   pytest tests/\n\n   # all tests in suite\n   pytest tests/test_google.py\n\n   # only one test\n   pytest tests/test_google.py -k test_search\n\nDevelopment and Testing\n-----------------------\n\nTo set up a development environment and run tests, use the following commands:\n\n- **Build Docker Image**: `docker build -t promium/base-env .`\n- **Run Tests**: `docker-compose run test-se`\n- **Check Linting**: `docker-compose run flake8`\n\nAdditional Documentation\n------------------------\n\nFor detailed information on using and configuring Promium, refer to the following documentation files:\n\n\n- `Assertions <./doc/assertions.md>`_ - Description of available assertion methods for validating test conditions.\n- `CI Setup <./doc/ci.md>`_ - Configuration of CI/CD for automating integration processes.\n- `Commands <./doc/command.md>`_ - List of available commands and their usage within the framework.\n- `Containers <./doc/containers.md>`_ - Information on setting up and using containers for an isolated testing environment.\n- `Devices(emulation) <./doc/device.md>`_ - Description of supported devices and configurations.\n- `Drivers <./doc/driver.md>`_ - Configuration of drivers for browser interaction.\n- `Elements <./doc/element.md>`_ - Working with web elements and their properties.\n- `Examples <./doc/examples.md>`_ - Sample tests and scenarios to get started with the framework.\n- `Exceptions <./doc/exceptions.md>`_ - Handling exceptions and errors during testing.\n- `Test Cases <./doc/test_case.md>`_ - Creating and structuring test cases in Promium.\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Selenium wrapper for testing Web UI",
    "version": "3.6.3",
    "project_urls": {
        "Documentation": "https://none",
        "Home page": "https://none"
    },
    "split_keywords": [
        "testing ui",
        " selenium",
        " pageobject",
        " selenium wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4aa97e9baaea81ddfc7d84ff074ca4931000df5f40aa3de13df3851546c5546c",
                "md5": "4e3da532202ff59a1e6de6ec3369f7d8",
                "sha256": "e37398081e63ad9bad2ec2ec0e600e93db2b3c153ceb1251f0f68d7c2f05bb25"
            },
            "downloads": -1,
            "filename": "promium-3.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4e3da532202ff59a1e6de6ec3369f7d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 44966,
            "upload_time": "2025-01-10T10:11:08",
            "upload_time_iso_8601": "2025-01-10T10:11:08.791681Z",
            "url": "https://files.pythonhosted.org/packages/4a/a9/7e9baaea81ddfc7d84ff074ca4931000df5f40aa3de13df3851546c5546c/promium-3.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 10:11:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "promium"
}
        
Elapsed time: 2.88960s