{"id":16252229,"url":"https://github.com/jsfehler/stere","last_synced_at":"2025-05-07T15:10:39.424Z","repository":{"id":27311552,"uuid":"113315102","full_name":"jsfehler/stere","owner":"jsfehler","description":"A library for writing Page Objects, designed to work on top of an existing automation library.","archived":false,"fork":false,"pushed_at":"2025-05-07T07:53:06.000Z","size":2348,"stargazers_count":25,"open_issues_count":16,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T08:42:39.420Z","etag":null,"topics":["appium","automation","page-object","page-object-model","pageobject","python","python3","python36","python37","python38","python39","selenium","splinter"],"latest_commit_sha":null,"homepage":"","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/jsfehler.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-06T12:44:37.000Z","updated_at":"2025-03-14T22:37:30.000Z","dependencies_parsed_at":"2023-01-16T22:30:15.857Z","dependency_job_id":"4bd57751-6e76-4564-b20d-7b56b9494a6d","html_url":"https://github.com/jsfehler/stere","commit_stats":{"total_commits":595,"total_committers":3,"mean_commits":"198.33333333333334","dds":0.6403361344537815,"last_synced_commit":"906047c795574a6952cde4f848cd0d2bd7a9eabd"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fstere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fstere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fstere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsfehler%2Fstere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsfehler","download_url":"https://codeload.github.com/jsfehler/stere/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902615,"owners_count":21822262,"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":["appium","automation","page-object","page-object-model","pageobject","python","python3","python36","python37","python38","python39","selenium","splinter"],"created_at":"2024-10-10T15:12:52.072Z","updated_at":"2025-05-07T15:10:39.374Z","avatar_url":"https://github.com/jsfehler.png","language":"Python","readme":"Stere\n=====\n\n\n.. image:: https://img.shields.io/pypi/v/stere.svg\n    :target: https://pypi.org/project/stere\n    :alt: PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/stere.svg\n    :alt: PyPI - Python Version\n    :target: https://github.com/jsfehler/stere\n\n.. image:: https://img.shields.io/github/license/jsfehler/stere.svg\n    :alt: GitHub\n    :target: https://github.com/jsfehler/stere/blob/master/LICENSE\n\n.. image:: https://pyup.io/repos/github/jsfehler/stere/shield.svg\n    :alt: Updates\n    :target: https://pyup.io/repos/github/jsfehler/stere\n\n.. image:: https://github.com/jsfehler/stere/workflows/CI/badge.svg\n    :target: https://github.com/jsfehler/stere/actions/workflows/run_tests.yml\n    :alt: Build status\n\n.. image:: https://codecov.io/gh/jsfehler/stere/branch/master/graph/badge.svg?token=C1vfu8YgWn\n    :target: https://codecov.io/gh/jsfehler/stere\n\n.. image:: https://saucelabs.com/buildstatus/jsfehler\n    :target: https://saucelabs.com/u/jsfehler\n\nStere is a library for writing Page Objects, designed to work on top of an existing automation library.\n\n\nDesign Philosophy\n-----------------\n\nMany implementations of the Page Object model focus on removing the duplication of element locators inside tests.\nStere goes one step further, offering a complete wrapper over the code that drives automation.\n\nThe goals of this project are to:\n\n1 - Eliminate implementation code in test functions. Tests should read like a description of behaviour, not Selenium commands.\n\n2 - Reduce the need for hand-written helper methods in Page Objects. Common actions should have universal solutions.\n\n3 - Provide a simple pattern for writing maintainable Page Objects.\n\nNo automation abilities are built directly into the project; it completely relies on being hooked into other libraries.\nHowever, implementations using `Splinter \u003chttps://github.com/cobrateam/splinter\u003e`_ and `Appium \u003chttps://github.com/appium/appium\u003e`_ are available out of the box.\n\n\nDocumentation\n-------------\n\nhttps://stere.readthedocs.io/en/latest/\n\n\nBasic Usage\n-----------\n\nFundamentally, a Page Object is just a Python class.\n\nA minimal Stere Page Object should:\n\n1 - Subclass the Page class\n\n2 - Declare Fields and Areas in the __init__ method\n\nAs an example, here's the home page for Wikipedia:\n\n.. code-block:: python\n\n    from stere import Page\n    from stere.areas import Area, RepeatingArea\n    from stere.fields import Button, Input, Link, Root, Text\n\n\n    class WikipediaHome(Page):\n        def __init__(self):\n            self.search_form = Area(\n                query=Input('id', 'searchInput'),\n                submit=Button('xpath', '//*[@id=\"search-form\"]/fieldset/button')\n            )\n\n            self.other_projects = RepeatingArea(\n                root=Root('xpath', '//*[@class=\"other-project\"]'),\n                title=Link('xpath', '//*[@class=\"other-project-title\"]'),\n                tagline=Text('xpath', '//*[@class=\"other-project-tagline\"]')\n            )\n\nThe search form is represented as an `Area \u003chttps://stere.readthedocs.io/en/latest/area.html\u003e`_ with two `Fields \u003chttps://stere.readthedocs.io/en/latest/field.html\u003e`_ inside it.\n\nA Field represents a single item, while an Area represents a unique collection of Fields.\n\nThe query and submit Fields didn't have to be placed inside an Area.\nHowever, doing so allows you to use Area's `perform() \u003chttps://stere.readthedocs.io/en/latest/area.html#stere.areas.Area.perform\u003e`_ method.\n\nThe links to other products are represented as a `RepeatingArea \u003chttps://stere.readthedocs.io/en/latest/area.html#stere.areas.RepeatingArea\u003e`_ .\nA RepeatingArea represents a non-unique collection of Fields on the page.\nUsing the root argument as the non-unique selector, RepeatingArea will find all instances of said root,\nthen build the appropriate number of Areas with all the other Fields inside.\n\nIt's just as valid to declare each of the other products as a separate Area\none at a time, like so:\n\n.. code-block:: python\n\n    self.commons = Area(\n        root=Root('xpath', '//*[@class=\"other-project\"][1]'),\n        title=Link('xpath', '//*[@class=\"other-project-title\"]'),\n        tagline=Text('xpath', '//*[@class=\"other-project-tagline\"]')\n    )\n\n    self.wikivoyage = Area(\n        root=Root('xpath', '//*[@class=\"other-project\"][2]'),\n        title=Link('xpath', '//*[@class=\"other-project-title\"]'),\n        tagline=Text('xpath', '//*[@class=\"other-project-tagline\"]')\n    )\n\nWhich style you pick depends entirely on how you want to model the page.\nRepeatingArea does the most good with collections where the number of areas and/or the contents of the areas\ncan't be predicted, such as inventory lists.\n\nUsing a Page Object in a test can be done like so:\n\n.. code-block:: python\n\n    def test_search_wikipedia():\n        home = WikipediaHome()\n        home.search_form.perform('kittens')\n\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"Stere\" 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\nThanks\n------\n\nCross-browser Testing Platform and Open Source \u003c3 Provided by `Sauce Labs`_\n\n\n.. _`file an issue`: https://github.com/jsfehler/stere/issues\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`Sauce labs`: https://saucelabs.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsfehler%2Fstere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsfehler%2Fstere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsfehler%2Fstere/lists"}