forked from davehunt/input-tests
/
test_feedback_layout.py
177 lines (135 loc) · 6.95 KB
/
test_feedback_layout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Firefox Input.
#
# The Initial Developer of the Original Code is
# Mozilla Corp.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Bebe <florin.strugariu@softvision.ro>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
import pytest
xfail = pytest.mark.xfail
from unittestzero import Assert
import feedback_page
class Test_Feedback_Layout:
"""
Litmus 13593 - input:Verify the layout of homepage
"""
def test_the_header_layout(self, mozwebqa):
"""
Litmus 13594 - input:Verify the layout of header area
Litmus 13599 - input:Check the links in header area
"""
base_page = feedback_page.FeedbackPage(mozwebqa)
base_page.go_to_feedback_page()
header = base_page.header_region
feedback_pg = header.click_feedback_link()
Assert.true(feedback_pg.is_the_current_page)
base_page.go_to_feedback_page()
themes = header.click_themes_link()
Assert.true(themes.is_the_current_page)
base_page.go_to_feedback_page()
sites = header.click_sites_link()
Assert.true(sites.is_the_current_page)
base_page.go_to_feedback_page()
feedback_pg = header.click_main_heading_link()
Assert.true(feedback_pg.is_the_current_page)
def test_the_area_layout(self, mozwebqa):
"""
Litmus 13598 - input:Verify the layout of footer area
"""
feedback_pg = feedback_page.FeedbackPage(mozwebqa)
feedback_pg.go_to_feedback_page()
footer = feedback_pg.footer_region
Assert.equal(footer.privacy_policy, "Privacy Policy")
Assert.equal(footer.legal_notices, "Legal Notices")
Assert.equal(footer.report_trademark_abuse, "Report Trademark Abuse")
Assert.equal(footer.unless_otherwise_noted, "noted")
Assert.equal(footer.creative_commons, "Creative Commons Attribution Share-Alike License v3.0")
Assert.equal(footer.about_input, "About Firefox Input")
Assert.true(footer.is_language_dropdown_visible)
def test_the_left_panel_layout(self, mozwebqa):
"""
Litmus 13595 - input:Verify the layout of the left hand side section containing various
filtering options
Litmus 13600 - input:Verify the applications drop down in Product
"""
feedback_pg = feedback_page.FeedbackPage(mozwebqa)
feedback_pg.go_to_feedback_page()
Assert.true(feedback_pg.product_filter.default_values("firefox", "7.0"))
Assert.false(feedback_pg.date_filter.is_date_filter_applied)
Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible)
feedback_pg.date_filter.click_custom_dates()
Assert.true(feedback_pg.platform_filter.platform_count > 0)
Assert.equal(feedback_pg.product_filter.products, ['Firefox', 'Mobile'])
feedback_pg.product_filter.select_version('--')
types = [type.name for type in feedback_pg.type_filter.types()]
Assert.equal(types, ['Praise', 'Issues', 'Ideas'])
platforms = [platform.name for platform in feedback_pg.platform_filter.platforms()]
Assert.equal(platforms, ['Windows 7', 'Windows XP', 'Windows Vista', 'Mac OS X', 'Linux'])
Assert.true(feedback_pg.locale_filter.locale_count > 0)
locales = [locale.name for locale in feedback_pg.locale_filter.locales()]
Assert.true(set(['English (US)', 'German', 'Spanish', 'French']).issubset(set(locales)))
@xfail(reason="Bug 664562 - [stage] [prod] View older marks does not redirect to page=2")
def test_the_middle_section_page(self, mozwebqa):
"""
Litmus 13596 - input:Verify the layout of Latest Feedback section
Litmus 13721 - input:Verify the layout of Feedback page(Feedback tab)
"""
feedback_pg = feedback_page.FeedbackPage(mozwebqa)
feedback_pg.go_to_feedback_page()
Assert.equal(feedback_pg.search_box_placeholder, "Search by keyword")
Assert.true(feedback_pg.message_count > 0)
Assert.true(feedback_pg.is_chart_visible)
Assert.true(feedback_pg.is_next_page_enabled)
Assert.false(feedback_pg.is_previous_page_enabled)
#the first click only applies the filters and add messages until the message count reaches 20
#the second click goes to the next page
#this is discussed in bug https://bugzilla.mozilla.org/show_bug.cgi?id=640007
feedback_pg.click_next_page()
feedback_pg.click_next_page()
Assert.true(feedback_pg.is_next_page_enabled)
Assert.true(feedback_pg.is_previous_page_enabled)
feedback_pg.click_previous_page()
Assert.true(feedback_pg.is_next_page_visible)
Assert.false(feedback_pg.is_previous_page_enabled)
@xfail(reason="Bug 659640 - [Input] 'While visiting' section is not shown on the homepage")
def test_the_right_panel_layout(self, mozwebqa):
"""
Litmus 13597 - input:Verify the layout of right hand section containing statistics data
Litmus 13716 - input:Verify while visiting section
"""
feedback_pg = feedback_page.FeedbackPage(mozwebqa)
feedback_pg.go_to_feedback_page()
Assert.equal(feedback_pg.total_message_count_heading, "Messages")
Assert.true(feedback_pg.total_message_count > 0)
Assert.equal(feedback_pg.common_words_filter.common_words_header, "Often Mentioned")
Assert.true(feedback_pg.common_words_filter.common_words_count > 0)
Assert.equal(feedback_pg.sites_filter.sites_filter_header, "While Visiting")
Assert.true(feedback_pg.sites_filter.sites_filter_count > 0)