Add RobotFramework integration and some RobotFramework tests
This commit is contained in:
parent
4a7b163d2c
commit
d1a3249af4
|
@ -3,9 +3,18 @@ extends =
|
||||||
base.cfg
|
base.cfg
|
||||||
parts +=
|
parts +=
|
||||||
omelette
|
omelette
|
||||||
|
robot
|
||||||
eggs +=
|
eggs +=
|
||||||
ipdb
|
ipdb
|
||||||
|
|
||||||
[omelette]
|
[omelette]
|
||||||
recipe = collective.recipe.omelette
|
recipe = collective.recipe.omelette
|
||||||
eggs = ${test:eggs}
|
eggs = ${test:eggs}
|
||||||
|
|
||||||
|
[robot]
|
||||||
|
recipe = zc.recipe.egg
|
||||||
|
eggs =
|
||||||
|
collective.contact.core
|
||||||
|
ecreall.helpers.testing
|
||||||
|
Pillow
|
||||||
|
plone.app.robotframework[ride,reload]
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -61,6 +61,7 @@ setup(name='collective.contact.core',
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
'test': ['plone.app.testing',
|
'test': ['plone.app.testing',
|
||||||
|
'plone.app.robotframework',
|
||||||
'ecreall.helpers.testing',
|
'ecreall.helpers.testing',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,6 +4,10 @@ from plone.app.testing import PloneWithPackageLayer
|
||||||
from plone.app.testing import IntegrationTesting
|
from plone.app.testing import IntegrationTesting
|
||||||
from plone.app.testing import FunctionalTesting
|
from plone.app.testing import FunctionalTesting
|
||||||
|
|
||||||
|
from plone.app.robotframework.testing import AUTOLOGIN_LIBRARY_FIXTURE
|
||||||
|
|
||||||
|
from plone.testing import z2
|
||||||
|
|
||||||
import collective.contact.core
|
import collective.contact.core
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,3 +32,9 @@ INTEGRATION = IntegrationTesting(
|
||||||
FUNCTIONAL = FunctionalTesting(
|
FUNCTIONAL = FunctionalTesting(
|
||||||
bases=(COLLECTIVE_CONTACT_CORE, ),
|
bases=(COLLECTIVE_CONTACT_CORE, ),
|
||||||
name="FUNCTIONAL")
|
name="FUNCTIONAL")
|
||||||
|
|
||||||
|
ACCEPTANCE = FunctionalTesting(
|
||||||
|
bases=(COLLECTIVE_CONTACT_CORE,
|
||||||
|
AUTOLOGIN_LIBRARY_FIXTURE,
|
||||||
|
z2.ZSERVER_FIXTURE),
|
||||||
|
name="ACCEPTANCE")
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
*** Settings ***
|
||||||
|
Test Setup Open test browser
|
||||||
|
Test Teardown Close all browsers
|
||||||
|
Resource plone/app/robotframework/keywords.robot
|
||||||
|
|
||||||
|
*** Keywords ***
|
||||||
|
Go to directory
|
||||||
|
Go to ${PLONE_URL}/mydirectory
|
||||||
|
|
||||||
|
*** Test cases ***
|
||||||
|
Directory is available
|
||||||
|
Log in as site owner
|
||||||
|
Click link css=#portaltab-mydirectory a
|
||||||
|
Element should contain css=#content h1 Military directory
|
||||||
|
|
||||||
|
Create a new organization
|
||||||
|
Log in as site owner
|
||||||
|
Go to directory
|
||||||
|
Open Add New Menu
|
||||||
|
Click link css=#plone-contentmenu-factories a#organization
|
||||||
|
Wait Until Page Contains Element css=#form-widgets-IBasic-title
|
||||||
|
Input Text css=#form-widgets-IBasic-title Squadron five
|
||||||
|
Click Button Save
|
||||||
|
Page should contain Squadron five
|
||||||
|
Go to directory
|
||||||
|
Element should contain organizations Squadron five
|
|
@ -0,0 +1,24 @@
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
import robotsuite
|
||||||
|
from plone.testing import layered
|
||||||
|
|
||||||
|
from ..testing import ACCEPTANCE
|
||||||
|
|
||||||
|
|
||||||
|
def test_suite():
|
||||||
|
suite = unittest.TestSuite()
|
||||||
|
current_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
robot_dir = os.path.join(current_dir, 'robot')
|
||||||
|
robot_tests = [
|
||||||
|
os.path.join('robot', doc) for doc in os.listdir(robot_dir)
|
||||||
|
if doc.endswith('.robot') and doc.startswith('test_')
|
||||||
|
]
|
||||||
|
for test in robot_tests:
|
||||||
|
suite.addTests([
|
||||||
|
layered(
|
||||||
|
robotsuite.RobotTestSuite(test),
|
||||||
|
layer=ACCEPTANCE
|
||||||
|
),
|
||||||
|
])
|
||||||
|
return suite
|
Reference in New Issue