Skip to content

Commit 44815c5

Browse files
committed
Tests are working now
1 parent fc1174b commit 44815c5

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

test/acceptance/keywords/__init__.txt

100644100755
File mode changed.
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
*** Settings ***
22
Suite Setup Run Keywords Prefer Custom Keywords Go To Front Page
3-
Test Teardown Register Keyword to Run on Failure Nothing
3+
Suite Teardown Run Keywords Set Debug Loglevel Restore Old Search Order
4+
Test Teardown Register Keyword To Run On Failure Nothing
45
Resource ../resource.txt
56
Library CustomSeleniumKeywords
67

78
*** Test Cases ***
89
Run On Failure Keyword Only Called Once
910
Set Test Variable ${ON FAIL COUNT} ${0}
10-
CustomSeleniumKeywords.Register Keyword To Run On Failure On Fail
11-
Selenium2Library.Register Keyword To Run On Failure On Fail
12-
Run Keyword And Ignore Error Custom Selenium Keyword id=missing
11+
Register Keyword To Run On Failure On Fail
12+
Run Keyword And Ignore Error Custom Selenium Keyword
1313
Should Be Equal ${ON FAIL COUNT} ${1} On Failure Keyword called ${ON FAIL COUNT} times.
14-
[Teardown] Close Browser
14+
15+
*** Variables ***
16+
${old order}
1517

1618
*** Keywords ***
1719
On Fail
1820
${count}= Evaluate ${ON FAIL COUNT} + 1
1921
Set Test Variable ${ON FAIL COUNT} ${count}
2022

2123
Prefer Custom Keywords
22-
Set Library Search Order CustomSeleniumKeywords
24+
${old order}= Set Library Search Order CustomSeleniumKeywords
25+
26+
Restore Old Search Order
27+
Set Library Search Order ${old order}
28+
29+
Open Browser To Front Page
30+
Open Browser ${FRONT PAGE}

test/resources/testlibs/CustomSeleniumKeywords.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from Selenium2Library import Selenium2Library
22
from robot.utils import asserts
3+
from robot.libraries.BuiltIn import BuiltIn
34

45
class CustomSeleniumKeywords(Selenium2Library):
6+
7+
def __init__(self, *args, **kwargs):
8+
ret = super(CustomSeleniumKeywords, self).__init__(*args, **kwargs)
9+
self._cache = BuiltIn().get_library_instance("Selenium2Library")._cache
10+
511
def custom_selenium_keyword(self):
612
self.custom_selenium_keyword_inner()
713

0 commit comments

Comments
 (0)