Skip to content

Commit e5a981e

Browse files
authored
Deprecate keywords (#1188)
Deprecated keywords with warning, which where deprecated silently in SeleniumLibrary 3.0.
1 parent 8f80596 commit e5a981e

File tree

7 files changed

+17
-21
lines changed

7 files changed

+17
-21
lines changed

atest/acceptance/keywords/lists.robot

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ List Selection Should Be When List Does Not Exist
7474
... List Selection Should Be nonexisting whatever
7575

7676
UnSelect Single Value From List
77-
[Documentation] LOG 2.1 Unselecting option(s) 'Email' from list 'possible_channels'.
7877
Unselect and Verify Selection possible_channels Email phone
7978
# Unselecting already unselected option has no effect
8079
Unselect and Verify Selection possible_channels Email phone
@@ -84,7 +83,6 @@ UnSelect Single Value From List
8483
... Unselect From List preferred_channel
8584

8685
Unselect all options using Unselect From List
87-
[Documentation] LOG 2 Unselecting all options from list 'possible_channels'.
8886
Unselect From List possible_channels
8987
List Should Have No Selections possible_channels
9088

@@ -99,12 +97,11 @@ Unselect All From List
9997
List Should Have No Selections interests
10098

10199
Select From Single Selection List
102-
[Documentation] LOG 2.1 Selecting option(s) 'Email' from list 'preferred_channel'.
103100
Select And verify selection preferred_channel Email Email
104101
Select And verify selection preferred_channel Email Email
105102
Select And verify selection preferred_channel directmail Direct mail
106103
Select From List preferred_channel Telephone
107-
# do something else... anything to ensure the list is really set as the next keyword will pass
104+
# do something else... anything to ensure the list is really set as the next keyword will pass
108105
# if list item is highlighted but not selected
109106
Unselect from List possible_channels
110107
List Selection Should Be preferred_channel Telephone
@@ -135,12 +132,10 @@ Select Non-Existing Item From Multi-Selection List
135132
... Select From List possible_channels Tin Can Phone Email Smoke Signals
136133

137134
Unselect Non-Existing Item From List
138-
[Documentation] LOG 3 Unselecting option(s) 'Tin Can Phone, Smoke Signals, Email' from list 'possible_channels'.
139135
Unselect From List possible_channels Tin Can Phone Smoke Signals
140136
Unselect From List possible_channels Tin Can Phone Smoke Signals Email
141137

142138
Select From Multiselect List
143-
[Documentation] LOG 6 Selecting option(s) 'Direct mail, phone' from list 'possible_channels'.
144139
Select And verify selection possible_channels Email Email Telephone
145140
Select And verify selection possible_channels email email phone
146141
Select And verify selection possible_channels Direct mail Direct mail Email Telephone

src/SeleniumLibrary/keywords/alert.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ class AlertKeywords(LibraryComponent):
3030

3131
@keyword
3232
def input_text_into_prompt(self, text):
33-
"""Deprecated. Use `Input Text Into Alert` instead.
33+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Input Text Into Alert` instead.
3434
3535
Types the given ``text`` into an input field in an alert.
3636
Leaves the alert open.
3737
"""
38+
3839
self.input_text_into_alert(text, self.LEAVE)
3940

4041
@keyword
@@ -99,7 +100,7 @@ def alert_should_not_be_present(self, action=ACCEPT, timeout=0):
99100

100101
@keyword
101102
def choose_cancel_on_next_confirmation(self):
102-
"""Deprecated. Use `Handle Alert` directly instead.
103+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Handle Alert` directly instead.
103104
104105
In versions prior to SeleniumLibrary 3.0, the alert handling
105106
approach needed to be set separately before using the `Confirm
@@ -110,7 +111,7 @@ def choose_cancel_on_next_confirmation(self):
110111

111112
@keyword
112113
def choose_ok_on_next_confirmation(self):
113-
"""Deprecated. Use `Handle Alert` directly instead.
114+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Handle Alert` directly instead.
114115
115116
In versions prior to SeleniumLibrary 3.0, the alert handling
116117
approach needed to be set separately before using the `Confirm
@@ -121,7 +122,7 @@ def choose_ok_on_next_confirmation(self):
121122

122123
@keyword
123124
def confirm_action(self):
124-
"""Deprecated. Use `Handle Alert` instead.
125+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Handle Alert` instead.
125126
126127
By default accepts an alert, but this behavior can be altered
127128
with `Choose Cancel On Next Confirmation` and `Choose Ok On Next
@@ -135,7 +136,7 @@ def confirm_action(self):
135136

136137
@keyword
137138
def get_alert_message(self, dismiss=True):
138-
"""Deprecated. Use `Handle Alert` instead.
139+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Handle Alert` instead.
139140
140141
Returns the message the alert has. Dismisses the alert by default
141142
(i.e. presses ``Cancel``) and setting ``dismiss`` to false leaves
@@ -150,7 +151,7 @@ def get_alert_message(self, dismiss=True):
150151

151152
@keyword
152153
def dismiss_alert(self, accept=True):
153-
"""Deprecated. Use `Handle Alert` instead.
154+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Handle Alert` instead.
154155
155156
Contrary to its name, this keyword accepts the alert by default
156157
(i.e. presses ``Ok``). ``accept`` can be set to a false value

src/SeleniumLibrary/keywords/cookie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_cookies(self):
5454

5555
@keyword
5656
def get_cookie_value(self, name):
57-
"""Deprecated. Use `Get Cookie` instead."""
57+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Get Cookie` instead."""
5858
cookie = self.driver.get_cookie(name)
5959
if cookie is not None:
6060
return cookie['value']

src/SeleniumLibrary/keywords/element.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def set_focus_to_element(self, locator):
550550

551551
@keyword
552552
def focus(self, locator):
553-
"""Deprecated. Use `Set Focus To Element` instead."""
553+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Set Focus To Element` instead."""
554554
self.set_focus_to_element(locator)
555555

556556
@keyword
@@ -689,7 +689,7 @@ def simulate_event(self, locator, event):
689689

690690
@keyword
691691
def simulate(self, locator, event):
692-
"""Deprecated. Use `Simulate Event` instead."""
692+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Simulate Event` instead."""
693693
self.simulate_event(locator, event)
694694

695695
@keyword
@@ -825,13 +825,13 @@ def page_should_not_contain_image(self, locator, message=None, loglevel='INFO'):
825825

826826
@keyword
827827
def get_matching_xpath_count(self, xpath, return_str=True):
828-
"""Deprecated. Use `Get Element Count` instead."""
828+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Get Element Count` instead."""
829829
count = self.get_element_count('xpath:' + xpath)
830830
return str(count) if is_truthy(return_str) else count
831831

832832
@keyword
833833
def xpath_should_match_x_times(self, xpath, x, message=None, loglevel='INFO'):
834-
"""Deprecated, use `Page Should Contain Element` with ``limit`` argument instead."""
834+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Page Should Contain Element` with ``limit`` argument instead."""
835835
self.locator_should_match_x_times('xpath:'+xpath, x, message, loglevel)
836836

837837
@keyword

src/SeleniumLibrary/keywords/frames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def current_frame_should_contain(self, text, loglevel='INFO'):
6565

6666
@keyword
6767
def current_frame_contains(self, text, loglevel='INFO'):
68-
"""Deprecated. Use `Current Frame Should Contain` instead."""
68+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Current Frame Should Contain` instead."""
6969
self.current_frame_should_contain(text, loglevel)
7070

7171
@keyword

src/SeleniumLibrary/keywords/selectelement.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def select_all_from_list(self, locator):
191191

192192
@keyword
193193
def select_from_list(self, locator, *options):
194-
"""Deprecated. Use `Select From List By Label/Value/Index` instead.
194+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Select From List By Label/Value/Index` instead.
195195
196196
This keyword selects options based on labels or values, which makes
197197
it very complicated and slow. It has been deprecated in
@@ -307,7 +307,7 @@ def unselect_all_from_list(self, locator):
307307

308308
@keyword
309309
def unselect_from_list(self, locator, *items):
310-
"""Deprecated. Use `Unselect From List By Label/Value/Index` instead.
310+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Unselect From List By Label/Value/Index` instead.
311311
312312
This keyword unselects options based on labels or values, which makes
313313
it very complicated and slow. It has been deprecated in

src/SeleniumLibrary/keywords/window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_window_handles(self):
127127

128128
@keyword
129129
def list_windows(self):
130-
"""Deprecated. Use `Get Window Handles` instead."""
130+
"""*DEPRECATED in SeleniumLibrary 3.2.* Use `Get Window Handles` instead."""
131131
return self.get_window_handles()
132132

133133
@keyword

0 commit comments

Comments
 (0)