From db88cf44b98c1063965a7d4230988a9b171cde31 Mon Sep 17 00:00:00 2001 From: Stephen Donner Date: Thu, 15 Sep 2016 16:16:14 -0700 Subject: [PATCH] Deactivate project and add note to README --- .gitignore | 4 --- .travis.yml | 4 --- LICENSE | 3 -- README.md | 86 +-------------------------------------------- pages/__init__.py | 0 pages/base.py | 16 --------- pages/hello.py | 26 -------------- pages/issue.py | 30 ---------------- requirements.txt | 5 --- setup.cfg | 6 ---- tests/__init__.py | 0 tests/conftest.py | 19 ---------- tests/test_hello.py | 24 ------------- 13 files changed, 1 insertion(+), 222 deletions(-) delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 LICENSE delete mode 100644 pages/__init__.py delete mode 100644 pages/base.py delete mode 100644 pages/hello.py delete mode 100644 pages/issue.py delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 tests/__init__.py delete mode 100644 tests/conftest.py delete mode 100644 tests/test_hello.py diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a5071e8..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.cache -.DS_Store -*.py[co] -results diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab61e22..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: python -python: 2.7 -install: "pip install flake8" -script: "flake8 ." diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 41dc232..0000000 --- a/LICENSE +++ /dev/null @@ -1,3 +0,0 @@ -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/README.md b/README.md index e833baa..d545242 100644 --- a/README.md +++ b/README.md @@ -1,85 +1 @@ -# Tests for Mozilla's Hello -This repository contains tests for [Mozilla's Hello](https://hello.firefox.com/). - -[![license](https://img.shields.io/badge/license-MPL%202.0-blue.svg)](https://github.com/mozilla/hello-tests/blob/master/LICENSE) -[![travis](https://img.shields.io/travis/mozilla/hello-tests.svg?label=travis)](http://travis-ci.org/mozilla/hello-tests/) -[![requirements](https://img.shields.io/requires/github/mozilla/hello-tests.svg)](https://requires.io/github/mozilla/hello-tests/requirements/?branch=master) - -## Getting involved -We love working with contributors to fill out the test coverage for Hello, -but it does require a few skills. By contributing to our test suite you will -have an opportunity to learn and/or improve your skills with Python, Selenium -WebDriver, GitHub, virtual environments, the Page Object Model, and more. - -For some resources for learning about these technologies, take a look at our -documentation on [running Web QA automated tests][running-tests]. - -All of [these awesome contributors][contributors] have opened pull requests against this -repository. - -## Questions are always welcome -While we take pains to keep our documentation updated, the best source of -information is those of us who work on the project. Don't be afraid to join us -in irc.mozilla.org [#mozwebqa][irc] to ask questions about our tests. We also -have a [mailing list][list] available that you are welcome to join and post to. - -## How to run the tests locally -We maintain a [detailed guide][running-tests] to running our automated tests. -However, if you want to get started quickly, you can try following the steps -below: - -### Clone the repository -If you have cloned this project already then you can skip this, otherwise you'll -need to clone this repo using Git. If you do not know how to clone a GitHub -repository, check out this [help page][git-clone] from GitHub. - -If you think you would like to contribute to the tests by writing or maintaining -them in the future, it would be a good idea to create a fork of this repository -first, and then clone that. GitHub also has great documentation for -[forking a repository][git-fork]. - -### Create or activate a Python virtual environment -You should install this project's dependencies (which is described in the next -step) into a virtual environment in order to avoid impacting the rest of your -system, and to make problem solving easier. If you already have a virtual -environment for these tests, then you should activate it, otherwise you should -create a new one. For more information on working with virtual environments see -our [summary][virtualenv]. - -### Install dependencies -Install the Python packages that are needed to run our tests using pip. In a -terminal, from the the project root, issue the following command: - -```bash -$ pip install -Ur requirements.txt -``` - -### Run the tests -Tests are run using the command line. Below are a couple of examples of running -the tests: - -To run all of the desktop tests against the default environment: - -```bash -$ py.test --driver Firefox -``` - -To run against a different environment, pass in a value for `--base-url`, like so: - -```bash -$ py.test --base-url https://hello.firefox.com --driver Firefox -``` - -The pytest plugin that we use for running tests has a number of advanced -command line options available. To see the options available, run -`py.test --help`. The full documentation for the plugin can be found -[here][pytest-selenium]. - -[contributors]: https://github.com/mozilla/hello-tests/contributors -[git-clone]: https://help.github.com/articles/cloning-a-repository/ -[git-fork]: https://help.github.com/articles/fork-a-repo/ -[irc]: http://widget01.mibbit.com/?settings=1b10107157e79b08f2bf99a11f521973&server=irc.mozilla.org&channel=%23mozwebqa -[list]: https://mail.mozilla.org/listinfo/mozwebqa -[pytest-selenium]: http://pytest-selenium.readthedocs.org/ -[running-tests]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Running_Web_QA_automated_tests -[virtualenv]: https://wiki.mozilla.org/QA/Execution/Web_Testing/Automation/Virtual_Environments +This repository is no longer being actively maintained, and the content has been removed. Please use the repository history to access the previous content. We are not currently executing or developing tests for Firefox Hello in this repository. You can read more about Hello [here] (https://wiki.mozilla.org/Hello). diff --git a/pages/__init__.py b/pages/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pages/base.py b/pages/base.py deleted file mode 100644 index a3cef2b..0000000 --- a/pages/base.py +++ /dev/null @@ -1,16 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import uuid - -from pypom import Page - - -class Base(Page): - - URL_TEMPLATE = '{room}' - - def __init__(self, selenium, base_url, room=None, **url_kwargs): - room = room or uuid.uuid4() - super(Base, self).__init__(selenium, base_url, room=room, **url_kwargs) diff --git a/pages/hello.py b/pages/hello.py deleted file mode 100644 index 7c4579d..0000000 --- a/pages/hello.py +++ /dev/null @@ -1,26 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from selenium.webdriver.common.by import By - -from pages.base import Base - - -class Hello(Base): - - _hello_logo_locator = (By.CSS_SELECTOR, '.hello-logo') - _failed_room_message_locator = (By.CSS_SELECTOR, '.failed-room-message') - - def wait_for_page_to_load(self): - body = self.find_element(By.TAG_NAME, 'body') - self.wait.until(lambda s: 'is-standalone-room' in body.get_attribute('class')) - return self - - @property - def failed_room_message(self): - return self.find_element(*self._failed_room_message_locator).text - - @property - def is_hello_logo_visible(self): - return self.is_element_displayed(*self._hello_logo_locator) diff --git a/pages/issue.py b/pages/issue.py deleted file mode 100644 index 733514a..0000000 --- a/pages/issue.py +++ /dev/null @@ -1,30 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from selenium.webdriver.common.by import By - -from pages.base import Base - - -class Issue(Base): - - _heading_locator = (By.CSS_SELECTOR, '.info-panel h1') - _download_firefox_prompt_locator = (By.CSS_SELECTOR, '.promote-firefox > p') - _download_firefox_link_locator = (By.CSS_SELECTOR, '.get-firefox a') - - def wait_for_page_to_load(self): - self.wait.until(lambda s: self.is_element_displayed(*self._heading_locator)) - return self - - @property - def heading(self): - return self.find_element(*self._heading_locator).text - - @property - def download_firefox_prompt(self): - return self.find_element(*self._download_firefox_prompt_locator).text - - @property - def download_firefox_location(self): - return self.find_element(*self._download_firefox_link_locator).get_attribute('href') diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 27a311e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -PyPOM -pytest~=3.0.0 -pytest-selenium -pytest-xdist==1.15.0 -selenium==3.0b2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7e7a4bf..0000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[flake8] -ignore=E501 - -[tool:pytest] -base_url=https://loop-webapp.dev.mozaws.net -sensitive_url=firefox\.com diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/conftest.py b/tests/conftest.py deleted file mode 100644 index 1afe4e2..0000000 --- a/tests/conftest.py +++ /dev/null @@ -1,19 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import pytest - - -@pytest.fixture -def capabilities(request, capabilities): - driver = request.config.getoption('driver') - if capabilities.get('browserName', driver).lower() == 'firefox': - capabilities['marionette'] = True - return capabilities - - -@pytest.fixture(scope='session') -def session_capabilities(session_capabilities): - session_capabilities.setdefault('tags', []).append('hello') - return session_capabilities diff --git a/tests/test_hello.py b/tests/test_hello.py deleted file mode 100644 index cca610d..0000000 --- a/tests/test_hello.py +++ /dev/null @@ -1,24 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import pytest - -from pages.hello import Hello -from pages.issue import Issue - - -@pytest.mark.nondestructive -def test_supported_browser(base_url, selenium): - page = Hello(selenium, base_url).open() - assert page.is_hello_logo_visible - assert 'Sorry, you cannot join this conversation. ' \ - 'The link may be expired or invalid.' == page.failed_room_message - - -@pytest.mark.nondestructive -def test_unsupported_browser(base_url, selenium): - page = Issue(selenium, base_url).open() - assert 'Hello is not supported by this browser.' == page.heading - assert 'Get Firefox and start sharing the Web! Learn more.' == page.download_firefox_prompt - assert 'https://www.mozilla.org/firefox/' in page.download_firefox_location