File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,14 @@ def generate_gherkin(srt_actions):
17
17
action [2 ] = unquote (action [2 ], errors = "strict" )
18
18
except Exception :
19
19
pass
20
- sb_actions .append ('Open "%s"' % action [2 ])
20
+ if '"' not in action [2 ]:
21
+ sb_actions .append ('Open "%s"' % action [2 ])
22
+ elif "'" not in action [2 ]:
23
+ sb_actions .append ("Open '%s'" % action [2 ])
24
+ else :
25
+ sb_actions .append (
26
+ 'Open "%s"' % action [2 ].replace ('"' , '\\ "' )
27
+ )
21
28
elif action [0 ] == "f_url" :
22
29
if "%" in action [2 ] and python3 :
23
30
try :
@@ -26,7 +33,14 @@ def generate_gherkin(srt_actions):
26
33
action [2 ] = unquote (action [2 ], errors = "strict" )
27
34
except Exception :
28
35
pass
29
- sb_actions .append ('Open if not "%s"' % action [2 ])
36
+ if '"' not in action [2 ]:
37
+ sb_actions .append ('Open if not "%s"' % action [2 ])
38
+ elif "'" not in action [2 ]:
39
+ sb_actions .append ("Open if not '%s'" % action [2 ])
40
+ else :
41
+ sb_actions .append (
42
+ 'Open if not "%s"' % action [2 ].replace ('"' , '\\ "' )
43
+ )
30
44
elif action [0 ] == "click" :
31
45
if '"' not in action [1 ]:
32
46
sb_actions .append ('Click "%s"' % action [1 ])
Original file line number Diff line number Diff line change @@ -3898,7 +3898,14 @@ def __process_recorded_actions(self):
3898
3898
action[2] = unquote(action[2], errors="strict")
3899
3899
except Exception:
3900
3900
pass
3901
- sb_actions.append('self.open("%s")' % action[2])
3901
+ if '"' not in action[2]:
3902
+ sb_actions.append('self.open("%s")' % action[2])
3903
+ elif "'" not in action[2]:
3904
+ sb_actions.append("self.open('%s')" % action[2])
3905
+ else:
3906
+ sb_actions.append(
3907
+ 'self.open("%s")' % action[2].replace('"', '\\"')
3908
+ )
3902
3909
elif action[0] == "f_url":
3903
3910
if "%" in action[2] and python3:
3904
3911
try:
@@ -3907,7 +3914,15 @@ def __process_recorded_actions(self):
3907
3914
action[2] = unquote(action[2], errors="strict")
3908
3915
except Exception:
3909
3916
pass
3910
- sb_actions.append('self.open_if_not_url("%s")' % action[2])
3917
+ if '"' not in action[2]:
3918
+ sb_actions.append('self.open_if_not_url("%s")' % action[2])
3919
+ elif "'" not in action[2]:
3920
+ sb_actions.append("self.open_if_not_url('%s')" % action[2])
3921
+ else:
3922
+ sb_actions.append(
3923
+ 'self.open_if_not_url("%s")'
3924
+ % action[2].replace('"', '\\"')
3925
+ )
3911
3926
elif action[0] == "click":
3912
3927
method = "click"
3913
3928
if '"' not in action[1]:
You can’t perform that action at this time.
0 commit comments