recordwright


Namerecordwright JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/kochelmonster/recordwright
SummaryAn extension for recording and playback of web interactions in Playwright
upload_time2024-12-29 22:20:02
maintainerNone
docs_urlNone
authorMichael Reithinger
requires_pythonNone
licenseMIT
keywords library testing development web
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Recordwright [![PyPI version](https://badge.fury.io/py/recordwright.svg)](https://badge.fury.io/py/recordwright)

An extension for recording and playback of web interactions in [Playwright](https://pypi.python.org/pypi/playwright/).


While other interaction recorders generate code that you have to extend with your tests, Recordwright integrates the interactions into your test. The first time you run the test, the interaction is recorded, and the following time the recording is played back. If the interaction changes it can be simply recorded again. You do not need to rewrite the whole test.

Recordwright records every event and can also play back drag and drop operations.

## Installation

To install Recordwright
```bash
pip install recordwright
```

## Usage

The following example demonstates  the usage of Recordwright

```python
from playwright.sync_api import sync_playwright
from recordwright import install as install_recorder  # import Recordwright

if __name__ == "__main__":
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=False)
        page = browser.new_page()
        page.goto("https://demo.playwright.dev/todomvc")

        page.get_by_placeholder("What needs to be done?").wait_for()

        # injects the recording code into the page
        recorder = install_recorder(page)

        # if there is no replay file "todo.json, the recording is started and 
        # the result is stored in a replay file.
        # Otherwise the replay file will be replayed.
        recorder.interaction("todo", """
        - Click "What needs to be done"
        - Type "Test RecordWright"
        - Press Enter
        """)

        lis = page.get_by_test_id("todo-item")
        item = lis.first
        assert(item.inner_text() == "Test RecordWright")

        browser.close()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kochelmonster/recordwright",
    "name": "recordwright",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "library, testing, development, web",
    "author": "Michael Reithinger",
    "author_email": "mreithinger@web.de",
    "download_url": "https://files.pythonhosted.org/packages/23/ea/2bd2c2f4acf45e63e1e4f6f79d1c57a0efde08d359534ddd05061b7261ce/recordwright-1.0.1.tar.gz",
    "platform": null,
    "description": "# Recordwright [![PyPI version](https://badge.fury.io/py/recordwright.svg)](https://badge.fury.io/py/recordwright)\n\nAn extension for recording and playback of web interactions in [Playwright](https://pypi.python.org/pypi/playwright/).\n\n\nWhile other interaction recorders generate code that you have to extend with your tests, Recordwright integrates the interactions into your test. The first time you run the test, the interaction is recorded, and the following time the recording is played back. If the interaction changes it can be simply recorded again. You do not need to rewrite the whole test.\n\nRecordwright records every event and can also play back drag and drop operations.\n\n## Installation\n\nTo install Recordwright\n```bash\npip install recordwright\n```\n\n## Usage\n\nThe following example demonstates  the usage of Recordwright\n\n```python\nfrom playwright.sync_api import sync_playwright\nfrom recordwright import install as install_recorder  # import Recordwright\n\nif __name__ == \"__main__\":\n    with sync_playwright() as p:\n        browser = p.chromium.launch(headless=False)\n        page = browser.new_page()\n        page.goto(\"https://demo.playwright.dev/todomvc\")\n\n        page.get_by_placeholder(\"What needs to be done?\").wait_for()\n\n        # injects the recording code into the page\n        recorder = install_recorder(page)\n\n        # if there is no replay file \"todo.json, the recording is started and \n        # the result is stored in a replay file.\n        # Otherwise the replay file will be replayed.\n        recorder.interaction(\"todo\", \"\"\"\n        - Click \"What needs to be done\"\n        - Type \"Test RecordWright\"\n        - Press Enter\n        \"\"\")\n\n        lis = page.get_by_test_id(\"todo-item\")\n        item = lis.first\n        assert(item.inner_text() == \"Test RecordWright\")\n\n        browser.close()\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An extension for recording and playback of web interactions in Playwright",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/kochelmonster/recordwright"
    },
    "split_keywords": [
        "library",
        " testing",
        " development",
        " web"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afb68060ce6b8ee7d00b75fc793b29e8f5ba91da8f0c47fbd5e4e8e8de6e27d5",
                "md5": "375687db05ace1b2dcef29100acc434e",
                "sha256": "31920d5429e56e8e478f712e22d93df8decf4b0b4595314ac4e4038924377e01"
            },
            "downloads": -1,
            "filename": "recordwright-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "375687db05ace1b2dcef29100acc434e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 43791,
            "upload_time": "2024-12-29T22:20:00",
            "upload_time_iso_8601": "2024-12-29T22:20:00.261094Z",
            "url": "https://files.pythonhosted.org/packages/af/b6/8060ce6b8ee7d00b75fc793b29e8f5ba91da8f0c47fbd5e4e8e8de6e27d5/recordwright-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23ea2bd2c2f4acf45e63e1e4f6f79d1c57a0efde08d359534ddd05061b7261ce",
                "md5": "bf7bb3b763a563a16118540c22d3ab00",
                "sha256": "6c815165f429386ebbe941402263fbe51d6cd75fe9a22be16673f4f7233d169f"
            },
            "downloads": -1,
            "filename": "recordwright-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bf7bb3b763a563a16118540c22d3ab00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 43847,
            "upload_time": "2024-12-29T22:20:02",
            "upload_time_iso_8601": "2024-12-29T22:20:02.609062Z",
            "url": "https://files.pythonhosted.org/packages/23/ea/2bd2c2f4acf45e63e1e4f6f79d1c57a0efde08d359534ddd05061b7261ce/recordwright-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-29 22:20:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kochelmonster",
    "github_project": "recordwright",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "recordwright"
}
        
Elapsed time: 2.26816s