Skip to content

Commit 205ebc9

Browse files
committed
Make improvements to Recorder Mode
1 parent 8492b39 commit 205ebc9

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

seleniumbase/behave/behave_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ def generate_gherkin(srt_actions):
348348
sb_actions.append("Clear Session Storage")
349349
elif action[0] == "d_a_c":
350350
sb_actions.append("Delete all cookies")
351+
elif action[0] == "go_bk":
352+
sb_actions.append("Go back")
353+
elif action[0] == "go_fw":
354+
sb_actions.append("Go forward")
351355
elif action[0] == "c_box":
352356
method = "Check if unchecked"
353357
if action[2] == "no":

seleniumbase/extensions/recorder.zip

3 Bytes
Binary file not shown.

seleniumbase/fixtures/base_case.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,11 @@ def go_back(self):
919919
self.__check_scope()
920920
self.__last_page_load_url = None
921921
self.driver.back()
922+
if self.recorder_mode:
923+
time_stamp = self.execute_script("return Date.now();")
924+
origin = self.get_origin()
925+
action = ["go_bk", "", origin, time_stamp]
926+
self.__extra_actions.append(action)
922927
if self.browser == "safari":
923928
self.wait_for_ready_state_complete()
924929
self.driver.refresh()
@@ -929,6 +934,11 @@ def go_forward(self):
929934
self.__check_scope()
930935
self.__last_page_load_url = None
931936
self.driver.forward()
937+
if self.recorder_mode:
938+
time_stamp = self.execute_script("return Date.now();")
939+
origin = self.get_origin()
940+
action = ["go_fw", "", origin, time_stamp]
941+
self.__extra_actions.append(action)
932942
self.wait_for_ready_state_complete()
933943
self.__demo_mode_pause_if_active()
934944

@@ -3985,6 +3995,8 @@ def __process_recorded_actions(self):
39853995
ext_actions.append("c_s_s")
39863996
ext_actions.append("d_a_c")
39873997
ext_actions.append("e_mfa")
3998+
ext_actions.append("go_bk")
3999+
ext_actions.append("go_fw")
39884000
ext_actions.append("ss_tl")
39894001
ext_actions.append("da_el")
39904002
ext_actions.append("da_ep")
@@ -4409,6 +4421,10 @@ def __process_recorded_actions(self):
44094421
sb_actions.append("self.clear_session_storage()")
44104422
elif action[0] == "d_a_c":
44114423
sb_actions.append("self.delete_all_cookies()")
4424+
elif action[0] == "go_bk":
4425+
sb_actions.append("self.go_back()")
4426+
elif action[0] == "go_fw":
4427+
sb_actions.append("self.go_forward()")
44124428
elif action[0] == "c_box":
44134429
method = "check_if_unchecked"
44144430
if action[2] == "no":

seleniumbase/js_code/recorder_js.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
non_id_attributes.push('heading');
155155
non_id_attributes.push('translate');
156156
non_id_attributes.push('aria-label');
157+
non_id_attributes.push('rel');
157158
non_id_attributes.push('ng-model');
158159
non_id_attributes.push('ng-href');
159160
non_id_attributes.push('href');

0 commit comments

Comments
 (0)