Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #20 from glennhoward/wiki-test-ready-for-review

Renaming test_view_history to be more appropriate and merging the 2 view...
  • Loading branch information...
commit ed03af088f74ee8ab70a3f80dbba0f63c197fb71 2 parents daa72d2 + 06527dd
@AlinT AlinT authored
View
5 tests/test_view_history_after_log_in.py → tests/test_view_history.py
@@ -22,6 +22,11 @@ def test_visitor_can_view_history(self, mozwebqa):
Assert.true(history_pg.is_the_current_page)
Assert.greater(len(history_pg.history_list.strip()), 0)
+ @pytest.mark.nondestructive
+ def test_logged_in_user_can_view_history(self, mozwebqa):
+ home_pg = HomePage(mozwebqa)
+ home_pg.go_to_home_page()
+
home_pg.personal_tools_region.click_log_in_or_create_account()
log_in_or_create_account_pg = LogInOrCreateAccountPage(mozwebqa)
log_in_or_create_account_pg.log_in()
View
61 tests/test_view_source.py
@@ -1,22 +1,39 @@
-#!/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.home import HomePage
-
-
-class TestViewSource:
-
- @pytest.mark.nondestructive
- def test_visitor_can_view_source(self, mozwebqa):
- home_pg = HomePage(mozwebqa)
- home_pg.go_to_home_page()
- view_source_pg = home_pg.header_region.click_view_source()
-
- Assert.true(view_source_pg.is_the_current_page)
- Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
+#!/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.home import HomePage
+from pages.log_in_or_create_account import LogInOrCreateAccountPage
+
+
+class TestViewSource:
+
+ @pytest.mark.nondestructive
+ def test_visitor_can_view_source(self, mozwebqa):
+ home_pg = HomePage(mozwebqa)
+ home_pg.go_to_home_page()
+
+ view_source_pg = home_pg.header_region.click_view_source()
+ Assert.true(view_source_pg.is_the_current_page)
+ Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
+
+ @pytest.mark.nondestructive
+ def test_logged_in_user_can_view_source(self, mozwebqa):
+ home_pg = HomePage(mozwebqa)
+ home_pg.go_to_home_page()
+
+ home_pg.personal_tools_region.click_log_in_or_create_account()
+ log_in_or_create_account_pg = LogInOrCreateAccountPage(mozwebqa)
+ log_in_or_create_account_pg.log_in()
+
+ Assert.false(home_pg.personal_tools_region.is_log_in_or_create_account_visible)
+ Assert.true(home_pg.personal_tools_region.is_log_out_visible)
+
+ view_source_pg = home_pg.header_region.click_view_source()
+ Assert.true(view_source_pg.is_the_current_page)
+ Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
View
31 tests/test_view_source_after_log_in.py
@@ -1,31 +0,0 @@
-#!/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.home import HomePage
-from pages.log_in_or_create_account import LogInOrCreateAccountPage
-
-
-class TestViewSource:
-
- @pytest.mark.nondestructive
- def test_visitor_can_view_source(self, mozwebqa):
- home_pg = HomePage(mozwebqa)
- home_pg.go_to_home_page()
- home_pg.personal_tools_region.click_log_in_or_create_account()
-
- log_in_or_create_account_pg = LogInOrCreateAccountPage(mozwebqa)
- log_in_or_create_account_pg.log_in()
-
- Assert.false(home_pg.personal_tools_region.is_log_in_or_create_account_visible)
- Assert.true(home_pg.personal_tools_region.is_log_out_visible)
-
- view_source_pg = home_pg.header_region.click_view_source()
-
- Assert.true(view_source_pg.is_the_current_page)
- Assert.greater(len(view_source_pg.source_textarea.strip()), 0)
Please sign in to comment.
Something went wrong with that request. Please try again.