JBehave cannot run multiple scenarios - jbehave

I have the following story file (in portuguese):
Narrativa: Cadastrar peritos
Como um usuário do AUD
Desejo poder cadastrar novos peritos
De modo que eu possa referencia-los no momento da audiencia
Cenário: Acessar menu configuracao
Dado que estou na aplicacao AUD
Quando eu clico no botao Configuracao
Cenário: adicionar peritos
Dado que estou na tela de peritos
Quando informo o perito <codigo>, <nome>, <especialidade> e <cpf>
Exemplos:
br/jus/trt4/aud/stories/peritos.table
But for some reason jbehave is not able to run the second scenario. The output is:
Processing system properties {}
Using controls EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=false,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeouts=300,threads=1,failOnStoryTimeout=false]
(BeforeStories)
Running story br/jus/trt4/aud/stories/aud_stories.story
(br/jus/trt4/aud/stories/aud_stories.story)
Scenario: Narrativa: Cadastrar peritos
Como um usu?rio do AUD
Desejo poder cadastrar novos peritos
De modo que eu possa referencia-los no momento da audiencia
Cenário: Acessar menu configuracao
Examples:
Dado que estou na aplicacao AUD
Quando eu clico no botao Configuracao
Cenário: adicionar peritos
Dado que estou na tela de peritos
Quando informo o perito <codigo>, <nome>, <especialidade> e <cpf>
|codigo|nome|especialidade|cpf|
|123|luiz fernando|automacao de testes|34432|
Example: {codigo=123, nome=luiz fernando, especialidade=automacao de testes, cpf=34432}
Using timeout for story aud_stories.story of 300 secs.
Dado que estou na aplicacao AUD
Quando eu clico no botao Configuracao
Cen?rio: adicionar peritos (PENDING)
Dado que estou na tela de peritos (NOT PERFORMED)
Quando informo o perito 123, luiz fernando, automacao de testes e 34432 (NOT PERFORMED)
#When("eu clico no botao Configuracao\r\n\r\nCen\uFFFDrio: adicionar peritos")
#Pending
public void whenEuClicoNoBotaoConfiguracaoCenrioAdicionarPeritos() {
// PENDENTE
}
(AfterStories)
Generating reports view to 'C:\Users\lestivalet\workspace\AutoHotKey\target\jbehave' using formats '[stats, console, html]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
Reports view generated with 3 stories (of which 1 pending) containing 2 scenarios (of which 1 pending)
Please note the line "#When("eu clico no botao Configuracao\r\n\r\nCen\uFFFDrio: adicionar peritos")" It is joining the work "Cenario" in the last sentence of the first scenario.
If I have only one scenario it worked well.
If I use english keywords it works!!
Any idea? I'm using jbehave 4.0.4 with the following configuration:
public class AudStories extends JUnitStory {
public Configuration configuration() {
Configuration configuration = new Configuration() {
};
configuration.useParameterControls(new ParameterControls().useDelimiterNamedParameters(true));
configuration.useKeywords(new LocalizedKeywords(new Locale("pt")));
configuration.useStepFinder(new StepFinder());
configuration.useStoryControls(new StoryControls());
configuration.useStoryParser(new RegexStoryParser(configuration.keywords()));
configuration.useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(Format.CONSOLE, Format.HTML));
return configuration;
}
#Override
public InjectableStepsFactory stepsFactory() {
return new InstanceStepsFactory(configuration(), new AUDSteps());
}
}

I believe your problem lies here:
cenario: Narrativa: Cadastrar peritos
Como um usu?rio do AUD
Desejo poder cadastrar novos peritos
De modo que eu possa referencia-los no momento da audiencia
Cenário: Acessar menu configuracao
Notice that the first Scenario is being interpreted as a Narrative. Likely your keyword translations are incomplete. Perhaps the "In order to" needs to be defined.

Related

Show all burndown projects with the tuleap API

