forked from robotframework/RIDE
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for rename prefixed keywords, WIP.
- Loading branch information
1 parent
c9db1eb
commit a69aff7
Showing
15 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class MyListener(): | ||
def before_navigate_to(self, url, driver): | ||
print("Before navigate to %s" % url) | ||
|
||
def after_navigate_to(self, url, driver): | ||
print("After navigate to %s" % url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from selenium.webdriver.support.events import AbstractEventListener | ||
|
||
class SubMyListener(AbstractEventListener): | ||
def before_navigate_to(self, url, driver): | ||
print("Before navigate to %s" % url) | ||
|
||
def after_navigate_to(self, url, driver): | ||
print("After navigate to %s" % url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def my_kw(): | ||
print('kw from sub folder') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def res_kw_2(): | ||
print('kw from sub res folder') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*** Settings *** | ||
Library Collections | ||
Resource ../resources/res01.resource | ||
Library ./Lib/SubMyListener.py | ||
Library ../Sub/Lib/mykw.py | ||
|
||
*** Test Cases *** | ||
case01 | ||
[Setup] res01.keyword3 | ||
keyword2 lalala\nlala\nlala | ||
|
||
case02 | ||
log ${CURDIR} | ||
log ${EXECDIR} | ||
my_kw | ||
kw1 hehe | ||
after navigate to about:blank None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def res_kw(): | ||
print('kw from res folder') |
15 changes: 15 additions & 0 deletions
15
utest/resources/robotdata/TestCases/Sub/resources/res02.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*** Settings *** | ||
Library ./res.py | ||
|
||
*** Keywords *** | ||
keyword1 | ||
[Arguments] ${a} | ||
log ${a} | ||
Run Keyword keyword3 | ||
|
||
keyword2 | ||
[Arguments] ${a} | ||
log ${a} | ||
|
||
keyword3 | ||
res_kw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*** Settings *** | ||
Resource ./resources/res02.resource | ||
Library ./Lib/mykw.py | ||
Resource ../../resources/external_res.resource | ||
|
||
*** Test Cases *** | ||
case01 | ||
[Setup] res02.keyword1 Called from Setup in Sub/Suite02/case01 | ||
my_kw | ||
res02.keyword3 | ||
external_res.keyword2 Called fromSteps on Sub/Suite02/case01 | ||
[Teardown] external_res.keyword3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def my_kw(): | ||
print('kw from root folder') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def res_kw(): | ||
print('kw from res folder') |
29 changes: 29 additions & 0 deletions
29
utest/resources/robotdata/TestCases/resources/res01.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
*** Settings *** | ||
Library res.py | ||
Library Sub/Lib/res2.py # Another comment | ||
|
||
*** Keywords *** | ||
kw1 | ||
[Arguments] ${a} | ||
log ${a} # teste | ||
# comment test testst | ||
log ${a} | ||
|
||
keyword2 | ||
[Arguments] ${a} | ||
log ${a} | ||
Log To Console This is the argument \${a} = ${a} ! | ||
|
||
keyword3 | ||
res kw | ||
res2.res kw 2 # Kw from res2 with a space in calling | ||
|
||
kw4 | ||
Comment res kw | ||
Comment res kw 2 | ||
No Operation | ||
|
||
kw5 | ||
res.kw 2 # teste teste | ||
res.kw | ||
res2.Res Kw 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
*** Settings *** | ||
Suite Setup external_res.keyword2 Called from Suite Setup on Suite01 | ||
Resource ./resources/res01.resource | ||
Resource ./Sub/resources/res02.resource | ||
Library ./mykw.py | ||
Resource ../resources/external_res.resource | ||
|
||
*** Test Cases *** | ||
case01 | ||
res02.keyword2 aaaa\na\na | ||
[Teardown] res02.keyword1 Called from Teardown on case01 | ||
|
||
case02 | ||
[Setup] external_res.keyword1 Called from Setup on case02 | ||
log ${CURDIR} console=True | ||
log ${EXECDIR} console=True | ||
my_kw | ||
res02.keyword1 hehe | ||
|
||
case03 | ||
res02.keyword3 | ||
res01.keyword3 | ||
Run Keyword external_res.keyword3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
*** Settings *** | ||
Documentation This resource is to be used as external resource from test suite ../TestCases | ||
Resource ../TestCases/Sub/resources/res02.resource | ||
|
||
*** Variables *** | ||
${EXT_VARIABLE} external variable # from external resource | ||
|
||
*** Keywords *** | ||
keyword1 | ||
[Arguments] ${a} | ||
log ${a} | ||
|
||
keyword2 | ||
[Arguments] ${a} | ||
log ${a} | ||
Log To Console This is the argument \${a} = ${a} ! | ||
|
||
keyword3 | ||
keyword1 Called from external_resource | ||
res02.keyword1 Called from external_resource # Kw from res2 with a space in calling |