Skip to content

Commit c02eb74

Browse files
authored
Improves acceptance tests in Windows (#1355)
1 parent 0410d4e commit c02eb74

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

atest/acceptance/keywords/screenshot_element.robot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Capture Element Screenshot
88
[Setup] Remove Files ${OUTPUTDIR}/selenium-element-screenshot-1.png
99
${path} = Capture Element Screenshot id:nothing
1010
File Should Exist ${OUTPUTDIR}/selenium-element-screenshot-1.png
11-
Should Be Equal ${path} ${OUTPUTDIR}/selenium-element-screenshot-1.png
11+
Should Be Equal ${path} ${OUTPUTDIR}${/}selenium-element-screenshot-1.png
1212

1313
Capture Element Screenshot When Element Does Not Exist
1414
Run Keyword And Expect Error
@@ -17,9 +17,9 @@ Capture Element Screenshot When Element Does Not Exist
1717

1818
Capture Element Screenshot When Path Does Not Exist
1919
[Setup] Remove Directory ${OUTPUTDIR}/elements_pictures
20-
${path} = Capture Element Screenshot id:nothing ${OUTPUTDIR}/elements_pictures/selenium-element-screenshot-1.png
21-
File Should Exist ${OUTPUTDIR}/elements_pictures/selenium-element-screenshot-1.png
22-
Should Be Equal ${path} ${OUTPUTDIR}/elements_pictures/selenium-element-screenshot-1.png
20+
${path} = Capture Element Screenshot id:nothing ${OUTPUTDIR}${/}elements_pictures${/}selenium-element-screenshot-1.png
21+
File Should Exist ${OUTPUTDIR}${/}elements_pictures${/}selenium-element-screenshot-1.png
22+
Should Be Equal ${path} ${OUTPUTDIR}${/}elements_pictures${/}selenium-element-screenshot-1.png
2323

2424
Capture Element Screenshot When No Browser Is Open
2525
[Setup] Close All Browsers
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import json
22
import os
3+
import platform
4+
5+
from robot.api import logger
36

47

58
class BigListOfNaughtyStrings(object):
@@ -8,6 +11,9 @@ class BigListOfNaughtyStrings(object):
811
"""
912

1013
def get_blns(self):
14+
if platform.system() == 'Windows':
15+
logger.warn('Rading Big List of Naughty Strings does not work in Windows OS')
16+
return []
1117
cur_dir = os.path.dirname(os.path.abspath(__file__))
12-
blns = open(os.path.join(cur_dir, 'blns.json'), 'r')
13-
return json.load(blns)
18+
with open(os.path.join(cur_dir, 'blns.json'), 'r') as blns:
19+
return json.load(blns)

0 commit comments

Comments
 (0)