File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,16 @@ def test_wordle(self):
69
69
archive = "https://web.archive.org/web/"
70
70
url = "https://www.nytimes.com/games/wordle/index.html"
71
71
past_wordle = archive + date + "/" + url
72
- print (past_wordle )
72
+ print (" \n " + past_wordle )
73
73
self .open (past_wordle )
74
74
self .click ("game-app::shadow game-modal::shadow game-icon" )
75
75
self .initialize_word_list ()
76
76
keyboard_base = "game-app::shadow game-keyboard::shadow "
77
77
word = random .choice (self .word_list )
78
- total_attempts = 0
78
+ num_attempts = 0
79
79
success = False
80
80
for attempt in range (6 ):
81
- total_attempts += 1
81
+ num_attempts += 1
82
82
word = random .choice (self .word_list )
83
83
letters = []
84
84
for letter in word :
@@ -101,7 +101,9 @@ def test_wordle(self):
101
101
self .modify_word_list (word , letter_status )
102
102
103
103
self .save_screenshot_to_logs ()
104
- print ('\n Word: "%s"\n Attempts: %s' % (word .upper (), total_attempts ))
105
- if not success :
104
+ if success :
105
+ print ('Word: "%s"\n Attempts: %s' % (word .upper (), num_attempts ))
106
+ else :
107
+ print ('Final guess: "%s" (Not the correct word!)' % word .upper ())
106
108
self .fail ("Unable to solve for the correct word in 6 attempts!" )
107
109
self .sleep (3 )
Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ def test_wordle(self):
60
60
self .click ('svg[data-testid="icon-close"]' )
61
61
self .initialize_word_list ()
62
62
word = random .choice (self .word_list )
63
- total_attempts = 0
63
+ num_attempts = 0
64
64
success = False
65
65
for attempt in range (6 ):
66
- total_attempts += 1
66
+ num_attempts += 1
67
67
word = random .choice (self .word_list )
68
68
letters = []
69
69
for letter in word :
@@ -74,7 +74,7 @@ def test_wordle(self):
74
74
self .click (button )
75
75
row = (
76
76
'div[class*="lbzlf"] div[class*="Row-module"]:nth-of-type(%s) '
77
- % total_attempts
77
+ % num_attempts
78
78
)
79
79
tile = row + 'div:nth-child(%s) div[class*="module_tile__3ayIZ"]'
80
80
self .wait_for_element (tile % "5" + '[data-state*="e"]' )
@@ -89,7 +89,9 @@ def test_wordle(self):
89
89
self .modify_word_list (word , letter_status )
90
90
91
91
self .save_screenshot_to_logs ()
92
- print ('\n Word: "%s"\n Attempts: %s' % (word .upper (), total_attempts ))
93
- if not success :
92
+ if success :
93
+ print ('\n Word: "%s"\n Attempts: %s' % (word .upper (), num_attempts ))
94
+ else :
95
+ print ('Final guess: "%s" (Not the correct word!)' % word .upper ())
94
96
self .fail ("Unable to solve for the correct word in 6 attempts!" )
95
97
self .sleep (3 )
You can’t perform that action at this time.
0 commit comments