Skip to content

Commit 6b27481

Browse files
authored
Remove Robot Framework 3.0.x support (robotframework#1514)
Fixes robotframework#1513
1 parent 6e39522 commit 6b27481

File tree

6 files changed

+43
-68
lines changed

6 files changed

+43
-68
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ matrix:
4343
env:
4444
- BROWSER=chrome
4545
- SELENIUM=3.141.0
46-
- ROBOTFRAMEWORK=3.0.4
46+
- ROBOTFRAMEWORK=3.2a1
4747
- ROBOT_OPTIONS=--dotted
4848
- INTERPRETER=python2
4949
- python: "3.8"

atest/acceptance/big_list_of_naught_strings.robot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Big List Of Naughty Strings
88
... https://github.com/minimaxir/big-list-of-naughty-strings
99
Open Browser To Start Page
1010
${blns} = blns.Get Blns
11-
:FOR ${string} IN @{blns}
12-
\ Check Blns Error Check ${string}
11+
FOR ${string} IN @{blns}
12+
Check Blns Error Check ${string}
13+
END
1314

1415
*** Keywords ***
1516
Check Blns Error Check

atest/acceptance/keywords/elements.robot

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Get Zero Elements
1616
Get Web Element
1717
@{links}= Get WebElements //div[@id="div_id"]/a
1818
${link}= Get WebElement //div[@id="div_id"]/a
19-
Should Be Equal @{links}[0] ${link}
19+
Should Be Equal ${links}[0] ${link}
2020

2121
Get Web Element Should Fail If Element Is Not Found
2222
Run Keyword and Expect Error
@@ -27,14 +27,18 @@ More Get Elements
2727
[Setup] Go To Page "forms/prefilled_email_form.html"
2828
@{checkboxes}= Get WebElements //input[@type="checkbox"]
2929
Length Should Be ${checkboxes} 2
30-
: FOR ${checkbox} IN @{checkboxes}
31-
\ Unselect Checkbox ${checkbox}
32-
: FOR ${checkbox} IN @{checkboxes}
33-
\ Checkbox Should Not Be Selected ${checkbox}
34-
: FOR ${checkbox} IN @{checkboxes}
35-
\ Select Checkbox ${checkbox}
36-
: FOR ${checkbox} IN @{checkboxes}
37-
\ Checkbox Should Be Selected ${checkbox}
30+
FOR ${checkbox} IN @{checkboxes}
31+
Unselect Checkbox ${checkbox}
32+
END
33+
FOR ${checkbox} IN @{checkboxes}
34+
Checkbox Should Not Be Selected ${checkbox}
35+
END
36+
FOR ${checkbox} IN @{checkboxes}
37+
Select Checkbox ${checkbox}
38+
END
39+
FOR ${checkbox} IN @{checkboxes}
40+
Checkbox Should Be Selected ${checkbox}
41+
END
3842

3943
Assign Id To Element
4044
Page Should Not Contain Element my id

atest/acceptance/multiple_browsers_multiple_windows.robot

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Resource resource.robot
1818
*** Test Cases ***
1919
Check Titles of Multiple Browser-Windows
2020
@{BrowserA_Titles}= Get Window Titles browser=BrowserA
21-
Should Be Equal ${BrowserA_Titles} ${BrowserA_EXP_TITLES}
21+
Should Be Equal ${BrowserA_Titles} ${BrowserA_EXP_TITLES}
2222
@{BrowserB_Titles}= Get Window Titles browser=BrowserB
23-
Should Be Equal ${BrowserB_Titles} ${BrowserB_EXP_TITLES}
23+
Should Be Equal ${BrowserB_Titles} ${BrowserB_EXP_TITLES}
2424
@{BrowserC_Titles}= Get Window Titles browser=BrowserC
25-
Should Be Equal ${BrowserC_Titles} ${BrowserC_EXP_TITLES}
25+
Should Be Equal ${BrowserC_Titles} ${BrowserC_EXP_TITLES}
2626
@{All_Browsers_Titles}= Get Window Titles browser=ALL
27-
Should Be Equal ${All_Browsers_Titles} ${ALL_BROWSERS_EXP_TITLES}
27+
Should Be Equal ${All_Browsers_Titles} ${ALL_BROWSERS_EXP_TITLES}
2828

2929
Check Count of Handle
3030
Check Handle Count 3 BrowserA
@@ -46,12 +46,12 @@ Check Count of Identifiers
4646

4747
Check Locations
4848
@{Locations}= Get Locations browser=ALL
49-
Should Be Equal As Strings @{Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?1
50-
Should Be Equal As Strings @{Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?2
51-
Should Be Equal As Strings @{Locations}[2] ${FRONT_PAGE}javascript/dynamic_content.html?3
52-
Should Be Equal As Strings @{Locations}[3] ${FRONT_PAGE}javascript/dynamic_content.html?4
53-
Should Be Equal As Strings @{Locations}[4] ${FRONT_PAGE}javascript/dynamic_content.html?5
54-
Should Be Equal As Strings @{Locations}[5] ${FRONT_PAGE}javascript/dynamic_content.html?6
49+
Should Be Equal As Strings ${Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?1
50+
Should Be Equal As Strings ${Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?2
51+
Should Be Equal As Strings ${Locations}[2] ${FRONT_PAGE}javascript/dynamic_content.html?3
52+
Should Be Equal As Strings ${Locations}[3] ${FRONT_PAGE}javascript/dynamic_content.html?4
53+
Should Be Equal As Strings ${Locations}[4] ${FRONT_PAGE}javascript/dynamic_content.html?5
54+
Should Be Equal As Strings ${Locations}[5] ${FRONT_PAGE}javascript/dynamic_content.html?6
5555
${count} Get Length ${Locations}
5656
Should Be Equal As Integers 6 ${count}
5757

@@ -87,12 +87,12 @@ Get Specific Locations and Title
8787
Switch Window title:WindowA1
8888
Location Should Be ${FRONT_PAGE}javascript/dynamic_content.html?1
8989
@{Locations}= Get Locations browser=BrowserB
90-
Should Be Equal @{Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?4
91-
Should Be Equal @{Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?5
90+
Should Be Equal ${Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?4
91+
Should Be Equal ${Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?5
9292
${count}= Get Length ${Locations}
9393
Should Be Equal As Integers ${count} 2
9494
@{Titles}= Get Window Titles browser=BrowserC
95-
Should Be Equal @{Titles}[0] WindowC1
95+
Should Be Equal ${Titles}[0] WindowC1
9696
${count}= Get Length ${Titles}
9797
Should Be Equal As Integers ${count} 1
9898

@@ -157,7 +157,8 @@ Check Identifiers Count
157157
Switch Window By Location
158158
[Arguments] ${selected_location}
159159
@{IDs}= Get Browser Ids
160-
:FOR ${id} IN @{IDs}
161-
\ @{locations}= Get Locations browser=${id}
162-
\ Run Keyword If '${selected_location}' in $locations
163-
... Switch Window url:${selected_location} browser=${id}
160+
FOR ${id} IN @{IDs}
161+
@{locations}= Get Locations browser=${id}
162+
Run Keyword If '${selected_location}' in $locations
163+
... Switch Window url:${selected_location} browser=${id}
164+
END

src/SeleniumLibrary/utils/types.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Originally based on Robot Framework 3.0.2 robot.utils.robottypes and
18-
# Can be removed when library minimum required Robot Framework
19-
# version is greater than 3.0.4. Then Robot Framework is_truthy should
20-
# also support string NONE as Python False. Also string 0 is evaluated
21-
# as False in RF 3.1 but not in 3.0.4.
2217
from robot.utils import is_string
23-
from robot.utils import PY3
24-
25-
26-
def is_truthy(item):
27-
if is_string(item):
28-
return item.upper() not in ('FALSE', 'NO', '', 'NONE', '0', 'OFF')
29-
return bool(item)
30-
31-
32-
def is_falsy(item):
33-
return not is_truthy(item)
18+
from robot.utils import PY3, is_truthy, is_falsy
3419

3520

3621
def is_noney(item):

utest/test/utils/test_types.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1-
import unittest
1+
from SeleniumLibrary.utils import is_noney
22

3-
from SeleniumLibrary.utils import is_truthy, is_falsy, is_noney
3+
TRUTHY = ['foo', ' ', 1, 2.3, True, [1], 'True', {'k': 'v'}]
44

55

6-
class IsTruthyFalsyNoneyTests(unittest.TestCase):
7-
truthy = ['foo', ' ', 1, 2.3, True, [1], 'True', {'k': 'v'}]
8-
falsy = [0, False, None, [], {}, (), u'', '', 'False', 'None', '0', 'off']
9-
10-
def test_is_truthy(self):
11-
for item in self.truthy:
12-
self.assertTrue(is_truthy(item) is True)
13-
for item in self.falsy:
14-
self.assertTrue(is_truthy(item) is False)
15-
16-
def test_is_falsy(self):
17-
for item in self.truthy:
18-
self.assertTrue(is_falsy(item) is False)
19-
for item in self.falsy:
20-
self.assertTrue(is_falsy(item) is True)
21-
22-
def test_is_noney(self):
23-
for item in [None, 'None', 'NONE', 'none']:
24-
self.assertTrue(is_noney(item) is True)
25-
for item in self.truthy + [False, 0, 'False', '', [], {}, ()]:
26-
self.assertTrue(is_noney(item) is False)
6+
def test_is_noney():
7+
for item in [None, 'None', 'NONE', 'none']:
8+
assert is_noney(item)
9+
for item in TRUTHY + [False, 0, 'False', '', [], {}, ()]:
10+
assert is_noney(item) is False

0 commit comments

Comments
 (0)