You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self.assertEqual(len(actual_stored_grades), 2, f"Expected 2 actual grades in localStorage BEFORE reload, found {len(actual_stored_grades)} in {parsed_grades_before_reload}")
261
271
272
+
# Check the actual values match what we entered, protecting against None values
self.assertEqual(len(actual_stored_grades_after), 2, f"Expected 2 actual grades in localStorage AFTER reload, found {len(actual_stored_grades_after)} in {parsed_grades_after_reload}")
293
-
294
-
exceptjson.JSONDecodeErrorasjde:
295
-
logger.error(f"Failed to parse grades from localStorage AFTER reload. Content: '{grades_in_storage_after_reload_str}'. Error: {jde}")
296
-
self.fail(f"Grades in localStorage AFTER reload were not valid JSON: {jde}")
297
-
exceptAttributeErrorasae:
298
-
logger.error(f"Parsed grades from localStorage AFTER reload had unexpected structure. Content: {parsed_grades_after_reload}. Error: {ae}")
299
-
self.fail(f"Parsed grades from localStorage AFTER reload had unexpected structure: {ae}")
300
316
301
317
# 6. Verify grades are correctly displayed in the UI after reload
302
318
grades_ui_after_reload=self._get_grades_from_ui()
303
319
logger.info(f"Grades found in UI after reload: {grades_ui_after_reload}")
304
320
self.assertEqual(len(grades_ui_after_reload), 2, f"Expected 2 grades in UI after reload, got {len(grades_ui_after_reload)}")
305
321
306
-
# Optional: Compare actual grade values if _get_grades_from_ui returns them
307
-
# For simplicity, we are just checking counts here as per original test logic.
308
-
# self.assertEqual(initial_grades_ui, grades_ui_after_reload, "Grades in UI should match before and after reload")
309
-
310
322
logger.info(f"Test {test_name} passed. Data persistence on reload verified.")
0 commit comments