Skip to content

Commit

Permalink
Add the test working in Selenium Grid for robotframework
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Sanchez committed Oct 3, 2017
1 parent b4760f3 commit fdde735
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This allows to play back the testcases recorded with https://github.com/brain-te
```bash
pip install robotframework
pip install robotframework-selenium2library
pip install robotframework-ExtendedSelenium2Library
git clone https://github.com/brain-tec/odoo-robot-framework.git
```

Expand Down
3 changes: 3 additions & 0 deletions connection_erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
except:
logger.warning("Please install sudo pip install -U erppeek")

#Decorator to convert the arguments from Robot Framework into UTF-8, as far as they are often Unicode
def to_utf8(f):
def converter(*args, **kwargs):
arguments = map(lambda x: x.encode('utf-8'), args)
return f(*arguments, **kwargs)
return converter

#Depending on the date format, it returns the Day
def return_day (date):
date_str=str (date)
if date_str.find('.')>=0:
Expand All @@ -34,6 +36,7 @@ def return_day (date):
day = days[1]
return int(day)


@to_utf8
def create_new_db(server, password, name, demo = False, user_password='admin', lang='de_DE'):
connection = erppeek.Client(server)
Expand Down
2 changes: 1 addition & 1 deletion odoo_10_0.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation Common keywords for OpenERP tests
... versions of the application. The correct SUT specific resource
... is imported based on ${SUT} variable. SeleniumLibrary is also
... imported here so that no other file needs to import it.
Library Selenium2Library
Library ExtendedSelenium2Library
Library String
Library connection_erp.py
Library Collections
Expand Down
4 changes: 2 additions & 2 deletions odoo_10_0_EE.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation Common keywords for OpenERP tests
... versions of the application. The correct SUT specific resource
... is imported based on ${SUT} variable. SeleniumLibrary is also
... imported here so that no other file needs to import it.
Library Selenium2Library
Library ExtendedSelenium2Library
Library String
Library connection_erp.py
Library Collections
Expand Down Expand Up @@ -178,7 +178,7 @@ Many2OneSelect [Arguments] ${model} ${field} ${value}

Many2OneSelectWizard [Arguments] ${model} ${field} ${value}
SelectNotebook xpath=//input[@data-bt-testing-model_name='${model}' and @data-bt-testing-name='${field}']
Input Text xpath=//input[@data-bt-testing-model_name='${model}' and @data-bt-testing-name='${field}'] ${value}
Input Text xpath=//div[contains(@div,modal)]//input[@data-bt-testing-model_name='${model}' and @data-bt-testing-name='${field}'] ${value}
Click Link xpath=//ul[contains(@class,'ui-autocomplete') and not(contains(@style,'display: none'))]/li[1]/a
ElementPostCheck

Expand Down
2 changes: 1 addition & 1 deletion odoo_8_0.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation Common keywords for OpenERP tests
... versions of the application. The correct SUT specific resource
... is imported based on ${SUT} variable. SeleniumLibrary is also
... imported here so that no other file needs to import it.
Library Selenium2Library
Library ExtendedSelenium2Library
Library String
Variables ${CONFIG}
Library XvfbRobot
Expand Down
4 changes: 2 additions & 2 deletions odoo_9_0_EE.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation Common keywords for OpenERP tests
... versions of the application. The correct SUT specific resource
... is imported based on ${SUT} variable. SeleniumLibrary is also
... imported here so that no other file needs to import it.
Library Selenium2Library
Library ExtendedSelenium2Library
Library String
Library connection_erp.py
Library Collections
Expand Down Expand Up @@ -33,7 +33,7 @@ sidebaraction [Arguments] ${action}
Click Element //div[@class='o_cp_left']/div[2]/div/div[2]/ul//a[normalize-space(.)='${action}']

# checked: 9.0 ok
Login [Arguments] ${user}=${ODOO_USER} ${password}=${ODOO_PASSWORD} ${db}=${ODOO_DB}
Login [Arguments] ${user}=${USER} ${password}=${PASSWORD} ${db}=${ODOO_DB}
Open Browser ${ODOO URL} browser=${BROWSER}
Maximize Browser Window
Go To ${ODOO URL}
Expand Down

0 comments on commit fdde735

Please sign in to comment.