diff --git a/documentation/reference/en-US/bookinfo.xml b/documentation/reference/en-US/bookinfo.xml
new file mode 100644
index 00000000..4d60ef1a
--- /dev/null
+++ b/documentation/reference/en-US/bookinfo.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ Demoiselle Behave Guide
+ Demoiselle Behave
+
+ Demoiselle Behave Guide
+ Demoiselle Behave Guide
+
+
+
diff --git a/documentation/reference/en-US/colaboracao.xml b/documentation/reference/en-US/colaboracao.xml
new file mode 100644
index 00000000..03691f3f
--- /dev/null
+++ b/documentation/reference/en-US/colaboracao.xml
@@ -0,0 +1,24 @@
+
+
+
+
+ Contribution
+
+ This chapter presents some guidelines to project
+ contributors, as conventions and code standards.
+
+
+ Encoding Templates
+
+ Encoding templates help to keep code writing standards
+ among project contributors. A standard helps to
+ read and understand implementations, mainly when there is
+ comparison between code version into pull requests.
+
+
+ Follow is presented encoding template for Eclipse IDE:
+ Download.
+
+
+
diff --git a/documentation/reference/en-US/configuracao.xml b/documentation/reference/en-US/configuracao.xml
new file mode 100644
index 00000000..10318f21
--- /dev/null
+++ b/documentation/reference/en-US/configuracao.xml
@@ -0,0 +1,359 @@
+
+
+
+
+ Behave Configurations
+
+ Every module of Demoseille Behave has specific
+ configurations (Parsers, Runners and Integrations). Most of them have
+ a default value that can be changed into project.
+
+
+
+ It is possible also to change these configurations using
+ parameter -D for calling Java virtual machine.
+ For example:
+ -Dbehave.integration.alm.enabled=true
+
+
+
+ Parser Configurations
+
+
+
+ behave.parser.language:
+ property that selects language used by
+ parser. Default is pt.
+
+
+ behave.parser.identification.scenario.pattern:
+
+ property that defines regular expression that identify
+ beginning of scenario into story file. Default is
+ ^(\\s)*(CEN\u00C1RIO|Cen\u00E1rio|cen\u00E1rio)\:(.*)
+
+
+
+ behave.parser.story.timeout:
+
+ Define maximum time in minutes for running stories.
+
+
+ behave.parser.prefixes.bdd.pattern:
+
+ property that defines regular expression that identify a
+ beggining of each step into story file. Default is
+ ^(\\s)*(DADO |QUANDO |ENT\u00C3O |E |MAS |Dado |Quando
+ |Ent\u00E3o |Mas |dado |quando |ent\u00E3o |e |mas)(.*)
+
+
+
+ behave.parser.story.extension.original:
+
+ property that defines extension of former file that will be read
+ default is
+ bdd
+ into core, but for JBehave default is
+ story.
+
+
+ behave.parser.story.extension.converted:
+ property that defines extension of file generated after pre-processing of framework.
+ Default is story
+ into core, but for JBehave default is storyConverted.
+
+
+ behave.parser.commonssteps.enabled:
+
+ property that enables common steps used by
+ parsers. Default is ativado.
+
+
+ behave.parser.beforeaftersteps.enabled:
+
+ property that enables previous and next steps of
+ stories running. For runner WebDriver it take the
+ browser by these steps. Default is ativado.
+
+
+ behave.parser.delayBetweenSteps:
+ property that define a waiting for each step running. Value 0 (Zero) means that it is disabled.
+ Default is 0 (Zero).
+
+
+
+
+
+ Runner Configurations
+
+
+
+ behave.runner.screen.maxWait
+ : Maximum time for waiting a action in screen. Default value is
+ 10000 miliseconds.
+
+
+ behave.runner.screen.minWait
+ : Maximum time for waiting between screen actions, however this property is used only when framework needs to try more than once to find and execute a action for an element.
+ Default value is
+ 100 miliseconds
+ .
+
+
+ behave.runner.proxy.url
+ : property that, when given, will enable use of proxy for browser.
+ Proxy url default value is void.
+
+
+ behave.runner.screen.type
+ : Options of
+ WebDriver: MozillaFirefox, InternetExplorer,
+ GoogleChrome. For
+ IE and Chrome are needed additional
+ configurations.
+ Default value is
+ MozillaFirefox
+ .
+
+
+ behave.runner.screen.remote.name
+ : For remote tests, this property defines
+ which browser will be
+ used. Default value is void.
+
+
+ behave.runner.screen.remote.url
+ : For remote tests, this property defines
+ URL where Selenium Server is available.
+ Default value is void.
+
+
+ behave.runner.screen.driverPath
+ : Location of driver that connects
+ browser and
+ webdriver. Default value is void.
+
+
+ behave.runner.profile.enabled
+ : property that enables or disables use of
+ profile for browser. Default value is disabled.
+
+
+ behave.runner.screen.profilePath
+ : Location of profile. Default value is
+ void
+ .
+
+
+ behave.runner.app.mainClass
+ : Main class qualified domain name of
+ application under tests. Default value is void.
+
+
+ behave.runner.proxy.enabled
+ : enables use of proxy for runner (Browser).
+ Default value is disabled.
+
+
+ behave.runner.proxy.url
+ : Proxy URL to be used when Proxy option is enabled.
+ Default value is void.
+
+
+ behave.runner.screen.binaryPath
+ : location of browser binary when it is desireable to use a specific version (e.g: //home//USER//firefox//firefox-bin).
+ Default value is disabled.
+
+
+ behave.runner.catchUIException
+ : exceptions to be catched case it occurs a generic error (StaleElementReferenceException). Default value is
+ org.openqa.selenium.StaleElementReferenceException.
+
+
+ behave.runner.window.maximize.enabled
+ : enables maximized use of browser window. Default value is false.
+
+
+ behave.runner.screen.screenshot.zoomout
+ : levels of zoom out that framework will make before to catch screen. Default value is 0.
+
+
+ behave.runner.legacyRunner
+ : Enables or disables legacy running mode for backcompatibility. Default value is true.
+
+
+
+
+
+ Integration Configurations
+
+
+
+ behave.integration.alm.enabled
+ : property that enables/disables feature of
+ ALM integration.
+ Default value is
+ disabled
+ .
+
+
+ behave.integration.alm.url.security
+ : Required field for ALM integration. Complete
+ address of
+ ALM authentication path.
+ Default value is
+ void
+ .
+
+
+ behave.integration.alm.url.services
+ : Required field for ALM integration. Complete
+ address of
+ REST services path.
+ Default value is
+ void
+ .
+
+
+ behave.integration.alm.projectArea
+ : Required field
+ for ALM integration. Alias of
+ project area.
+ Take carefully
+ renamed areas, because Alias is
+ not
+ changed,
+ Default value is
+ void
+ .
+
+
+ behave.integration.alm.testPlanId
+ : Campo obrigatório
+ para integração com a ALM. Id do
+ plano de testes
+ que pertence a área de
+ projeto.
+ O valor padrão é
+ void
+ .
+
+
+ behave.integration.authenticator.host
+ : Address (IP) of Authenticator.
+ Default value is
+ localhost
+ .
+
+
+ behave.integration.authenticator.port
+ : Used
+ port for Authenticator communication.
+ Default value
+ is
+ 9990
+ .
+
+
+ behave.integration.alm.autoAssociateTestCaseInPlan
+ : property that enables/disables automatic association of Test Cases to RQM Test Plan.
+ Default value
+ is
+ true
+ .
+
+
+ behave.integration.alm.categoryTipoExecucao
+ : property of given value for "Running Type" when a Test Case is sent to ALM.
+ Default value
+ is
+ Automatizado
+ .
+
+
+
+
+
+
+ Integration Configurations - ALM Authenticator
+
+
+
+ Authenticator is needed for correct working of ALM
+ integration
+ , that is not possible
+ without that
+ component.
+ Case Authenticator is not available the following
+ message will be
+ showed into throwed exception:
+ br.gov.frameworkdemoiselle.behave.exception.BehaveException:
+ Not accessible authenticator. Check if process was started
+
+
+
+
+ Installation into Project
+
+ For using integration module it is enough to add a
+ dependency into project pom.xml.
+
+ br.gov.frameworkdemoiselle.component.behave
+ demoiselle-behave-integration-alm
+ 1.x.x
+ test
+]]>
+
+
+
+ Motivations
+
+
+
+ All RQM Rest calls need valid username and
+ password
+ for Jazz platform.
+
+
+ For security we don't recommend to store
+ these information.
+
+
+ Component “demoiselle-behave-integration-alm” provides
+ a secure way
+ of storing tester username and password.
+
+
+ Storing is done into memory using
+ chriptografy
+ and can be accessed only through local workstation
+ of tester
+ along tests running.
+
+
+
+
+
+ Use
+
+
+
+ For starting service, get authenticator
+ demoiselle-behave-integration-alm-1.5.0.jar
+ and run it by following command:
+ java -jar demoiselle-behave-integration-alm-[versao].java
+
+
+ Parameters:
+
+ -p [port] -o [origin-ip]
+
+
+
+
+
+
+
diff --git a/documentation/reference/en-US/configuracaotestes.xml b/documentation/reference/en-US/configuracaotestes.xml
new file mode 100644
index 00000000..ab6fcf41
--- /dev/null
+++ b/documentation/reference/en-US/configuracaotestes.xml
@@ -0,0 +1,87 @@
+
+
+
+
+ Tests Configurations
+
+ Steps Configuration
+
+ Package configuration for loading of Step subclasses, including a filter
+ for classes that must be apart from this scanning;
+
+ When a context is initialized, you don't need to instance
+ each one of Step subclasses to be used:
+
+ context = BehaveContext.getInstance();
+context.addSteps(new FirstSteps());
+context.addSteps(new SecondSteps());
+context.addSteps(new ThirdSteps());
+context.addSteps(new FourthSteps());
+
+ It is enough to do:
+
+ context.setStepsPackage("package.where.are.subclasses.of.inferface.step");
+
+ Also it is possible to use a second parameter for filtering classes that must not be instanced, by a regular expression:
+
+ context.setStepsPackage("package.where.are.subclasses.of.inferface.step", "((First)|(Third))");
+
+ Or, additionally, by listing of classes:
+
+ context.setStepsPackage("package.where.are.subclasses.of.inferface.step", FirstSteps.class, ThirdSteps.class);
+
+
+
+ Stories and Scenarios Configuration
+
+ Filter of stories/scenarios to be run, allowing that a developer focus only a story or scenario;
+
+ Given stories:
+
+ !-- /stories/primeira.story
+Feature: First
+
+Scenario: First of first
+Given context
+When event
+Then result
+
+Scenario: Second of first
+Given context
+When event
+Then result
+
+ !-- /stories/segunda.story
+Feature: Second
+
+Scenario: First of second
+Given context
+When event
+Then result
+
+Scenario: Second of second
+Given context
+When event
+Then result
+
+When running stories/scenarios:
+
+context.run("/stories");
+
+Now it is possible to filter which stories:
+
+context.run("/stories", Filter.story("First"));
+
+Or, which scenarios:
+
+context.run("/stories", Filter.scenario("Second of second"));
+
+remembering that last can be informed using only regular expression:
+
+context.run("/stories", "Second of second");
+
+
+
+
+
diff --git a/documentation/reference/en-US/dados.xml b/documentation/reference/en-US/dados.xml
new file mode 100644
index 00000000..8efc45e6
--- /dev/null
+++ b/documentation/reference/en-US/dados.xml
@@ -0,0 +1,100 @@
+
+
+
+
+ Data Set
+
+ Concept
+
+ This chapter presents feature of Dataset
+ , that allows creation of big data sets in
+ XML format for using into stories. Test sample
+ used aims to register some works into a catalog,
+ so it is needed to inform several data.
+
+
+
+ Creation of Data XML
+
+ First step for using Dataset is creating
+ a XML containing data that will be used by stories. Its structure must be A estrutura deve
+ like sample below, related to file obras.xml:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+ Data Provider Configuration
+
+ For using XML data file it is needed to give its name before running test according to
+ sample below, related to file ObrasTest.java.
+
+ public class ObrasTest {
+ private BehaveContext eng = BehaveContext.getInstance();
+ private static DatasetProvider datasetProvider = (DatasetProvider) InjectionManager.getInstance().getInstanceDependecy(DatasetProvider.class);
+
+ public ObrasTest() {
+ datasetProvider.load("obras","/datasets/obras.xml");
+ }
+
+ @Test
+ public void testAllObras() throws Throwable {
+ eng.addStories("/stories/obra.story");
+ eng.run();
+ }
+}
+
+
+ Creation of Story
+
+ In the story creation (obra.story) were added two scenarios, one
+ for reuse receiving work parameter, and other that call two times
+ reuse scenario, with different parameters. Below it is story
+ that will be used two times.
+
+ Scenario: add work "{obra}"
+
+Given I am on "Tela Principal"
+Then I go to screen "Lista de Obras"
+When I click on "Adicionar Obra"
+Then will be displayed "Cadastro"
+When I select "{obra}" from dataset "obras"
+When I give value of field "Nome Obra"
+When I give value of field "Valor"
+When I give value of field "Prazo"
+When I click on "Inserir"
+
+ It is important to see that step When I select "{obra}" from dataset "obras"
+ select record previously created in XML file, that is used by 3 following steps.
+
+
+ Reuse scenario created in sample above is called two times in sample below. It is
+ important to quote that it is called using two differentData Records, first
+ "Olympic Partk" and after "Olympic Village".
+
+ Scenario: Insertion of works stored into dataset
+
+Given I accessed system
+When I nsert work "Olympic Park"
+Then it will be displayed "Nome Obra"
+When I insert work "Olympic Village"
+Then it will be displayed "Nome Obra"
+
+
diff --git a/documentation/reference/en-US/desktop.xml b/documentation/reference/en-US/desktop.xml
new file mode 100644
index 00000000..89f11949
--- /dev/null
+++ b/documentation/reference/en-US/desktop.xml
@@ -0,0 +1,92 @@
+
+
+
+
+ Testing Dektop applications
+
+ Demoiselle Behave Framework has a specific Runner for
+ Desktop application (Swing) tests.
+ This chapter talks about
+ this subject.
+
+
+ Starting a project using Archetype (Project Model)
+
+
+ When you create a project it is possible to select archetype
+ jbehave-fest-archetype
+ for having a fast beginning of a Desktop (Swing)
+ test automation project.
+
+
+
+ Starting a project using an existing project (Project
+ WebDriver)
+
+ For changing an existing project into a functional Desktop test project
+ it is enough to change runner and change appropriated
+ settings.
+
+ Change runner dependency.
+
+
+ br.gov.frameworkdemoiselle.component.behave
+ demoiselle-behave-runner-fest
+ 1.x.x
+ test
+]]>
+
+
+
+
+ Desktop Configurations
+
+ All already quoted settings that are related to
+ Desktop can be used too. Below are specific
+ settings for Desktop:
+
+
+
+ Add project into
+ classpath
+ of tests project;
+
+
+ Add setting
+ behave.runner.app.mainClass
+ into properties with name of class that starts Desktop
+ project.
+
+
+
+
+
+
+ Mappings
+
+ Desktop runner uses 3 types of locators, according list below:
+
+
+
+ Label: Select screen object that has visible text;
+
+
+ Name: Select screen object that has user selected identifier;
+
+
+ ClassName: Select screen object that has defined class (JPanel, JButton...).
+
+
+
+ Additionally to these locators it is possible to select the index that object is using, such as annotation @ElementIndex, in following sample:
+
+ @ElementMap(name = "Nome do Elemento na História", locatorType = ElementLocatorType.ClassName, locator = "JTextField")
+@ElementIndex(index = 1)
+private TextField atributo;
+
+ By default object index is 0 (Zero).
+
+
+
+
diff --git a/documentation/reference/en-US/docs/formatter-profile-demoiselle-behave.xml b/documentation/reference/en-US/docs/formatter-profile-demoiselle-behave.xml
new file mode 100644
index 00000000..b4c54c41
--- /dev/null
+++ b/documentation/reference/en-US/docs/formatter-profile-demoiselle-behave.xml
@@ -0,0 +1,291 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/reference/en-US/escopos.xml b/documentation/reference/en-US/escopos.xml
new file mode 100644
index 00000000..a77b407c
--- /dev/null
+++ b/documentation/reference/en-US/escopos.xml
@@ -0,0 +1,106 @@
+
+
+
+
+ Scope and Steps Stories
+
+ This chapter details how Dbehave formerly deal with stories that compose a scenario and how they will be handled from new version.
+
+
+
+ DBehave Legacy
+
+ When we work with framework, we deal with 3 items, the following:
+
+
+ Stories - context.addStories();
+
+
+ Reuse stories - context.addStoriesReuse();
+
+
+ Custom steps - context.addSteps().
+
+
+
+
+ When we executed only one method from a class there was no problem, however when we executed a class set at same time, DBehave had a different behavior for each one of listed items.
+
+
+ Stories - They were stored into memory during all tests set running;
+
+
+ Reuse stories - They were removed after each method running;
+
+
+ Custom steps - They were removed after each method running.
+
+
+
+
+ This behavior caused a problem for tests design. When we executed several test classes, we always had redefine steps and reuses for each method, however we could not redefine stories.
+
+
+ Storing all stories into memory also is not a good solution from computational point of view, because the trend is that framework gets overloaded with extensive tests.
+
+
+ Another important point that meres to be highlighted is that JUnit running is random, it means that for each class set running one of them is choosen and this randomness reaches methods.
+
+
+ As framework stored stories into memory, when we programmed each test method, for they are properly encapsulated, we had to define all stories composed by each one. However as story already was previously added, framework had a .story duplicity error.
+
+
+ So or we define that a tests set always would run as a set or one by one, because erratic behavior of tool didn't allow a good project design.
+
+
+
+
+ Scope Support DBehave
+
+ For soliving problem presented in last topic, we define a scope set for each one of elements, allowing so that developer defines his better way of working.
+
+
+ Global - All that is added to global scope are stored into memory during all tool running;
+
+
+ Classes - What is added to classes scope are stored into memory during all Java class running;
+
+
+ Method - Elements from this scope are stored only during Java class method running.
+
+
+
+
+
+ For keeping backcompatibility with previous projects, new version of DBehave comes automatically prepared for Legacy mode.
+
+
+
+ It is necessary to change in behave.properties setting behave.runner.legacyRunner=true to false. So, we enable tool to work with new way of scopes.
+
+
+
+ A nova API para cada elemento segue:
+
+
+ Global - context.addStepsGlobal(), context.addStoriesGlobal(), context.addStoriesReuseGlobal();
+
+
+ Classes - context.addStepsClass(), context.addStoriesClass(), context.addStoriesReuseClass();
+
+
+ Método - context.addStepsMethod(), context.addStoriesMethod(), context.addStoriesReuseMethod().
+
+
+
+
+
+ Remembering that running modes of tool are exclusives, when you use new version, commands context.addSteps(),context.addStories() and context.addStoriesReuse() are not allowed. Same occurs when you use legacy and new API.
+
+
+
+ Important: when you use classes scope, your class must mandatorily extend class ClassScopeManager. Else, framework presents an error showing obligatoriness of that.
+
+
+
diff --git a/documentation/reference/en-US/execucao.xml b/documentation/reference/en-US/execucao.xml
new file mode 100644
index 00000000..7c7b4c96
--- /dev/null
+++ b/documentation/reference/en-US/execucao.xml
@@ -0,0 +1,381 @@
+
+
+
+
+ Tests Running
+
+ This chapter presents advanced resources for tests
+ running using Demoiselle Behave, that
+ can help to build an
+ environment to run functional tests.
+
+
+
+ Running with Ghost Driver (Experimental Feature)
+ Ghost Driver is a remote WebDriver that uses PhantomJS as back-end. It is a JavaScript implementation of WebDriver Protocol for PhantomJS
+ aimed to run headless tests in Selenium.
+ For enabling it set driver GhostDriver in dbehave properties (behave.properties):
+ behave.runner.screen.type=GhostDriver
+ Also it is needed to set PhantmJS binary location in property behave.runner.screen.driverPath:
+ behave.runner.screen.driverPath=/usr/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs
+ Other possible way is:
+ behave.runner.screen.driverPath=/usr/local/bin/phantomjs
+
+ Phantomjs can be installed by command sudo npm install -g phantomjs.
+
+
+
+
+ Parallel Running
+
+ Parallel tests running can be an alternative
+ to reduce
+ batteries running time. For this case observe that
+ this approach
+ rises up
+ need for processing in tests starting
+ machine. Moreover it is need
+ to ensure independence among
+ tests for avoiding false positives.
+
+
+ Demoiselle Behave suggests use of maven-surefire-plugin that
+ manages test running according to following parameters:
+
+
+
+ forkCount
+ : Determine maximum number of threads that must be
+ parallelized;
+
+
+ threadCount
+ : Maximum number of threads by jvm;
+
+
+ reuseForks=false
+ : Ensure threads running in isolated JVMs.
+ This configuration
+ avoids that data used by other thread be
+ affected by third threads.
+
+
+ parallel=classes
+ : Define parallelization strategy. For this case,
+ each JUnit test class
+ is instanced by a thread until
+ reaching maximum number
+ of threads (forkCount).
+ It is recommended to use
+ class level,
+ because if there is need for
+ dependency among
+ tests,
+ this can be realized inside JUnit class.
+
+
+
+ Below is a sample for plugin configuration in project file
+ pom.xml:
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.16</version>
+ <configuration>
+ <forkCount>3</forkCount>
+ <threadCount>1</threadCount>
+ <reuseForks>false</reuseForks>
+ <parallel>classes</parallel>
+ </configuration>
+ </plugin>
+ </plugins>
+</build>
+
+ For running your test in parallel way click on menu “Run as →
+ Maven
+ Test”
+ of Eclipse or type “mvn test” in console.
+
+
+
+
+ Background Mode
+
+ Running test in background mode is a important resource
+ when you want to create an environment
+ dedicated to test running.
+ Commonly these environments don't have
+ graphical interface that
+ prevent
+ to call browsers.
+
+
+ Other common situation occurs when tester runs
+ tests in his workstation and
+ need to use other
+ programs that compete for his screen, because of
+ browsers
+ use.
+
+
+ For Linux environments, that have tools for screen emulating,
+ Demoiselle Behave suggests
+ to use tool Xvfb.
+
+
+ Installation:
+
+
+ apt-get install xvfb
+
+
+ Running Xvfb:
+
+
+ Xvfb :2 -screen 0 1024x768x24
+
+
+ It is possible to instance several processes Xvfb using
+ different identifiers.
+ Sample above defined a
+ identifier “2”.
+
+
+
+ For running an app that uses graphical interface
+ execute command DISPLAY:
+
+
+ DISPLAY=:2 firefox
+
+
+ For running a test in Xvfb, it is enough to run:
+
+
+ DISPLAY=:2 mvn test
+
+
+ For viewing processes running in Xvfb use x11vnc (apt-get
+ install x11vnc)
+ that instance service vnc for a specific Xvfb
+ identifier:
+
+ x11vnc -display :2
+
+
+
+ Continuous Integration
+
+ For running functional tests in background mode, under a
+ continuous integration environment is necessary to install plugins that
+ allow to manage
+ Xvfb. Jenkins has
+ plugin:
+ https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin
+
+ that allows to realize this control.
+
+
+
+
+
+
+
+
+
+
+ Xvfb Plugin
+
+
+
+
+ After installing plugin configure it by menu “Manage
+ Jenkins → Configure system” in section
+ Xvfb installation, provide a
+ “default” name and folder where Xvfb executable was installed
+ “/usr/bin”.
+
+
+
+
+
+
+
+
+
+
+ System Configuration
+
+
+
+
+ For each Jenkins project configure in section “Build
+ Environment”
+ installation, timeout, screen dimensions and
+ display:
+
+
+
+
+
+
+
+
+
+
+ Project Configuration
+
+
+
+
+ When you run your project, Jenkins starts Xvfb before
+ build
+ and ends process when build is finished:
+
+
+
+
+
+
+
+
+
+
+ Console
+
+
+
+
+
+
+
+ Remote Tests
+
+ Remote tests running, when a browser runs in a workstation that is not
+ the source of tests, is done by Selenium Server. This script
+ helps to create quickly this environment.
+
+
+
+ Selenium Server Installation
+
+
+ Download: Get Selenium Server from
+ http://code.google.com/p/selenium/
+ or direct from DBehave download area selenium-server-standalone-2.37.0.jar.
+ We suggests version 2.37.0 or higher.
+
+
+ Start Service: Run Selenium Server in workstation where browser will run:
+ java -jar selenium-server-standalone-2.37.0.jar
+
+
+
+
+ Project Configuration
+
+
+ demoiselle.properties: Open file demoiselle.properties in your project
+ and configure following properties:
+
+//Change driver to remove mode
+behave.runner.screen.type=RemoteWeb
+
+//Define browser. Available options: firefox, chrome, internetExplorer, safari, htmlUnit
+behave.runner.screen.remote.name=firefox
+
+//Define url where is Selenium Server
+behave.runner.screen.remote.url=http://127.0.0.1:4444/wd/hub
+
+
+
+ Browsers: Case is necessary to run your test in browser that is not Firefox, after
+ configure property “behave.runner.screen.remote.name”, start Selenium Server
+ passing way of your browser specific driver:
+ java -jar selenium-server-standalone-2.37.0.jar -Dwebdriver.chrome.driver=/path/chromedriver
+
+
+
+
+
+
+ JBehave Reports
+
+ At end of automated tests running reports are
+ generated into folder target/jbehave/view.
+ Main file is index.html, that can be open with any
+ browser. When you open file, you must click on "Story Reports" for accessing
+ running report.
+
+
+
+
+
+
+
+ General Running Report
+
+
+
+
+ For acessing details of each story there is a link
+ in last column (view), at right of table, as image below shows:
+
+
+
+
+
+
+
+ Story details link
+
+
+
+
+ After click on link "html" of general view screen, following screen will be displayed:
+
+
+
+
+
+
+
+ Story detailing
+
+
+
+
+ Screen above shows detailing of scenarios of story.
+
+
+
+
+
+
+
+ Scenario with Error (Desktop)
+
+
+
+
+ Case some error occurs, this will be displayed with a print screen (Desktop and Web).
+
+
+
+
diff --git a/documentation/reference/en-US/historia.xml b/documentation/reference/en-US/historia.xml
new file mode 100644
index 00000000..70267544
--- /dev/null
+++ b/documentation/reference/en-US/historia.xml
@@ -0,0 +1,368 @@
+
+
+
+
+ How to create a story
+
+ This chapter describes words, phrases and rules to
+ create and reuse test scenarios runnable by Behave framework.
+
+
+
+ Concept
+
+ In BDD, there is three keywords:
+
+
+ Given
+
+
+ When
+
+
+ Then
+
+
+
+
+ Behave framework extends default vocabulary of BDD,
+ adding
+ new words:
+
+
+ A
+
+
+ But
+
+
+
+
+ A scenario is a set of phrases that use same
+ keywords
+ described above for describing an expected
+ system
+ behavior.
+
+ Given I am in login screen system
+When I type user "demoiselle" and password "behave"
+And click on button "Entrar"
+Then will be displayed welcome page
+
+ A story is a set of scenarios that describe a
+ feature of system, or a part of it.
+
+
+
+
+ Pre-defined phrases of framework
+
+ Behave framework was built to reduce spent effort
+ to
+ define several test scenarios of a system. Some
+ phrases
+ are embbeded into framework to make easier test
+ classes
+ mapping. They are:
+
+ [Given | When | Then] I go to screen "<screen title>"
+
+ [Given | When | Then] I am on screen "<screen title>"
+
+ [When | Then] I click on "<element name>" related to "<parameters list>"
+
+ [When | Then] I click on "<button/link text>"
+
+ [When | Then] I select option "<option text>"
+
+ [When | Then] I select option with index "<index>" into field "<element name>"
+
+ [When | Then] I select option "<element name>" related to "<parameter list>"
+
+ [When | Then] I select option with value "<value>" into field "<element name>"
+
+ [Given | When | Then] I type "<value>" into field "<field name>"
+
+ [When] I clear value of field "<field name>"
+
+ [When] I don't type value into field "<field name>"
+
+ [Given | When] I type "<sample table>"
+
+ [When] I type fields "<sample table>"
+
+ [Then] will be displayed "<text>"
+
+ [Then] will be displayed into "<element name>" value "<value>"
+
+ [Then] will be displayed value "<text>" into "<element name>" related to "<parameters list>"
+
+ [Given | When | Then] "<element name>" is not visible
+
+ [Given | When | Then] I get "<text>" from field "<field name>"
+
+ [Given | When | Then] I type "<key>" with value "<field name>"
+
+ [When] I move mouse over "<element>"
+
+ [When] I click on table row "<table>" related to "<text>"
+
+ [Given | When | Then] I confirm dialog box
+
+ [Given | When | Then] I cancel dialog box
+
+ [Given | When | Then] I type into dialog box "<text>"
+
+ [Then] will be displayed into dialog box "<text>"
+
+ [Given | When | Then] I type a random number with prefix "<prefix text>" into field "<field name>"
+
+ [When] I type a random number into field "<field name>"
+
+ [Given | When | Then] I define variable "<variable name>" with value "<text>"
+
+ [When | Then] I print in console value of variable "<variable name>"
+
+ [When] I select "<record of data set>" of data set "data set name"
+
+ [Then] won't be displayed "<text>"
+
+ [Then] won't be displayed into "<element>" value "<text>"
+
+ [Then] won't be displayed into "<element>" value "<text>"
+
+ [Then] won't be displayed value "<text>" into "<element>" related to "<parameters list>"
+
+ [Given | When | Then] "<element>" related to "<parameters list>" is not visible
+
+ [Then] "<element>" is visible
+
+ [Then] "<element>" is disabled
+
+ [Given | When | Then] I expect element "<element>" related to "<parameters list>" is visible, clickable and enabled
+
+ [Given | When | Then] element "<element>" related to "<parameters list>" is visible and disabled
+
+
+
+ Given I am on screen "Login"
+When I type "demoiselle" into field "Usuário:"
+And type "behave" into field "Senha:"
+When I click on "Entrar"
+Then will be displayed "Seja bem vindo"
+
+
+
+ Pre-defined framework phrases for handling grids
+
+
+ [When] I store cell "<row>","<column>" of table "<table>" into "<container>
+ [When] I store column "<column>" of table "<table>" into "<container>"
+ [When] I compare text of cell "<row>","<c>" of table "<table>" with "<container>"
+ [When] I compare text of column "<column>" of table "<table>" with "<container>"
+ [When] I click on cell "<row>","<column>" of table "<table>"
+ [When] I click on column "<column>" of table "<table>"
+ [When] I choose option "<value>" in cell "<l>","<c>" of table "<table>"
+ [When] I choose option "<value>" in column "<c>" of table "<table>"
+ [When] I type text "<value>" in cell "<l>","<c>" of table "<table>"
+ [When] I type text "<value>" in column "<c>" of table "<table>"
+
+
+
+
+
+ Writing a scenario
+
+ Stories written for Behave must be into files with
+ extension ".story".
+ Each file ".story" can have several test
+ scenarios.
+ This extension can be changed modifying key value
+ "behave.parser.story.extension.converted" into file
+ behave.properties.
+ Accepted words by framework must be always
+ at start of phrases, even preceded with spaces.
+ Phrases
+ described in scenarios must be each one in a different line.
+ The
+ scenario is, by default, started with word "Cenário:", for case of
+ story is in portuguese language.
+ This word can be changed
+ modifying key value
+ "behave.parser.identification.scenario.pattern.<idioma>" in
+ file behave.properties.
+
+ Scenario: Access system with user demoiselle and password behave
+Given I am on page "Login"
+When I type "demoiselle" into field "Usuário:"
+E I type "behave" into field "Senha:"
+When click on "Entrar"
+Then will be displayed "Seja bem vindo"
+
+
+
+ Parameterizing scenarios
+
+ Parameters must be used in scenarios when data
+ used by tests are not constants. Syntax of a
+ parameter
+ is "{nome_do_parametro}".
+
+ Scenario: Access system with user "{usuario}" and password "{senha}"
+Given I am on "Login"
+When I type "{usuario}" into field "Usuário:"
+And I type "{senha}" into field "Senha:"
+When I click on "Entrar"
+Then will be displayed "Seja bem vindo"
+
+
+
+ Reusing scenarios
+
+ For reuse occurs is necessary, firstly, to use
+ parameters in scenario name. This will prevent that scenario
+ be
+ "runned" by framework, but, so, it can
+ be
+ referenced by other scenarios, reducing amount
+ of written
+ lines in all test project.
+
+ Scenario: Access system with user "{usuario}" and password "{senha}"
+Given I am on "Login"
+When I type "{usuario}" into field "Usuário:"
+And I type "{senha}" into field "Senha:"
+When I click on "Entrar"
+Then will be displayed "Seja bem vindo"
+
+Scenario: Exit from system
+Given I go to page "Tela Principal"
+When I click on "Sair"
+Then will be displayed "Usuário:"
+E will be displayed "Senha:"
+
+Scenario: Test with data "{usuario}" and password "{senha}"
+Access system with user "{usuario}" and password "{senha}"
+Exit from system
+
+
+
+ Reusing scenarios in other stories
+
+ For scenario reuse occurs in other stories is necessary, firstly,
+ that story be added to test context where it will be runned.
+
+
+BehaveContext eng = BehaveContext.getInstance();
+
+// Add stories that will be runned
+eng.addStories("/stories/acesso.story");
+eng.addStories("/stories/estou-com-sorte.story");
+eng.addStories("/stories/pesquisa-simples.story");
+
+// Run added story
+eng.run();
+
+
+ So call to scenario happens by use of intended scenario title.
+
+
+In /stories/acesso.story:
+
+Scenario: Access to "{sistema}"
+
+Given I go to screen "Tela de Busca"
+Then will be displayed "{sistema}"
+
+
+In /stories/estou-com-sorte.story:
+
+Scenario: Use of feature I am lucky
+
+Access to "Google"
+When I click on "Estou com sorte"
+Then will be displayed "Google"
+
+
+ Another possibilty would be to add a story only for reuse.
+
+
+BehaveContext eng = BehaveContext.getInstance();
+
+// Add story only for scenario reuse
+// Not reused scenarios won't be runned
+eng.addStoriesReuse("/stories/acesso.story");
+
+// Add stories that will be runned
+eng.addStories("/stories/estou-com-sorte.story");
+eng.addStories("/stories/pesquisa-simples.story");
+
+// Run added story
+eng.run();
+
+
+ So not parameterized scenarios into stories
+ passed by method "addStoriesReuse" won't be runned.
+ This doesn't happen when method "addStories" is used, because
+ it runs all not paremeterized scenarios.
+
+
+
+
+ JBehave Plugin for Eclipse
+
+ Features:
+
+
+ Syntax highlighting for steps
+
+
+ Link between steps written into stories and method inside Jave code
+
+
+ Autocomplete for steps created in Java code, includind common steps
+
+
+ Step validation, dectecting it there are not mapped steps, for example
+
+
+
+ Requirements:
+
+
+ Plugin already was tested for versions Indigo (3.7) and Juno (4.2)
+ of Eclipse.
+
+
+ Installation using Eclipse:
+
+
+
+ 1. Click on Help > Install New Software...
+
+
+ 2. Add a new site location:
+ http://jbehave.org/reference/eclipse/updates/
+
+
+ 3. Afeter add location search for plugin JBehave Eclipse and
+ follow default procedure for plugin installation
+
+
+
+ Configuration:
+
+
+ After installation access menu of Eclipse, Window > Preferences >
+ JBehave -> Project Settings and select Story Language as pt.
+
+
+ With this configuration is is possible to see stories written in
+ portuguese with syntax highlighting and autocomplete will work normally.
+
+
+
+
+
+
diff --git a/documentation/reference/en-US/images/arquetipo.png b/documentation/reference/en-US/images/arquetipo.png
new file mode 100644
index 00000000..e7f55d26
Binary files /dev/null and b/documentation/reference/en-US/images/arquetipo.png differ
diff --git a/documentation/reference/en-US/images/arquitetura.png b/documentation/reference/en-US/images/arquitetura.png
new file mode 100644
index 00000000..ae53368f
Binary files /dev/null and b/documentation/reference/en-US/images/arquitetura.png differ
diff --git a/documentation/reference/en-US/images/classeapptest.png b/documentation/reference/en-US/images/classeapptest.png
new file mode 100644
index 00000000..11649e40
Binary files /dev/null and b/documentation/reference/en-US/images/classeapptest.png differ
diff --git a/documentation/reference/en-US/images/console1.png b/documentation/reference/en-US/images/console1.png
new file mode 100644
index 00000000..4bd07948
Binary files /dev/null and b/documentation/reference/en-US/images/console1.png differ
diff --git a/documentation/reference/en-US/images/console1_ant.png b/documentation/reference/en-US/images/console1_ant.png
new file mode 100644
index 00000000..485a82ac
Binary files /dev/null and b/documentation/reference/en-US/images/console1_ant.png differ
diff --git a/documentation/reference/en-US/images/criandoprojeto1.png b/documentation/reference/en-US/images/criandoprojeto1.png
new file mode 100644
index 00000000..d82272d4
Binary files /dev/null and b/documentation/reference/en-US/images/criandoprojeto1.png differ
diff --git a/documentation/reference/en-US/images/criandoprojeto2.png b/documentation/reference/en-US/images/criandoprojeto2.png
new file mode 100644
index 00000000..f8539ee7
Binary files /dev/null and b/documentation/reference/en-US/images/criandoprojeto2.png differ
diff --git a/documentation/reference/en-US/images/criandoprojeto3.png b/documentation/reference/en-US/images/criandoprojeto3.png
new file mode 100644
index 00000000..6ee1bb5a
Binary files /dev/null and b/documentation/reference/en-US/images/criandoprojeto3.png differ
diff --git a/documentation/reference/en-US/images/diretorioprojeto1.png b/documentation/reference/en-US/images/diretorioprojeto1.png
new file mode 100644
index 00000000..aef122a2
Binary files /dev/null and b/documentation/reference/en-US/images/diretorioprojeto1.png differ
diff --git a/documentation/reference/en-US/images/executandoteste.png b/documentation/reference/en-US/images/executandoteste.png
new file mode 100644
index 00000000..6456aceb
Binary files /dev/null and b/documentation/reference/en-US/images/executandoteste.png differ
diff --git a/documentation/reference/en-US/images/firepath.png b/documentation/reference/en-US/images/firepath.png
new file mode 100644
index 00000000..fef1a921
Binary files /dev/null and b/documentation/reference/en-US/images/firepath.png differ
diff --git a/documentation/reference/en-US/images/funcionamento.png b/documentation/reference/en-US/images/funcionamento.png
new file mode 100644
index 00000000..e59ac228
Binary files /dev/null and b/documentation/reference/en-US/images/funcionamento.png differ
diff --git a/documentation/reference/en-US/images/ic-01.png b/documentation/reference/en-US/images/ic-01.png
new file mode 100644
index 00000000..a3d9ed26
Binary files /dev/null and b/documentation/reference/en-US/images/ic-01.png differ
diff --git a/documentation/reference/en-US/images/ic-02.png b/documentation/reference/en-US/images/ic-02.png
new file mode 100644
index 00000000..c669ab13
Binary files /dev/null and b/documentation/reference/en-US/images/ic-02.png differ
diff --git a/documentation/reference/en-US/images/ic-03.png b/documentation/reference/en-US/images/ic-03.png
new file mode 100644
index 00000000..7d8af189
Binary files /dev/null and b/documentation/reference/en-US/images/ic-03.png differ
diff --git a/documentation/reference/en-US/images/ic-04.png b/documentation/reference/en-US/images/ic-04.png
new file mode 100644
index 00000000..c2a9aa40
Binary files /dev/null and b/documentation/reference/en-US/images/ic-04.png differ
diff --git a/documentation/reference/en-US/images/localizadores.png b/documentation/reference/en-US/images/localizadores.png
new file mode 100644
index 00000000..27092594
Binary files /dev/null and b/documentation/reference/en-US/images/localizadores.png differ
diff --git a/documentation/reference/en-US/images/menupreference.png b/documentation/reference/en-US/images/menupreference.png
new file mode 100644
index 00000000..aee1e44d
Binary files /dev/null and b/documentation/reference/en-US/images/menupreference.png differ
diff --git a/documentation/reference/en-US/images/paginaserpro1.png b/documentation/reference/en-US/images/paginaserpro1.png
new file mode 100644
index 00000000..ca1e7105
Binary files /dev/null and b/documentation/reference/en-US/images/paginaserpro1.png differ
diff --git a/documentation/reference/en-US/images/paginaserproreduzida.png b/documentation/reference/en-US/images/paginaserproreduzida.png
new file mode 100644
index 00000000..dc1d155e
Binary files /dev/null and b/documentation/reference/en-US/images/paginaserproreduzida.png differ
diff --git a/documentation/reference/en-US/images/parser.png b/documentation/reference/en-US/images/parser.png
new file mode 100644
index 00000000..889f3007
Binary files /dev/null and b/documentation/reference/en-US/images/parser.png differ
diff --git a/documentation/reference/en-US/images/parsertamanhoreduzido.png b/documentation/reference/en-US/images/parsertamanhoreduzido.png
new file mode 100644
index 00000000..acf1feb4
Binary files /dev/null and b/documentation/reference/en-US/images/parsertamanhoreduzido.png differ
diff --git a/documentation/reference/en-US/images/preferences.png b/documentation/reference/en-US/images/preferences.png
new file mode 100644
index 00000000..8376b1b5
Binary files /dev/null and b/documentation/reference/en-US/images/preferences.png differ
diff --git a/documentation/reference/en-US/images/processo.png b/documentation/reference/en-US/images/processo.png
new file mode 100644
index 00000000..e5ed55ee
Binary files /dev/null and b/documentation/reference/en-US/images/processo.png differ
diff --git a/documentation/reference/en-US/images/projeto-relatorio-1.png b/documentation/reference/en-US/images/projeto-relatorio-1.png
new file mode 100644
index 00000000..e599edfd
Binary files /dev/null and b/documentation/reference/en-US/images/projeto-relatorio-1.png differ
diff --git a/documentation/reference/en-US/images/regression-report.png b/documentation/reference/en-US/images/regression-report.png
new file mode 100644
index 00000000..22393ddc
Binary files /dev/null and b/documentation/reference/en-US/images/regression-report.png differ
diff --git a/documentation/reference/en-US/images/relatorio-1.png b/documentation/reference/en-US/images/relatorio-1.png
new file mode 100644
index 00000000..d27ed757
Binary files /dev/null and b/documentation/reference/en-US/images/relatorio-1.png differ
diff --git a/documentation/reference/en-US/images/relatorio-2.png b/documentation/reference/en-US/images/relatorio-2.png
new file mode 100644
index 00000000..d96227f7
Binary files /dev/null and b/documentation/reference/en-US/images/relatorio-2.png differ
diff --git a/documentation/reference/en-US/images/relatorio-3.png b/documentation/reference/en-US/images/relatorio-3.png
new file mode 100644
index 00000000..aef82dc2
Binary files /dev/null and b/documentation/reference/en-US/images/relatorio-3.png differ
diff --git a/documentation/reference/en-US/images/relatorio-4.png b/documentation/reference/en-US/images/relatorio-4.png
new file mode 100644
index 00000000..1aa545be
Binary files /dev/null and b/documentation/reference/en-US/images/relatorio-4.png differ
diff --git a/documentation/reference/en-US/images/remotecatalog.png b/documentation/reference/en-US/images/remotecatalog.png
new file mode 100644
index 00000000..03ccc1da
Binary files /dev/null and b/documentation/reference/en-US/images/remotecatalog.png differ
diff --git a/documentation/reference/en-US/images/services.png b/documentation/reference/en-US/images/services.png
new file mode 100644
index 00000000..a3a98b06
Binary files /dev/null and b/documentation/reference/en-US/images/services.png differ
diff --git a/documentation/reference/en-US/images/xpathchecker.png b/documentation/reference/en-US/images/xpathchecker.png
new file mode 100644
index 00000000..210d6688
Binary files /dev/null and b/documentation/reference/en-US/images/xpathchecker.png differ
diff --git a/documentation/reference/en-US/images/xpather.png b/documentation/reference/en-US/images/xpather.png
new file mode 100644
index 00000000..b8610d7e
Binary files /dev/null and b/documentation/reference/en-US/images/xpather.png differ
diff --git a/documentation/reference/en-US/master.xml b/documentation/reference/en-US/master.xml
new file mode 100644
index 00000000..e2589fbe
--- /dev/null
+++ b/documentation/reference/en-US/master.xml
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+ Demoiselle Behave
+
+ Behavior Driven Development (BDD) is a technique developed by
+ Dan North, in 2003, which goal is making easy collaboration among
+ developers, quality staffs and customers, in a software project.
+ It starts from principle that if you specify user stories, in a appropriate
+ format, they can be used as requirements and as artifact of
+ input for automated tests. She uses an ubiquitous language, which
+ allow that acceptance tests be written in a language
+ nearest of business.
+
+
+ Described tests are interpreted by specialized tools, that
+ exercise system code, for demonstrating if expected behavior
+ was reached. BDD skills include:
+
+
+
+
+
+
+ Involve project
+ stakeholders
+ (Wikipedia)
+
+
+
+
+ Use example derivation for describing behavior of an
+ application or of code units.
+
+
+
+
+ Automate examples for providing a fast feedback and regression
+ tests;
+
+
+
+
+ Use mocks for helping in collaboration among modules and codes that
+ weren't written yet
+
+
+
+
+
+ O Demoisele-Behave, commonly called dbehave, is a
+ framework
+ that allows users
+ to automate tests using resources of
+ BDD.
+
+
+ Application has four main modules: Core, Parser,
+ Runner
+ and Integration. Core is responsible by main
+ interfaces
+ of
+ framework, where class Controller is responsible by orchestration of
+ information among other 3 modules.
+
+
+
+
+
+
+
+
+
+
+
+ Demoiselle-Behave Architecture Tool.
+
+
+
+
+
+ Parser is responsible by component abstraction that
+ will turn story into Java code, for sending to Runner by
+ means of default or project specific statements.
+
+
+
+
+
+
+
+
+
+
+ Parser Working Model.
+
+
+
+
+
+ Runner is responsible by component abstraction that will
+ handle screen, as Selenium or even directly
+ JUnit. Module Integration is responsible by component
+ abstraction that will integrate solution and
+ enterprise external tools like ALM (RQM).
+ Framework
+ ensures that
+ stories written in TXT format be sent to module Parser
+ and,
+ after, to Runner, responsible by interaction with
+ Web browser or a Dekstop screen, using
+ respectively
+ Selenium or
+ Fest
+ framework.
+
+
+
+
+
+
+
+
+
+
+
+ Demoiselle-Behave Working
+
+
+
+
+
+ Tool must allow that test draftsmen write
+ stories that can be read and call automated
+ test scripts, created by test developers.
+
+
+
+
+
+
+
+
+
+
+ Demoiselle-Behave Use Model
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/reference/en-US/quickstart.xml b/documentation/reference/en-US/quickstart.xml
new file mode 100644
index 00000000..0bc4f568
--- /dev/null
+++ b/documentation/reference/en-US/quickstart.xml
@@ -0,0 +1,316 @@
+
+
+
+ Quickstart
+
+
+ This section presents a quickstart for creation and
+ configuration of a project using Demoiselle Behave framework.
+
+
+ Use requirements
+
+
+
+ Eclipse 4.2 (Juno) -
+ Link para download
+
+
+
+
+
+ Eclipse Maven Plugin or Maven CLI
+ (mvn)
+
+
+
+
+ Linux
+
+
+
+
+ JDK 1.6
+
+
+
+
+
+ Archetype configuration
+
+ Demoiselle Behave framework provides a Maven archetype
+ for making easy to create projects.
+ First step in archetype
+ configuration consists of repository configuration. For that you must access menu
+ Windows>Preferences in Eclipse.
+
+
+
+
+
+
+
+
+
+
+ Preferences Menu.
+
+
+
+
+
+ Next step must be to click on button Add Remote Catalog.
+
+
+
+
+
+
+
+
+
+
+ Click on button Add Remote Catalog.
+
+
+
+
+
+ Next step is type following address into field Catalog File url:
+
+ http://demoiselle.sourceforge.net/repository/archetype-catalog.xml
+
+ Type into field Description:
+
+ Framework Demoiselle
+
+
+
+
+
+
+
+
+
+
+
+ Filling Remote Catalog.
+
+
+
+
+
+
+ Project Criation
+
+ First step to create a Demoisele-Behave project is
+ to create a Maven project using appropriate archetype for tests project.
+ This tutorial will use archetype jbehave-selenium-archetype.
+ First step is to choose option File>New>Other>Maven>Maven
+ Project.
+
+
+
+
+
+
+
+
+
+
+
+ Choosing Maven Project.
+
+
+
+
+
+ Choose catalog Demoisele-Behave and choose archetype
+ Selenium.
+
+
+
+
+
+
+
+
+
+
+ Choosing archetype jbehave-selenium-archetype.
+
+
+
+
+
+ Fill Group Id and Artifact Id and finish project
+ creation.
+
+
+
+
+
+
+
+
+
+
+ Choosing archetype jbehave-selenium-archetype.
+
+
+
+
+
+
+ Directory structure
+
+ Project created from archetype has directories
+ src/test/java and src/test/resources. Directory src/test/resource
+ contains user stories. Directory src/test/java
+ contains demoiselle Steps as well objects
+ responsible by identification of screens involved in tests and
+ its objects.
+
+
+
+
+
+
+
+
+
+
+ Estrutura de pastas do projeto criado a partir do arqutipo.
+
+
+
+
+
+
+ Running Test
+
+ Class MyTest is responsible by configuration of folder where
+ are located user stories as well steps
+ to be added to project.
+
+
+
+
+
+
+
+
+
+
+
+ Class MyTest.
+
+
+
+
+ Created project already has a sample that executes several steps in Demoiselle Behave site. To execute test is enough to click with right button
+ on class MyTest and choose Run as>JUnit Test.
+
+
+
+
+
+
+
+
+
+
+ Class MyTest
+
+
+
+
+
+ Framework starts Driver and open browser. Stories
+ actions can be seen in IDE console as image below.
+
+
+
+
+
+
+
+
+
+
+ Console exit
+
+
+
+
+ Below is story runned by framework:
+ Feature: Access to Demoiselle Behave Project
+
+Narrative:
+In order to get informations about Demoiselle Behave Project
+As a visitor
+I want to have access to documentation, forum and other informaation about project
+
+Scenario: DBehave Site
+Given I go to screen "dbehave"
+Then will be displayed "dbehave - projeto mantido pelo SERPRO"
+
+Scenario: Reading doubts
+Given I go to screen "Github"
+Then will be displayed "Demoiselle Behave"
+Then will be displayed "http://dbehave.com"
+
+When I click on "Dvidas e Questes"
+Then will be displayed "New issue"
+
+
+ For example, in second scenario, framework relates link
+ "Dvidas e Questes"
+ to element linkIssues of class MyPages created
+ for
+ mapping
+ screen objects. Element
+ locatorType
+ returns
+ type of
+ object recognition that will be used
+ in
+ framework. In
+ exemplo, will be located element which XPath be
+ "//a//span[./text()='Issues']".
+
+
+ @ScreenMap(name = "Github", location = "https://github.com/demoiselle/behave")
+ public class Main {
+
+ @ElementMap(name = "Dvidas e Questes", locatorType = ElementLocatorType.XPath, locator = "//a//span[./text()='Issues']")
+ private Link linkIssues;
+
+ @ElementMap(name = "uma dvida", locatorType = ElementLocatorType.XPath, locator = "(//a[contains(@class, 'issue-title')])[2]")
+ private Link linkIssue;
+ }
+
+
+
diff --git a/documentation/reference/en-US/regressao.xml b/documentation/reference/en-US/regressao.xml
new file mode 100644
index 00000000..c5679326
--- /dev/null
+++ b/documentation/reference/en-US/regressao.xml
@@ -0,0 +1,288 @@
+
+
+
+
+ Layout Regression Tests
+
+ This chapter presents feature that allow layout comparison among different browser from stories developed in dbehave projects.
+
+
+ This feature will be avaiblable from dbhave version 1.5.0.
+
+
+
+
+ Concept
+
+ Main idea of feature is allowing that project team have a visibility, by means of images and numbers, of design differences among several browsers that are, or will be, supported by system.
+
+
+ Navigation process through system must be made by dbhave stories, that sometimes already exist, and from images captured during process generate a report at end of test, comparing selected browsers with one that must be reference browser.
+
+
+
+ Requirements
+
+ For layout regression test works correctly some technologies are necessary during process, which are:
+
+
+
+ Java
+
+ It is necessary to have Java (JDK) installed for process works, commonly machines that runs with dbehave already have needed version.
+
+ For checking if JDK is correctly installed run following command:
+
+ java -version
+ Output must be like this:
+ java version "1.6.0_35"
+OpenJDK Runtime Environment (IcedTea6 1.13.7) (6b35-1.13.7-1ubuntu0.12.04.2)
+OpenJDK Server VM (build 23.25-b01, mixed mode)
+
+
+
+ Image Magick
+
+ For layout comparison process works correctly is necessary that library Image Magick (http://www.imagemagick.org) be installed.
+
+ Installation of that library in many Linux distributions, like Ubuntu 12.04, can be made by following command:
+
+ sudo apt-get install imagemagick
+ After installing access Prompt/Terminal of computer that will run tests and execute following command:
+ compare --version
+ Result must be something like following text:
+ Version: ImageMagick 6.9.0-0 Q16 i686 2014-11-24 http://www.imagemagick.org
+Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
+Features: DPC OpenMP
+Delegates (built-in): png x zlib
+
+
+
+ Dbehave project
+
+ Regression test has as initial requirement a created dbehave project, case you don't have created one it is enough to follow Quickstart from dbehave handbook.
+
+
+
+
+ Maven
+
+ For test runs correctly is necessary that machine have Maven installed, for knowing if it is correctly working run following command in prompt/terminal:
+
+ mvn --version
+ Output must ve something like following:
+ Apache Maven 2.2.1 (rdebian-8)
+Java version: 1.6.0_33
+Java home: /usr/lib/jvm/java-6-serpro-1.6.0.33/jre
+Default locale: pt_BR, platform encoding: UTF-8
+OS name: "linux" version: "3.2.0-58-generic-pae" arch: "i386" Family: "unix"
+
+
+
+ dbehave project configuration
+
+ This session describe how dbehave project must be configured for regression test runs.
+
+
+
+ Basic Configurations of pom.xml
+
+ This feature has basically 2 occurrences in pom.xml:
+
+ 1. Custom steps to capture screens to be compared
+ 2. Plugin maven that compares and generates report
+
+ To add custom steps it is enough to add a new dependency to pom.xml into tag dependencies like below:
+
+
+ br.gov.frameworkdemoiselle.component.behave
+ demoiselle-behave-regression-step
+ test
+]]>
+
+ Other configuration is inclusion of maven plugin inside tag build/plugins like below:
+
+
+
+
+ br.gov.frameworkdemoiselle.component.behave
+ demoiselle-behave-regression-report
+ 1.5.0
+
+
+ test
+
+ regression
+
+
+
+
+
+]]>
+
+
+
+ Configurations of behave.properties
+
+ For screenshots and report be generated some configurations are necessary into behave.properties
+
+
+
+ General configuration
+ Property that enables feature of regression for dbehave.
+ behave.regression.enabled=true
+
+ Property used by method RegressionConfig.getTypes() to do loop of tests running and report generation. They are browsers that will be used.
+ behave.regression.types=linux1204_Firefox30,linux1204_Chrome33,windows7_IE9,windows7_Chrome35
+
+ Property that defines browser used as reference for comparisons:
+ behave.regression.defaultType=linux1204_Firefox
+
+
+ Browsers configuration
+
+ For each browser listed in property behave.regression.types must exist a properties set that are defined with following pattern:
+ behave.regression.BROWSER_NAME.runner.PROPERTY
+
+
+
+ Use a readable name that determine operating system and browser and their respective versions in BROWSER_NAME of properties, because this name will be used in
+ comparison reports.
+
+
+
+ Below area possible properties to be used in configuration of each browser:
+
+
+ ...runner.screen.maxWait
+ ...runner.screen.minWait
+ ...runner.proxy.enabled
+ ...runner.proxy.url
+ ...runner.screen.driverPath
+ ...runner.profile.enabled
+ ...runner.screen.remote.url
+ ...runner.screen.remote.name
+ ...runner.screen.profilePath
+ ...runner.screen.binaryPath
+ ...runner.screen.type
+ ...runner.catchUIException
+ ...runner.window.maximize.enabled
+
+
+ Example of browser configuration:
+ // Firefox browser in local machine
+behave.regression.linux1204_Firefox30.runner.screen.type=MozillaFirefox
+behave.regression.linux1204_Firefox30.runner.window.maximize.enabled=true
+
+// Chrome browser in local machine
+behave.regression.linux1204_Chrome33.runner.screen.type=GoogleChrome
+behave.regression.linux1204_Chrome33.runner.window.maximize.enabled=true
+behave.regression.linux1204_Chrome33.runner.screen.driverPath=//path//do//driver//chromedriver
+
+// Internet Explorer 9 browser in remote machine
+behave.regression.windows7_IE9.runner.screen.type=RemoteWeb
+behave.regression.windows7_IE9.runner.window.maximize.enabled=true
+behave.regression.windows7_IE9.runner.screen.remote.name=internetExplorer
+behave.regression.windows7_IE9.runner.screen.remote.url=http://X.X.X.X:4444/wd/hub
+
+// Chrome browser in remote machine
+behave.regression.windows7_Chrome35.runner.screen.type=RemoteWeb
+behave.regression.windows7_Chrome35.runner.window.maximize.enabled=true
+behave.regression.windows7_Chrome35.runner.screen.remote.name=chrome
+behave.regression.windows7_Chrome35.runner.screen.remote.url=http://X.X.X.X:4444/wd/hub
+
+
+
+
+
+
+ Local Image Repository
+ For local repository is used user home directory as default, for example, in Linux is used /home/USER_NAME/.dbehave/.
+ Configuration is very simple, it is enough to select following property:
+ behave.regression.type=local
+
+
+
+
+
+ Comparison Points
+ For new capture phrases work it is necessary to add steps to dbehave by following command:
+ BehaveContext.getInstance().addSteps(new RegressionSteps());
+ For screens be captured it is enough to use one of following phrases:
+ When I get a screenshot
+When I get a screenschot with name "SCREENSHOT NAME TO BE EXHIBITED IN REPORT"
+
+
+ Running Regression Test
+
+ Show maven command and console output and report.
+ Final result will be created into folder /target/dbehave of your dbehave project.
+ It is recommended that be created new JUnit methods with following code:
+
+ @Test // JUnit Annotation
+public void testRegressaoLayout() throws Throwable {
+
+ // Loop to rest all browsers
+ for (String browser : RegressionConfig.getTypes()) {
+ RegressionConfig.setCurrentType(browser); // Select current browser
+
+ eng.addStoriesReuse("/stories/XXXX.story"); // Reuse stories
+ eng.addStories("/stories/XXXXX.story"); // Stories that will run
+
+ eng.addSteps(new MySteps()); // Custom steps
+ eng.addSteps(new RegressionSteps()); // Capture steps
+
+ // Run test for current selected browser in setCurrentType
+ eng.run();
+ }
+
+}
+
+
+ Generated Report
+
+
+ Report only will be generated if functional tests run successfully and when was executed via maven (mvn package), because report is generated by means of a plugin.
+
+
+
+ Final report will be created into folder /target/dbehave of your project and will have following features.
+
+
+ At first column will be displayed captured screen name text or provided name, depending on phrase was used.
+ At second column is displayed captured reference image of reference browser.
+
+ In next columns will be displayed images and informations about browsers comparison
+
+ Former Image (selected option) of reference browser.
+ Static Image that shows difference between browsers in red color.
+ Dynamic Image that shows difference between browsers by means of a GIF that switch between browsers.
+ Percentage of difference between browsers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sample of Layout Regression Test Report
+
+
+
+
+
diff --git a/documentation/reference/en-US/releasenotes.xml b/documentation/reference/en-US/releasenotes.xml
new file mode 100644
index 00000000..0fd86472
--- /dev/null
+++ b/documentation/reference/en-US/releasenotes.xml
@@ -0,0 +1,797 @@
+
+
+
+
+ Release Notes
+
+
+
+
+ To report problems, open discussions and get answers use Issues of GitHub - https://github.com/demoiselle/behave/issues.
+
+
+
+
+
+ Version 1.5.1
+
+
+
+ [Melhoria]
+ Include browser GhostDriver in experimental mode
+
+
+
+
+ [Bug]
+ Correction of a problem that does not allow to increase default timeout
+
+
+
+
+ [Bug]
+ Complete refactoring of ALM integration code fixing a bug that causes cleaning of several data
+
+
+
+
+ [Improvement]
+ New UI component to work with p:editor of primefaces
+
+
+
+
+ [Bug]
+ Fixing of bug that cleans some data when was stablished integration with ALM
+
+
+
+
+ [Improvement]
+ Update of WebDriver to version 2.46
+
+
+
+
+ [Improvement]
+ Standardization of Radio and Checkbox behavior
+
+
+
+
+ [Improvement]
+ Improvements in handling of Primefaces elements Radio and Check
+
+
+
+
+ [Improvement]
+ Update of JBehave to version 4
+
+
+
+
+ Version 1.5.0
+
+
+
+ [Improvement]
+ New zoom out property for screenshot
+
+
+
+
+ [Improvement]
+ Improvement of primefaces grid and new parameter for capturing screen when there are errors
+
+
+
+
+ [Improvement]
+ Improvement of ALM integration, now a scenario fails when one or more lines of examples fail
+
+
+
+
+ [Improvement]
+ Integration with Image Magick for layout regression tests
+
+
+
+
+ Version 1.4.4
+
+
+
+ [Improvement]
+ Improvement in selected value checking of Primefaces Select
+
+
+
+
+ [Melhoria]
+ Criation of steps to validate visibility of text, components and parameterized components
+
+
+
+
+ Version 1.4.3
+
+
+
+ [Improvement]
+ Improvement of ALM integration, now automated tests select "Running Type"
+ with value "Automated" for Test Case, or what is given in property behave.integration.alm.categoryTipoExecucao
+
+
+
+
+ [Improvement]
+ Added support to input text for test storing phrase
+
+
+
+
+ [Improvement]
+ Reorganization of steps for distinct classes
+
+
+
+
+ [Improvement]
+ Added support to radio button in phrase "clique no elemento..."
+
+
+
+
+ [Improvement]
+ New steps to handle Primefaces Grids
+
+
+
+
+ [Improvement]
+ Improvement in scenario parameterization
+
+
+
+
+ [Improvement]
+ New attribute forceWaitLoading in ElementMap forces dbehave to wait Loading appears
+
+
+
+
+ [Improvement]
+ Now even using Meta @casodeteste test case will be associated to plan
+
+
+
+
+ [Improvement]
+ Update of WebDriver from 2.44 to 2.45
+
+
+
+
+ Version 1.4.2
+
+
+
+
+ [Bug]
+ Fixes bug of version 1.4.1 to run test for Windows platform
+
+
+
+
+ Version 1.4.1
+
+
+
+
+ [Bug]
+ Fixes problem when checks loading presence
+
+
+
+
+ [Improvement]
+ Update of Selenium version to 2.44 (2014-10-23)
+
+
+
+
+ [Bug]
+ Fixes problem of ALM integration - Approvals Override
+
+
+
+
+ [Bug]
+ Fixes problem of ALM integration - Plan Categories Override
+
+
+
+
+ [Bug]
+ Improvement of treatment of IFrames whitout Source
+
+
+
+
+ [Improvement]
+ Adds interface Link as element type for phrase that moves mouse over an element
+
+
+
+
+ [Improvement]
+ Improvement of project documentation
+
+
+
+
+ [Bug]
+ Fixes problem of step to check not editable and visible fields
+
+
+
+
+ [Bug]
+ Fixes problem in phrase that stores elements into Primefaces combos
+
+
+
+
+ [Improvement]
+ New Components WebAutoComplete and WebImage
+
+
+
+
+ [Bug]
+ Error in ALM integration when there are requirements related to test plan
+
+
+
+
+
+
+ Version 1.4.0
+
+
+
+
+ [Improvement]
+ Improvement of Screenshot in Desktop module (Fest)
+
+
+
+
+ [Improvement]
+ New feature of value selecting by index inside Primefaces
+ combo
+
+
+
+
+ [Improvement]
+ Now in integration of ALM with pending scenarios, now they are
+ marked in ALM as blocked
+
+
+
+
+ [Bug]
+ Fixes checking of visible and disabled elements
+
+
+
+
+ [Improvement]
+ Avoid reusable scenarios be runned after used
+
+
+
+
+ [Improvement]
+ New steps to clean fields
+
+
+
+
+ [Improvement]
+ Fixes problems to run on Windows
+
+
+
+
+ [Improvement]
+ Fixes problem that doesn't clean stories correctly at the
+ end of test
+
+
+
+
+ [Improvement]
+ Improvement of fields filling
+
+
+
+
+ [Bug]
+ Fixes error when sends characters of greater than and less than
+
+
+
+
+ [Improvement]
+ Improvement of DataProvider use for common steps
+
+
+
+
+ [Improvement]
+ Added two new features: Steps Configuration
+ and Stories and Scenarios Configuration
+
+
+
+
+ [Improvement]
+ Created new property behave.parser.delayBetweenSteps for
+ adding a delay between each step running along
+ test
+
+
+
+
+ [Improvement]
+ Improvement of tests running speed, average of tests
+ running slow down 2 times
+
+
+
+
+ [Improvement]
+ New feature that allows use of a external
+ data set into stories XML
+
+
+
+
+ [Improvement]
+ New property behave.integration.alm.autoAssociateTestCaseInPlan
+ that allows to turn off automatic association between Test Cases and
+ Plans in RQM
+
+
+
+
+ [Improvement]
+ Update of training stuff
+
+
+
+
+
+
+ Version 1.3.2
+
+
+
+
+ [Bug]
+ Fixes a problem that occurred when used meta info
+ @casodeteste in ALM integration
+
+
+
+
+ [Bug]
+ Fixes a problem if JBehave that prevents report
+ generation on Windows
+
+
+
+
+ [Improvement]
+ Inclusion of field values of example table in tests scenarios
+ steps created in ALM
+
+
+
+
+ [Improvement]
+ Saves active window hierarchy into HTML file of JBehave
+ report for Fest
+
+
+
+
+ [Improvement]
+ Allow to use a not default Firefox
+
+
+
+
+ [Improvement]
+ Added new component DesktopLink
+
+
+
+
+ [Improvement]
+ Added new components DesktopRadio and DesktopCheckbox
+
+
+
+
+ [Improvement]
+ Added new component to rich:fileupload
+
+
+
+
+ [Improvement]
+ Added new component to rich:inputNumberSpinner
+
+
+
+
+ [Improvement]
+ Added new step: it will be displayed value "$text" in
+ "$elementName" related to "$locatorParameters"
+
+
+
+
+ [Bug]
+ Fixes bug of fields filling in IE8+ for Windows 7
+ 64-bits
+
+
+
+
+ [Improvements]
+ Improvement of ALM integration that allows to define project
+ area with or without url encoding
+
+
+
+
+ [Improvement]
+ Allow use of browser window in maximized mode
+
+
+
+
+ [Improvement]
+ Allow to change window in browser by means of url
+
+
+
+
+ [Improvement]
+ Allow to reuse scenarion of a story without running it
+
+
+
+
+ [Improvement]
+ New property to control timeout of stories in parser
+
+
+
+
+ [Improvement]
+ Improvement of error screenshot file identification
+
+
+
+
+ [Bug]
+ Fixes error 'No selected page' when more than on class
+ inherits of CommonSteps
+
+
+
+
+ [Improvement]
+ Update Selenium component to work with last
+ browsers
+
+
+
+
+ [Improvement]
+ Update of framework properties in documentation
+
+
+
+
+ [Improvement]
+ Update of treino application and inclusion into
+ folder "sample/treino-app" of GitHub repository
+
+
+
+
+
+
+ Version 1.3.1
+
+
+
+
+ [Improvement]
+ Treatment of exception StaleElementReferenceException by means of a
+ proxy
+
+
+
+
+ [New Feature]
+ Possibility to configure framework for running remote
+ tests
+
+
+
+
+ [Improvement]
+ Treatment of character # when sends data to ALM
+
+
+
+
+ [Improvement]
+ Tratamento de elementos visíveis mais não clicáveis
+
+
+
+
+ [New Component]
+ New Web screen component RichTextEditor (CKEditor)
+
+
+
+
+ [Improvement]
+ Update of framework dependencies
+
+
+
+
+ [Improvement]
+ Improvement of running speed and stability of tests
+
+
+
+
+ [Bug]
+ Treatment of masked fields in Primefaces
+
+
+
+
+
+
+ Version 1.3.0
+
+
+
+
+ [New Feature]
+ Implementation for locator with parameters using notation:
+ %paramN%
+
+
+
+
+ [New Feature]
+ Implementation of screen composition from annotation @Embedded
+
+
+
+
+ [Improvement]
+ New phrases for Javascript alert treatment
+
+
+
+
+ [Improvement]
+ Treatment of frames in screen objects search
+
+
+
+
+ [Improvement]
+ Implementation of component PrimeFaces Tree
+
+
+
+
+ [Improvement]
+ Internationalization of Framework messages
+
+
+
+
+ [Improvement]
+ Embedding use of keys in reference actions
+
+
+
+
+ [Improvement]
+ Treatment of exception StaleElementReferenceException no WebSelect
+
+
+
+
+ [Bug]
+ Problem with common steps: Fix of phrase "then will be displayed"
+
+
+
+
+ [Bug]
+ Problem with common steps: Fix of phrase "select option"
+
+
+
+
+
+
+ Version 1.2.0
+
+
+
+
+ [R09]
+ Allow running for interface Desktop - (Java Swing)
+
+
+
+
+ [R12]
+ Tests running in background mode
+
+
+
+
+ [R14]
+ Control parallel running
+
+
+
+
+ [Bug]
+ Error in ALM integration
+
+
+
+
+ [Bug]
+ Fixes Bug: Problem with keyword
+ Feature
+
+
+
+
+ [Improvement]
+ - Training Stuff
+
+
+
+
+ [Improvement]
+ Allow to use parameterized scenarios
+ together
+ scenario reuse
+
+
+
+
+ [Improvement]
+ Improvement of JBehave report with errors Screenshot
+
+
+
+
+
+
+
+ Version 1.1.0
+
+
+
+ [R01]
+ Data reuse between stories
+
+
+
+
+ [R03]
+ ALM integration – (RQM, SCM, RTC, Agent Builder)
+
+
+
+
+ [R06]
+ Parameterizable running
+
+
+
+
+ [R07]
+ Components reuse for screen interaction
+
+
+
+
+ [R10]
+ Allow to run other tests than graphical interface
+
+
+
+
+ [Improvement]
+ Reference Documentation
+
+
+
+
+
+
+ Version 1.0.0
+
+
+
+ [R02]
+ Stories reuse
+
+
+
+
+ [R04]
+ Tests running in continuous integration
+
+
+
+
+ [R05]
+ Integration with approved IDEs
+
+
+
+
+ [R08]
+ Decoupling of reference technologies
+
+
+
+
+ [R11]
+ Allow running debug
+
+
+
+
+ [R13]
+ Simplicity of environment build
+
+
+
+
+ [Improvement]
+ Project Structure - Demoiselle Standard
+
+
+
+
+
+
diff --git a/documentation/reference/en-US/revhistory.xml b/documentation/reference/en-US/revhistory.xml
new file mode 100644
index 00000000..36aff16d
--- /dev/null
+++ b/documentation/reference/en-US/revhistory.xml
@@ -0,0 +1,85 @@
+
+
+
+
+ 1.5.1
+ 12/08/2015
+ Vanderson, Julian
+ Improvement and fixes in framework.
+
+
+ 1.5.0
+ 29/05/2015
+ Vanderson, Julian
+ Layout Regression Test, improvements and fixes in framework.
+
+
+ 1.4.4
+ 19/05/2015
+ Vanderson, Julian
+ Improvements and fixes in framework.
+
+
+ 1.4.3
+ 24/04/2015
+ Vanderson, Julian
+ New features and improvements in framework.
+
+
+ 1.4.2
+ 03/03/2015
+ Vanderson, Julian
+ Bug fix.
+
+
+ 1.4.1
+ 06/02/2015
+ Vanderson, Julian
+ New features and improvements in framework.
+
+
+ 1.4.0
+ 02/09/2014
+ Vanderson, Julian
+ New features and improvements in framework.
+
+
+ 1.3.2
+ 30/05/2014
+ Vanderson, Julian
+ New features and improvements in framework.
+
+
+ 1.3.1
+ 18/12/2013
+ Vanderson, Julian
+ New features and improvements in framework.
+
+
+ 1.3.0
+ 31/10/2013
+ Julian
+ New features and improvements in framework.
+
+
+ 1.2.0
+ 22/08/2013
+ Julian
+ Change of maven repository, added new chapters
+ related to Desktop tests (FEST) and additional configurations of
+ framework.
+
+
+ 1.1.0
+ 30/06/2013
+ Vanderson
+ Reference Documentation.
+
+
+ 1.0.0
+ 15/05/2013
+ Vanderson, Nauber
+ Fast Guide.
+
+
diff --git a/documentation/reference/en-US/screenmapping.xml b/documentation/reference/en-US/screenmapping.xml
new file mode 100644
index 00000000..7c4987a2
--- /dev/null
+++ b/documentation/reference/en-US/screenmapping.xml
@@ -0,0 +1,310 @@
+
+
+
+ Classes Mapping
+
+
+ This section presents a guide to create visual scripts.
+
+
+ Capturing screen objects to be used
+
+ First step to create a script in Demoiselle-Behave is
+ to choose visual objects that
+ will be used.
+ Objects can
+ be identified by several ways like Id, XPath or CSS. These
+ different ways of finding
+ an object in screen are named
+ locators.
+ This tutorial will use some help tools
+ to choose
+ of objects. In a demonstrating way
+ tutorial
+ will present a
+ example where user will search an information
+ into page of
+ SERPRO(www.serpro.gov.br).
+
+
+
+
+
+
+
+
+
+
+ Locators.
+
+
+
+
+
+ Next step is to use a help tool to choose
+ objects. XPath Checker and FirePath are tools that allow
+ to get Xpath from screen objects
+ (https://addons.mozilla.org/pt-br/firefox/addon/xpath-checker/)(https://addons.mozilla.org/en-US/firefox/addon/firepath/).
+
+
+
+
+
+
+
+
+
+
+ XPath Checker Tool
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FirePath Tool
+
+
+
+
+
+
+ After help tools installation must be choosen
+ objects that must interact with screen. For demonstrating
+ the
+ process will be done a search in SERPRO page
+ (www.serpro.gov.br). It will be selected search field and
+ search button.
+ Using firepath will be identified id of search
+ field.
+
+
+
+
+
+
+
+
+
+
+ Using firepath to find object xpath
+
+
+
+
+
+ Once used firepath we discovered that search field xpath
+ has value
+ .//*[@id='searchGadget']
+ and xpath
+ of search button has value
+ .//*[@id='livesearch0']/div/input[1]
+ .
+
+
+
+ Mapping Class
+
+ Next step will be to implement a class with object
+ mapping to be tested and its identifiers.
+
+
+ package packageName;
+
+import br.gov.frameworkdemoiselle.behave.annotation.ElementLocatorType;
+import br.gov.frameworkdemoiselle.behave.annotation.ElementMap;
+import br.gov.frameworkdemoiselle.behave.annotation.ScreenMap;
+import br.gov.frameworkdemoiselle.behave.runner.ui.Button;
+import br.gov.frameworkdemoiselle.behave.runner.ui.TextField;
+
+@ScreenMap(name = "Tela Inicial", location = "https://www.serpro.gov.br")
+public class MyPage {
+
+ @ElementMap(name = "Campo de Busca", locatorType = ElementLocatorType.XPath, locator = ".//*[@id='searchGadget']")
+ private TextField searchField;
+
+ @ElementMap(name = "Estou com sorte", locatorType = ElementLocatorType.XPath, locator = ".//*[@id='livesearch0']/div/input[1]")
+ private Button button;
+
+}
+
+ Framework engine automatically chooses which action will be
+ done depending on type of object applied to element
+ of
+ graphical interface. In example above type Button indicates that click
+ action must be done.
+
+
+ Other element types are CheckBox, Link, Radio, Screen,
+ Select and TextField.
+ For each visual element was created a interface
+ that is implemented by a class that define how action must be
+ done.
+
+ package br.gov.frameworkdemoiselle.behave.runner.ui;
+
+import br.gov.frameworkdemoiselle.behave.runner.ui.base.BaseUI;
+
+public interface Radio extends BaseUI {
+
+ public void click();
+
+}
+
+ Following code is an implementation of class Radio for Web using
+ Selenium.
+
+ package br.gov.frameworkdemoiselle.behave.runner.webdriver.ui;
+
+import br.gov.frameworkdemoiselle.behave.runner.ui.Radio;
+
+public class WebRadio extends WebBase implements Radio {
+
+ public void click() {
+ waitElement(0);
+
+ getElements().get(0).click();
+ }
+
+}
+
+ Implementation of class for visual interface is configured
+ using SPI concept in framework.
+ For each interface there is
+ a file that indicates which implementation will be
+ choosen for each
+ interface.
+
+
+
+
+
+
+
+
+
+
+ Choosing archetype jbehave-selenium-archetype.
+
+
+
+
+
+
+
+ Parameterizable Mapping
+
+ It is possible to parameterize locator by means of pre-defined phrases.
+
+
+ For a determined situation will be needed to select a button that is contained by a line that has word "Brasil" at first column, to make easy this task will be created parameterizable locators.
+ First step is creating mapping in class as example below shows.
+
+ @ElementMap(name = "Excluir", locatorType = ElementLocatorType.XPath, locator = "(//tr[contains(@id, 'tr-identification')][.//text()='%param1%']//button)[1]")
+private Button botao;
+
+ See that there is a Perceba que no locator existe o trecho %param1%, esse o identificador para que na histria seja passado algum texto para ser inserido neste local, como por exemplo:
+
+
+
+ Quando clico em "Excluir" referente a "Brasil"
+
+ Tambm possvel passar mais de um parmetro para a frase como no exemplo abaixo (os valores devem ser separados por vrgula):
+
+ // Mapeamento do Campo
+@ElementMap(name = "Excluir", locatorType = ElementLocatorType.XPath, locator = "(//tr[contains(@id, '%param1%')][.//text()='%param2%']//button)[1]")
+private Button botao;
+
+// Frase na histria
+Quando clico em "Excluir" referente a "obra, valor"
+
+ As seguintes frases permitem a parametrizao do texto do locator:
+
+
+ Quando clico em "Name" referente a "Param1,Param2..."
+
+
+ Quando seleciono a opo "Name" referente a "Param1,Param2..."
+
+
+ Quando clico na linha da tabela "Name" referente a "Param1,Param2..."
+
+
+
+
+
+
+ Composio de Telas (Embedded Screens)
+
+ O framework fornece uma anotao (@Embedded) que permite que sejam reutilizadas telas dentro de outras telas.
+ Como exemplo vamos utilizar uma tela de login abaixo:
+
+ @ScreenMap(name = "Tela de Login", location = "/")
+public class LoginPage {
+
+ @ElementMap(name = "Campo Usurio", locatorType = ElementLocatorType.XPath, locator = "(//input[contains(@id, 'formLogin')][contains(@type, 'text')])[1]")
+ private TextField campoUsuario;
+
+ @ElementMap(name = "Campo Senha", locatorType = ElementLocatorType.XPath, locator = "(//input[contains(@id, 'formLogin')][contains(@type, 'password')])[1]")
+ private TextField campoSenha;
+
+ @ElementMap(name = "Entrar", locatorType = ElementLocatorType.XPath, locator = "(//button[contains(@id, 'formLogin')][contains(@type, 'submit')])[1]")
+ private Button botaoEnviar;
+
+}
+
+ For screen login be used in several public parts of system it is enough that in any ScreenMap be created an attribute so:
+
+ @Embedded
+private LoginPage loginPage;
+
+ This will be do that login screen be embedded into screen that has attribute with annotation.
+
+
+
+
+ Systems with AJAX (Component Loading)
+
+ Framework provides a screen component called Loading, that helps treatment of AJAX actions that commonly has as default behavior to open an element above content with an image/text "Loading...", preventing access from another screen elements, while image/text is exhibited.
+ Component aims to wait image disappears to go to next step.
+
+ For using component, add in some ScreenMap an ElementeMap with type Loading as below:
+
+ @ElementMap(name = "Carregando", locatorType = ElementLocatorType.XPath, locator = "/HTML/BODY/DIV[2]/DIV[1]/SPAN[@id='ui-dialog-title-j_idt9']")
+private Loading loading;
+
+ It is enough to add Loading in a ScreenMap for it works for all screens.
+
+
+
+ Problem solved by this component can occurs randomly in systems with AJAX and that have image/text "Loading..." in actions. When there is slow down in system image/text is maintained more time than normal preventing next step be executed.
+
+
+
+
+ From version 1.4.3 annotation @ElementMap has an attribute forceWaitLoading that is false by default.
+ In some specific cases it aims to force waiting for mapped loading element appears, that is, when element with this property forceWaitLoading = true dbehave will wait for maxWait loading appears and then disappear before to execute next action.
+ Below is a use example:
+
+ @ElementMap(name = "ELEMENT NAME IN STORY", forceWaitLoading = true, locatorType = ElementLocatorType.Id, locator = "ELEMENT ID")
+private TextField field;
+
+