File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 256
256
"selectorData" : " primaryBrowserLocale" ,
257
257
"strategy" : " id" ,
258
258
"groups" : []
259
+ },
260
+ "update_available_button" : {
261
+ "selectorData" : " updateButton" ,
262
+ "strategy" : " id" ,
263
+ "groups" : []
264
+ },
265
+ "up_to_date_button" : {
266
+ "selectorData" : " checkForUpdatesButton3" ,
267
+ "strategy" : " id" ,
268
+ "groups" : []
259
269
}
260
270
}
Original file line number Diff line number Diff line change
1
+ import time
2
+
3
+ import pytest
4
+ from selenium .webdriver import Firefox
5
+
6
+ from modules .browser_object import Navigation
7
+ from modules .page_object_about_prefs import AboutPrefs
8
+
9
+
10
+ @pytest .fixture ()
11
+ def set_prefs ():
12
+ """Set prefs"""
13
+ return [
14
+ ("app.update.disabledForTesting" , False )
15
+ ]
16
+
17
+
18
+ def test_check_for_updates (driver : Firefox ):
19
+ """
20
+ C143572 - The check for updates button is available and responsive
21
+ The Button changes text to "Restart to update" if an update is available
22
+ """
23
+
24
+ Navigation (driver ).open ()
25
+ about_prefs = AboutPrefs (driver , category = "general" ).open ()
26
+ time .sleep (2 )
27
+
28
+ # Find the 'updateButton' and 'checkForUpdatesButton3' elements
29
+ update_available_button = about_prefs .get_element ("update_available_button" )
30
+ up_to_date_button = about_prefs .get_element ("up_to_date_button" )
31
+ time .sleep (2 )
32
+
33
+ # Check the label of the buttons and assert they are correct
34
+ if update_available_button .is_displayed ():
35
+ label = update_available_button .text
36
+ assert label == "Restart to Update Firefox" , f"Expected label to be 'Restart to Update Firefox' but got '{ label } '"
37
+ assert update_available_button .is_enabled (), "The 'Restart to Update Firefox' button is not clickable"
38
+ elif up_to_date_button .is_displayed ():
39
+ label = up_to_date_button .text
40
+ assert label == "Check for updates" , f"Expected label to be 'Check for updates' but got '{ label } '"
41
+ assert up_to_date_button .is_enabled (), "The 'Check for updates' button is not clickable"
You can’t perform that action at this time.
0 commit comments