Skip to content
anym0us edited this page Jan 19, 2015 · 8 revisions

I. Create new Maven project

  1. Define 'pom.xml' file

An example is here.
Note: 'InsertValueHere' text should be replaced with company or project specific values.


  1. Define Spring context

An example is here.
Note: 'InsertValueHere' text should be replaced with company or project specific values.


  1. Create property files in 'resources' directory

Examples:
store.properties (store main URL, HTTP and HTTPS ports)
pages.properties (store page URLs and titles)
jbehave.properties (browser name, number of threads, metafilters and mandatory jbehave settings)
browser.properties (proxy & loading timeout settings)
log4j.properties (logging level & main log patterns)
mobile.properties (mobile apps data)


  1. Develop tests using BDD approach

a) Write test stories (in Given-When-Then style, find detailed syntax & examples here).
b) Describe pages (in new classes that extend AbstractPage, then add these classes to Spring context, add URL & titles to pages.properties file).
c) Develop implementation of project-specific steps (common steps should be re-used from CommonPageSteps class).


II. Run tests

• Desktop browser

Common tests execution parameters are as follows:

-Dthreads=1 -Dsuite.all=**/*Suite.java -Dsuite.list=SmokeWebSuite clean test -P runTests

Where
–Dthreads : Number of threads used to execute tests
–Dsuite.all : template for all suites to be included in execution (empty value is not allowed; * wildcard can be used)
–Dsuite.list : specific suite(s) from template that should be executed (can be empty or not specified – then all suites matching suite.all will be executed)
–Dstory.list : specific stories belonging the suites that should be executed (can be empty or not specified – then all stories in suite(s) will be executed)


• Mobile browser & mobile apps

Note: Please make sure you've installed mobile prerequisites first.

Common tests execution parameters are as follows:

-Dmobile=android_app -Ddevice=true -Dsuite.all=**/*Suite.java -Dsuite.list=AndroidAppSuite clean test -P runTests

Where
–Dmobile : mobile platform and type of application to test.
Possible values: android_app, android_browser, ios_app, ios_safari.
–Ddevice : if true real device is used, if false or not specified an emulator is used.
–Dsuite.all, –Dsuite.list, –Dstory.list : see above.