{"id":17635929,"url":"https://github.com/mohawk2/pytest-bdd-web","last_synced_at":"2025-03-30T03:43:06.108Z","repository":{"id":62583997,"uuid":"230954832","full_name":"mohawk2/pytest-bdd-web","owner":"mohawk2","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-06T12:46:44.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T18:06:10.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohawk2.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-30T17:32:20.000Z","updated_at":"2021-11-02T19:28:50.000Z","dependencies_parsed_at":"2022-11-03T21:58:02.962Z","dependency_job_id":null,"html_url":"https://github.com/mohawk2/pytest-bdd-web","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fpytest-bdd-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fpytest-bdd-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fpytest-bdd-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fpytest-bdd-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohawk2","download_url":"https://codeload.github.com/mohawk2/pytest-bdd-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273515,"owners_count":20750904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T02:24:40.273Z","updated_at":"2025-03-30T03:43:06.084Z","avatar_url":"https://github.com/mohawk2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==============\npytest-bdd-web\n==============\n\n.. image:: https://img.shields.io/pypi/v/pytest-bdd-web.svg\n    :target: https://pypi.org/project/pytest-bdd-web\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-bdd-web.svg\n    :target: https://pypi.org/project/pytest-bdd-web\n    :alt: Python versions\n\n.. image:: https://travis-ci.org/mohawk2/pytest-bdd-web.svg?branch=master\n    :target: https://travis-ci.org/mohawk2/pytest-bdd-web\n    :alt: See Build Status on Travis CI\n\n.. image:: https://ci.appveyor.com/api/projects/status/github/mohawk2/pytest-bdd-web?branch=master\n    :target: https://ci.appveyor.com/project/mohawk2/pytest-bdd-web/branch/master\n    :alt: See Build Status on AppVeyor\n\npytest plugin providing a BDD 'language' for web app integration-testing.\n\n----\n\nFeatures\n--------\n\nImplements a simple headless browser that requests web pages according\nto a URL mapping, parses web forms, and enables assertions about\nthe various web responses using PyQuery selectors (similar to jQuery).\n\nExample::\n\n    Feature: Homepage functionality\n        Scenario: Homepage\n            When the user requests list home\n            Then response 0 status code is \"200\"\n            And response 0 element \"#main_title\" contains 'Welcome'\n\n        Scenario: User profile\n            When the user requests view user_profile\n            Then response 0 status code is \"200\"\n            And response 0 element \"tr:contains('Balance')\" contains '45.67'\n            And response 0 form-contains-array-outline \u003carrayfield\u003e \u003carrayvalue\u003e\n\n            Examples:\n            | arrayfield | arrayvalue |\n            | choices    | [0 2 3]    |\n\n\nRequires you to provide these fixtures:\n\n    * client\n    * url_mapping\n\n`client` must implement `get` and `post` methods, compatible with\n`Flask.test_client`.\n\nExample::\n\n    @pytest.fixture\n    def app():\n        \"\"\"Create, configure a new app instance for each test.\"\"\"\n        \"...\"\n        return app\n\n    @pytest.fixture\n    def client(app):\n        return app.test_client()\n\n`url_mapping` must be a dictionary, with keys of top-level \"groups\",\nand values mapping a human-readable \"action\" to an absolute URL in\nyour web app.\n\nExample::\n\n    URL_MAPPING = {\n        'home': {\n            'list': '/',\n            'articles': '/latest/',\n        },\n        'user_profile': {\n            'view': '/user/profile/',\n            'update': '/user/profile/update',\n        },\n        'blog': {\n            'delete': '/blog/{}/delete', # {} gets filled from feature args\n        },\n    };\n    @pytest.fixture\n    def url_mapping():\n        return URL_MAPPING\n\n\nAvailable When Steps\n--------------------\n\n- the user requests {action} {what} *[args...]*\n\nWill operate on the URL looked up from the `url_mapping`, with\nany args substituted in for occurrences of `{}` in the mapped\nURL.\n\nExample::\n\n    When the user requests view user_profile\n\n- the user sets-array {afield} [{avalue}]\n\nSets a form value on the current web page.\n\nExample::\n\n    When the user sets-array choices [1 3 4]\n\n- the user sets-array-outline \u003carrayfield\u003e \u003carrayvalue\u003e\n\nSets a form value on the current web page.\n\nExample::\n\n    When the user sets-array-outline \u003carrayfield\u003e \u003carrayvalue\u003e\n\n    Examples:\n    | arrayfield | arrayvalue |\n    | choices    | [0 2 3]    |\n\n- the user sets {field} \"{value}\"\n\nSets a form value on the current web page.\n\nExample::\n\n    When the user sets fullname \"Big Bob\"\n\n- the user submits requests {action} {what} *[args...]*\n\nWill operate on the URL looked up from the `url_mapping`, with\nany args substituted in for occurrences of `{}` in the mapped\nURL.\n\nExample::\n\n    When the user submits delete blog 4ec2d70\n\n\nAvailable Then Steps\n--------------------\n\n- response {response_index:d} status code is \"{code:d}\"\n\nExample::\n\n    Then response 0 status code is \"200\"\n\n- response {response_index:d} shows element \"{selector}\"\n\nExample::\n\n    Then response 0 shows element \"div.success\"\n\n- response {response_index:d} form-contains-array-outline \u003carrayfield\u003e \u003carrayvalue\u003e\n\nThen-clause asserting about a given outline form-field having the given\noutline array value.\n\nExample::\n\n    Then response 0 form-contains-array-outline \u003carrayfield\u003e \u003carrayvalue\u003e\n\n    Examples:\n    | arrayfield | arrayvalue |\n    | choices    | [0 2 3]    |\n\n- response {response_index:d} json-has \"{key}\"\n\nExample::\n\n    Then response 0 json-has \"account_balance\"\n\n- response {response_index:d} json-contains \"{key}\" \"{phrase}\"\n\nExample::\n\n    Then response 0 json-contains \"account_balance\" \"45.67\"\n\n- response {response_index:d} doesn't show element \"{selector}\"\n\nExample::\n\n    Then response 0 doesn't show element \"div.alert\"\n\n- response {response_index:d} element \"{selector}\" doesn't contain '{phrase}'\n\nExample::\n\n    Then response 0 element \"#username\" doesn't contain 'bob'\n\n- response {response_index:d} element \"{selector}\" doesn't contain-outline \u003ccontains\u003e\n\nThen-clause asserting about a PyQuery-selected element not containing an\noutline value.\n\nExample::\n\n    Then response 0 element \"#username\" doesn't contain 'bob'\n\n- response {response_index:d} element \"{selector}\" doesn't contain-outline \u003ccontains\u003e\n\nThen-clause asserting about a PyQuery-selected element not containing an\noutline value.\n\nExample::\n\n    Then response 0 element \"#response\" doesn't contain-outline \u003ccontains\u003e\n\n    Examples:\n    | contains |\n    | 0 items added |\n\n- response {response_index:d} element \"{selector}\" contains-outline \u003ccontains\u003e\n\nThen-clause asserting about a PyQuery-selected element containing an\noutline value.\n\nExample::\n\n    Then response 0 element \"#username\" contains-outline \u003ccontains\u003e\n\n    Examples:\n    | contains |\n    | Bob |\n\n\nRequirements\n------------\n\nPyQuery, pytest-bdd, mechanize\n\n\nInstallation\n------------\n\nYou can install \"pytest-bdd-web\" via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-bdd-web\n\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"pytest-bdd-web\" is free and open source software\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`file an issue`: https://github.com/mohawk2/pytest-bdd-web/issues\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fpytest-bdd-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohawk2%2Fpytest-bdd-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fpytest-bdd-web/lists"}