English :
Hello everybody !
Do you know if it is possible to recover from the API of the project planning and management tool "Tuleap" the burndown urls of all the projects to which the original user of the request has access?
After several searches in the documentation of the tool and on the internet, I still can not find an answer.
Thank you for the help you can give me! :)
Français :
Bonjour tout le monde !
Savez-vous s'il est possible de récupérer à partir de l'API de l'outil de planification et gestion de projet "Tuleap" les urls des burndown de l'intégralité des projets auxquels à accès l'utilisateur originaire de la requête ?
Après plusieurs recherche dans la documentation de l'outil et sur internet, je n'arrive toujours pas à trouver de réponse.
Merci pour l'aide que vous pourrez m'apporter ! :)

How do I get French accents to show up properly in a mailto?

I've got a mailto link with body copy. The content is all in French. Unfortunately its showing funny characters instead of the accents that I need.
<a title="Prospects" href="mailto:?subject=Pourquoi ne pas investir dans les bons conseils?&body=Madame, Monsieur,%0D%0A%0D%0AÊtes-vous en voie d'atteindre vos objectifs financiers?%0D%0A%0D%0ADes recherches ont révélé que les investisseurs bénéficiant de conseils professionnels s'en tirent beaucoup mieux financièrement. En fait, il a été démontré récemment que ceux faisant appel à un conseiller accumulent presque quatre fois plus d'actifs que les autres.%0D%0A%0D%0AN'hésitez pas à communiquer avec moi pour prendre rendez-vous et en discuter. Veuillez agréer mes plus cordiales salutations.%0D%0A%0D%0ASincerely,%0D%0A%0D%0A<Conseiller>" class="resource_btn"><i class="fa fa-envelope"></i>Prospection</a>
Any help would be appreciated!
I tried encoding the email
https://jsfiddle.net/765rotvu/
https://jsfiddle.net/f8tabmmf/
There's javascript function escape to encode html.
Example:
javascript:escape('Êtes-vous là, où étiez-vous ?');
Result is
%CAtes-vous%20l%E0%2C%20o%F9%20%E9tiez-vous%20%3F

ColdFusion and Unicode Characters Issues

Working on the Globalization of the Coldfusion website using the i18n.
I am using the resource files rather than database..
In my one of the string files, i have the value being displayed as:
Inicia sesión con tu nombre de usuario y contraseña.
and when i run on my browser, it is displayed as:
Inicia sesi�n con tu nombre de usuario y contrase�a.
Having read the below link, i have enabled the utf through cfprocessingdirective and the meta tag also, but i am not sure why it is still displaying it like this.
ColdFusion character encoding issue
I used the Google translate to translate the above English to Spanish.
Using this in my Application.cf also:
<cfset setLocale("English (US)")>
<!--- Set the session page encoding --->
<cfset setencoding("URL", "utf-8")>
<cfset setencoding("Form", "utf-8")>
Update #1
I cannot Update, but i am adding here:
spanish:
username=Nombre de usuario
login=Inicia sesión con tu nombre de usuario y contraseña.
appName=Inventory Manager
rem=Acuérdate de mí
slogin=Iniciar sesión
errorLoginMsg=Error! Credenciales de login fallidos, Inténtalo de nuevo
ser='Nombre de usuario' es un campo obligatorio.
ser1='Password' es un campo obligatorio.
nitem=Nuevo elemento
ilist=Lista de artículos
order=Orden
olist=Lista de Pedidos
sell=Vender
slist=Lista de Ventas
quote=Cotizaciones
qlist=Lista Cotizaciones
rs=Vuelto Vendido
inv=Factura
Russian File it is ru.rtf
username=Имя пользователя
login=Войти с именем пользователя и паролем.
appName=Inventory Manager
rem=Запомнить меня
slogin=войти
errorLoginMsg=Ошибка! Учетные данные для входа не удалась, попробуйте еще ​​раз
ser='Имя' является обязательным полем.
ser1=Поле 'Пароль' является обязательным.
nitem=Новый элемент
ilist=Список статей
order=Заказать
olist=Список Заказать
sell=Продать
slist=Список продажам
quote=Цитаты
qlist=Котировки Список
rs=Продано Возвращается
inv=Счет

