def testSubstitutePayloadIds_recursion(self): id_map = {"0.78-1": "0.00-0", "0.78-2": "0.00-1"} substituted = {"args": [{"1": "0.78-1", "2": "0.78-2"}]} client_replay._ReplaceWindowAndElementIds(substituted, id_map) self.assertEqual(substituted, {"args": [{ "1": "0.00-0", "2": "0.00-1" }]})
def testSubstitutePayloadIds_elements(self): id_map = {"0.78-1": "0.00-0", "0.78-2": "0.00-1"} substituted = [{"ELEMENT": "0.78-1"}, {"ELEMENT": "0.78-2"}] client_replay._ReplaceWindowAndElementIds(substituted, id_map) self.assertEqual(substituted, [{ "ELEMENT": "0.00-0" }, { "ELEMENT": "0.00-1" }])
def testSubstitutePayloadIds_windows(self): id_map = {"CDwindow-98": "CDwindow-00"} substituted = ["CDwindow-98"] client_replay._ReplaceWindowAndElementIds(substituted, id_map) self.assertEqual(substituted, ["CDwindow-00"])
def testSubstitutePayloadIds_recursion(self): id_map = {"0.78-1": "0.00-0", "0.78-2": "0.00-1"} substituted = {"args": [{"1": "0.78-1", "2": "0.78-2"}]} client_replay._ReplaceWindowAndElementIds(substituted, id_map) self.assertEqual(substituted, {"args": [{"1": "0.00-0", "2": "0.00-1"}]})
def testSubstitutePayloadIds_elements(self): id_map = {"0.78-1": "0.00-0", "0.78-2": "0.00-1"} substituted = [{"ELEMENT": "0.78-1"}, {"ELEMENT": "0.78-2"}] client_replay._ReplaceWindowAndElementIds(substituted, id_map) self.assertEqual(substituted, [{"ELEMENT": "0.00-0"}, {"ELEMENT": "0.00-1"}])