{ "info": { "author": "Joshua Cruz Cintr\u00f3n", "author_email": "joshua.cruz15@upr.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "\n# UI Test Framework\n\nPackage for Testing Browser User interfaces.\n\n## Installation\n\n pip install uitestframework\nYou must also download the driver for your selected browser and place it in your working directory Drivers can be\ndownloaded [here](https://www.seleniumhq.org/download/).\n\n## Usage\n\nThe UI Test Framework provides a base for creating browser based UI tests by using the Page Object Model and selenium\n webdriver. You might find\nit most useful for testing web application in development in which the UI is continually being changed. Typical usage\noften looks like this:\n\n```python\nfrom unittest import TestCase\n\nfrom uitestframework import UITestCaseMixin, PageObjectModel\nfrom uitestframework.pom import BasePage, BaseElement\n\nAPPLICATION_HOST = \"https://localhost:8080\"\n\n\nclass MyPage(BasePage):\n def set_elements(self):\n # adds a BaseElement instance \"Button1\" to MyPage\n button1 = BaseElement(name=\"Button1\", locator=\"button_id\", locator_type='id', page=self)\n return [button1]\n\n\nclass MyPOM(PageObjectModel):\n # Maps url paths to BasePage instance\n url_map = {\n '': MyPage,\n }\n\n\nclass MyTestCase(UITestCaseMixin, TestCase):\n # These are necessary attributes for this class\n driver_path = \"chromedriver.exe\"\n browser = 'chrome'\n pom = MyPOM()\n\n def test_foo(self):\n # tests that button 1 redirects you from the current page\n self.driver.get(APPLICATION_HOST)\n # Using the url map, the pom knows in which page to look for the specified element attribute\n # Several methods for interacting with UI are implemented in the BaseElement class and its Subclasses\n self.pom.button1.click()\n self.assertTrue(self.driver.current_url != APPLICATION_HOST)\n```\nTo test pages which require user input. The FormPage class can be used. An example of usage is provided below::\n```python\n#!/usr/bin/env python\n\nfrom unittest import TestCase\nfrom selenium.webdriver.common.by import By\n\nfrom uitestframework import UITestCaseMixin, PageObjectModel\nfrom uitestframework.pom import FormPage, FieldElement, BaseElement\n\nAPPLICATION_HOST = \"https://localhost:8080\"\n\n\nclass LoginPage(FormPage):\n\n def set_elements(self):\n username = FieldElement(name='username', locator=\"id_username\", locator_type=By.ID, page=self)\n password = FieldElement(name='password', locator=\"id_password\", locator_type=By.ID, page=self)\n submit = FieldElement(name='submit', locator=\"id_submit\", locator_type=By.ID, page=self)\n error_message = BaseElement(name='error_message', locator=\"id_error\", locator_type=By.ID, page=self)\n return [username, password, submit, error_message]\n\n\nclass MyApplicationPOM(PageObjectModel):\n url_map = {\n '/login': LoginPage,\n }\n\n\nclass MyTestCase(UITestCaseMixin, TestCase):\n driver_path = \"chromedriver.exe\"\n browser = 'chrome'\n pom = MyApplicationPOM()\n\n def test_login(self):\n login_url = APPLICATION_HOST + '/login'\n self.driver.get(login_url)\n self.pom.autofill(username='username', password='correct password')\n self.pom.submit.click()\n self.assertTrue(self.driver.current_url != login_url)\n\n def test_failed_login(self):\n login_url = APPLICATION_HOST + '/login'\n self.driver.get(login_url)\n self.pom.autofill(username='username', password='wrong password')\n self.pom.submit.click()\n self.assertTrue(self.pom.error_message.is_rendered())\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Joshuacruzc/uitestframework", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "uitestframework", "package_url": "https://pypi.org/project/uitestframework/", "platform": "", "project_url": "https://pypi.org/project/uitestframework/", "project_urls": { "Homepage": "https://github.com/Joshuacruzc/uitestframework" }, "release_url": "https://pypi.org/project/uitestframework/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A small package for UI testing in web applications.", "version": "0.0.2" }, "last_serial": 5093907, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d2efe6d43cd9f19949c88bdec54dce0b", "sha256": "4026a5c35d9998f0ad5c6210125d8c8fe339dd3b7a1c5403956f929a1c364548" }, "downloads": -1, "filename": "uitestframework-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d2efe6d43cd9f19949c88bdec54dce0b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6021, "upload_time": "2019-04-03T04:46:30", "url": "https://files.pythonhosted.org/packages/6f/04/1832bb451c67655a60da5148f34fe6ad757912d7dabd17bf2ba27874032f/uitestframework-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75899c8e9befcc1f8462b21b3ba23758", "sha256": "b1c84119fa55d76569549c5fbd7006fc9a3de75151120836f86b9e2682fa89e5" }, "downloads": -1, "filename": "uitestframework-0.0.1.tar.gz", "has_sig": false, "md5_digest": "75899c8e9befcc1f8462b21b3ba23758", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2019-04-03T04:46:32", "url": "https://files.pythonhosted.org/packages/57/60/20bc4fc30a65f9773e5237925545098e79641e2e122a98b27c1a98ad4bf1/uitestframework-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a17be89c4d9cb78f253633ae950af5b0", "sha256": "142107111d5af344f03d2f493fd30dd2e18c0a3b3c23f6eb0b5cebd3b5353c59" }, "downloads": -1, "filename": "uitestframework-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a17be89c4d9cb78f253633ae950af5b0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6327, "upload_time": "2019-04-04T02:10:52", "url": "https://files.pythonhosted.org/packages/a6/f4/f4dbe4f036ef5de0f06257d5c032230ac294271c1b8d337014e03c8569db/uitestframework-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a504f20d871efb6608181dd5f5919b5", "sha256": "bc017fc37700b1324828cb52b44c7c8e80ad020c554e5a9fc9a677ba2473e277" }, "downloads": -1, "filename": "uitestframework-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7a504f20d871efb6608181dd5f5919b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4912, "upload_time": "2019-04-04T02:10:54", "url": "https://files.pythonhosted.org/packages/9b/36/218fc2ae7049b5683f53672efff95239476000a5f3916e924ecd2b284487/uitestframework-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a17be89c4d9cb78f253633ae950af5b0", "sha256": "142107111d5af344f03d2f493fd30dd2e18c0a3b3c23f6eb0b5cebd3b5353c59" }, "downloads": -1, "filename": "uitestframework-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a17be89c4d9cb78f253633ae950af5b0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6327, "upload_time": "2019-04-04T02:10:52", "url": "https://files.pythonhosted.org/packages/a6/f4/f4dbe4f036ef5de0f06257d5c032230ac294271c1b8d337014e03c8569db/uitestframework-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a504f20d871efb6608181dd5f5919b5", "sha256": "bc017fc37700b1324828cb52b44c7c8e80ad020c554e5a9fc9a677ba2473e277" }, "downloads": -1, "filename": "uitestframework-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7a504f20d871efb6608181dd5f5919b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4912, "upload_time": "2019-04-04T02:10:54", "url": "https://files.pythonhosted.org/packages/9b/36/218fc2ae7049b5683f53672efff95239476000a5f3916e924ecd2b284487/uitestframework-0.0.2.tar.gz" } ] }