This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from rbillings/tagsearch
Added test for searching on a QMO post tag
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
#!/usr/bin/env python | |||
|
|||
# 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 base import BasePage | |||
|
|||
|
|||
class TagResultsPage(BasePage): | |||
|
|||
@property | |||
def results(self): | |||
return self.selenium.find_elements(By.CSS_SELECTOR, "#content-main > article") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,24 @@ | |||
#!/usr/bin/env python | |||
|
|||
# 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 unittestzero import Assert | |||
|
|||
from pages.community import CommunityPage | |||
from pages.tag_results import TagResultsPage | |||
|
|||
|
|||
class TestTagSearchPage: | |||
|
|||
@pytest.mark.nondestructive | |||
def test_search_tag(self, mozwebqa): | |||
community_page = CommunityPage(mozwebqa) | |||
community_page.go_to_community_page() | |||
|
|||
tag_results_page = community_page.click_first_tag_link | |||
|
|||
Assert.contains('Posts and pages tagged', tag_results_page.page_title) | |||
Assert.greater(len(tag_results_page.results), 0) |