@@ -13,6 +13,16 @@ def test_case():
13
13
@pytest .fixture ()
14
14
def temp_selectors ():
15
15
return {
16
+ "yahoo-reject-cookie" : {
17
+ "selectorData" : "button[name='reject']" ,
18
+ "strategy" : "css" ,
19
+ "groups" : [],
20
+ },
21
+ "yahoo-consent-page-scroll" : {
22
+ "selectorData" : "scroll-down-btn" ,
23
+ "strategy" : "id" ,
24
+ "groups" : [],
25
+ },
16
26
"yahoo-logo" : {
17
27
"selectorData" : "sfp-placeholder" ,
18
28
"strategy" : "id" ,
@@ -24,13 +34,13 @@ def temp_selectors():
24
34
"groups" : [],
25
35
},
26
36
"duckduckgo-logo" : {
27
- "selectorData" : "minimal-homepage_logoHorizontal__Q_hjO " ,
28
- "strategy" : "class " ,
37
+ "selectorData" : "img[alt='DuckDuckGo Logo'] " ,
38
+ "strategy" : "css " ,
29
39
"groups" : [],
30
40
},
31
41
"duckduckgo-tagline" : {
32
- "selectorData" : "minimal-homepage_taglineText__owJPH " ,
33
- "strategy" : "class " ,
42
+ "selectorData" : "//span[contains(@class, ' minimal')] " ,
43
+ "strategy" : "xpath " ,
34
44
"groups" : [],
35
45
},
36
46
}
@@ -40,16 +50,48 @@ def temp_selectors():
40
50
WEBSITE_2 = "https://start.duckduckgo.com/"
41
51
42
52
53
+ @pytest .fixture ()
54
+ def add_prefs ():
55
+ """
56
+ Set the pref to zoom text only (simulate after restart)
57
+ """
58
+ return [("browser.zoom.full" , False )]
59
+
60
+
61
+ @pytest .fixture ()
62
+ def web_page (driver : Firefox , temp_selectors ):
63
+ """
64
+ return instance of generic page with a given website
65
+ """
66
+ generic_page = GenericPage (driver , url = WEBSITE_1 )
67
+ generic_page .elements |= temp_selectors
68
+ generic_page .open ()
69
+ yield generic_page
70
+
71
+
72
+ @pytest .fixture ()
73
+ def reject_consent_page (web_page : GenericPage ):
74
+ """
75
+ reject consent page. scroll to rejection button if necessary.
76
+ """
77
+ if web_page .element_clickable ("yahoo-consent-page-scroll" ):
78
+ web_page .click_on ("yahoo-consent-page-scroll" )
79
+ web_page .wait .until (lambda _ : web_page .element_clickable ("yahoo-reject-cookie" ))
80
+ web_page .click_on ("yahoo-reject-cookie" )
81
+
82
+
43
83
@pytest .mark .ci
44
- @pytest .mark .unstable
45
- def test_zoom_text_only_from_settings (driver : Firefox , temp_selectors ):
84
+ def test_zoom_text_only_from_settings (
85
+ driver : Firefox , web_page : GenericPage , reject_consent_page
86
+ ):
46
87
"""
47
88
C545733.1: Verify that ticking the zoom text only box would only affect the scale of text.
48
89
Verify setting the default zoom level applies the chosen zoom level to all websites.
90
+
91
+ Arguments:
92
+ web_page: instance of generic page.
49
93
"""
50
94
# Initializing objects
51
- web_page = GenericPage (driver , url = WEBSITE_1 ).open ()
52
- web_page .elements |= temp_selectors
53
95
nav = Navigation (driver )
54
96
55
97
# Save the original positions of elements for comparison
@@ -75,18 +117,16 @@ def test_zoom_text_only_from_settings(driver: Firefox, temp_selectors):
75
117
about_prefs .click_on ("zoom-text-only" )
76
118
77
119
78
- @pytest .mark .unstable
79
- def test_zoom_text_only_after_restart (driver : Firefox , temp_selectors ):
120
+ def test_zoom_text_only_after_restart (
121
+ driver : Firefox , web_page : GenericPage , reject_consent_page
122
+ ):
80
123
"""
81
124
C545733.2: Verify that the zoom text only option works after restart
82
- """
83
- # Set the pref to zoom text only (simulate after restart)
84
- about_config = AboutConfig (driver )
85
- about_config .toggle_true_false_config ("browser.zoom.full" )
86
125
126
+ Arguments:
127
+ web_page: instance of generic page.
128
+ """
87
129
# Initializing objects
88
- web_page = GenericPage (driver , url = WEBSITE_1 ).open ()
89
- web_page .elements |= temp_selectors
90
130
nav = Navigation (driver )
91
131
92
132
# Save the original positions of elements for comparison
0 commit comments