Get form names in windev

I use Itextsharp in WinDev and I try to get the names of a form.
My code is hereafter :
Machaine est une chaine
PdfSource= FicSource
PdfDestination = RepCible+"\"+fExtraitChemin(PdfSource,fFichier)+" "+CodId+".pdf"
MonStream = allouer un FileStream(PdfDestination,FileMode::Create)
MonPdfReader est un PdfReader(PdfSource)
POUR TOUT MaChaine DANS MonPdfReader.AcroFields.Fields.Keys
FIN
The problem is that
"MonPdfReader.AcroFields.Fields.Keys"
is not accepted.
Thanks for your ideas ...
As you didn't answer your question, here it is :
PdfSource = Sai_FicSource
//file pdf source
MonPdfReader est un PdfReader(PdfSource)
Monfield est un AcroFields.Item
POUR TOUT Monfield DE MonPdfReader.AcroFields.Fields.Keys
MaChaine = Monfield
FIN

nltk in python to extract information from web page

how can I use nltk in python to extract information from web page (job offers in my case)
I use this code to extract a part of text ,
import nltk
import time
import urllib2
from urllib2 import urlopen
from cookielib import CookieJar
import datetime
website = "http://tanitjobs.com/search-results-jobs/"
topSplit = "<div class=\"offre\">"
ButtomSplit = "<div class=\"offre-emploi \">"
cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('Uer-agent', 'Mozilla/5.0')]
def main():
try:
ss =opener.open(website).read()
sourceCodeSplit = ss.split(topSplit)[1].split(ButtomSplit)[0]
texte = nltk.clean_html(sourceCodeSplit)
print texte
except Exception,e:
print 'fail in the main loop'
print str(e)
main()
but I don't know how to do it if I would extract specific paragraph (job offers) from a web page in general
Firstly, you will need urllib.request from python3, see http://docs.python.org/3.0/library/urllib.request.html
Next, BeautifulSoup is your friend: http://www.crummy.com/software/BeautifulSoup/bs4/doc/. I find this useful in installing bs4 in py3.x see http://annelagang.blogspot.fr/2012/11/beautifulsoup-4-for-python-3x.html
Here's a working example:
import urllib.request
from bs4 import BeautifulSoup as bs
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
headers={'User-Agent':user_agent,}
url="http://tanitjobs.com/search-results-jobs/"
request=urllib.request.Request(url,None,headers) #The assembled request
response = urllib.request.urlopen(request)
data = response.read()
for i in bs(data).find_all(attrs={"class": "offre-emploi vedette"}):
print(" ".join(i.find("div",attrs={"class":"detail"}).text.split()))
print
[out]:
Téléopérateurs (trices) Quality Com Center QualityCom sis a
Montplaisir recrute des téléopérateurs (trices), en... Voir toutes les
offres de Quality Com Center
Contrôleur de gestion Eureka Developpement Humain Pour le compte d’une
Multinationale dans le domaine de l'industrie, nous recrutons un :...
Voir toutes les offres de Eureka Developpement Humain
Responsable ressources humaines (H/F) Eureka Developpement Humain Pour
son propre compte Eureka Développement Humain Recrute : Responsable...
Voir toutes les offres de Eureka Developpement Humain
Contrôleur Financier Junior Proxy Tunisie Rattaché au Directeur
Administratif et Financier pays, votre rôle est de garantir la
gestion... Voir toutes les offres de Proxy Tunisie
Superviseur en prise de rdv ( énergie renouvelable ) Quality Com
Center Quality Com Center sis a Montplaisir Recrute 1 Superviseur(e)
en Panneaux... Voir toutes les offres de Quality Com Center
Téléconseillers (h/f) Axess global services AXESS GLOBAL SERVICES
Recrutement Vous souhaitez travailler dans une Enterprise jeune et...
Voir toutes les offres de Axess global services