Git Product home page Git Product logo

thucydides-jbehave's People

Contributors

arussel avatar cvmocanu avatar mdolinin avatar wakaleo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

thucydides-jbehave's Issues

Internationalization is not working when running parameterized scenarios

Whenever we run a testcase (subclass of ThucydidesJUnitStories), parameterized scenarios with examples clause in other languages than default english (e.g. pt) are not recognized.

That problem could be quickly fixed by replacing the line 150 of ThucydidesReportingRunner.java, as follows:
FROM: new Keywords()
TO: getConfiguration().keywords()

See details of code here: https://github.com/thucydides-webtests/thucydides-jbehave/blob/master/src/main/java/net/thucydides/jbehave/runners/ThucydidesReportingRunner.java

Running concurrent test fails with java.util.EmptyStackException

Using the JBehave feature of running tests concurrently fails under certain circumstances while writing the Thucydides report with the following exception:

[WARNING] Failed to run story stories/booking/Unlock.story

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.jbehave.core.reporters.ConcurrentStoryReporter$DelayedMethod.invoke(ConcurrentStoryReporter.java:356)
at org.jbehave.core.reporters.ConcurrentStoryReporter.invokeDelayed(ConcurrentStoryReporter.java:335)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:230)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:262)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jbehave.core.reporters.ConcurrentStoryReporter$DelayedMethod.invoke(ConcurrentStoryReporter.java:352)
... 10 more
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
at java.util.Stack.pop(Stack.java:84)
at net.thucydides.jbehave.ThucydidesReporter.afterScenario(ThucydidesReporter.java:532)
at org.jbehave.core.reporters.DelegatingStoryReporter.afterScenario(DelegatingStoryReporter.java:43)
... 15 more

It is difficult to reproduce because it does not happen on any computer. In our case only to occurs when at least on scenario of a story is failing and multiple stories are used. Even than, it does not happen on every host - because a race condition seems to be involved, but it can be validated by setting some break points. It seems that net.thucydides.jbehave.ThucydidesReporter.activeScenarios is responsible for the failure, which is accessed concurrently by multiple threads.

We have tried out a fix where activeScenarios is accessed via a thread local variable which worked fine on our machines.

Best regards

Tronje

metafilters doesn't use parameterised test data for data driven testing

I have a story with the tag
@id SRA20
and the following Example table beneath the GWT.

Given....< row > ......
When....
Then....
Examples:
|row|
|17|
|18|

when this story is ran without using metafilters it reports both runs as seperate steps in the test results however when I run using metafilter:
-Dmetafilter="+id *SRA20"
it shows a successful run of the test however it hasn't picked up any steps
image

Is there something else I need to add into the metafilter to allow it to pick up the example table to allow it to be a data driven test?

GivenStories filtered out by metafilter

This seems to have been resolved within JBehave itself by specifying in StoryControls doIgnoreMetaFiltersIfGivenStory(boolean)

Could this be added as an option to the ThucydidesJBehaveSystemProperties?

All Steps Pending (0.9.229)

I've been running into an issue trying to set up Thucydides with Jbehave for the last couple of days, using version 0.9.229 of each.

The problem: no matter what I do, when I run my tests, each and every step comes back as "PENDING". This happens whether I'm running my own project, running a testRunner in this git, or even just executing a "mvn test thucydides:aggregate" on the basic maven archetype.

After some debugging, I expect the problem lies in the JUnitDescriptionGenerator.java class, particularly in the addNonExistingStep() method:

private void addNonExistingStep(Description description, String stringStepOneLine,
            String stringStep) {
        try {
            StepType stepType = configuration.keywords()
                    .stepTypeFor(stringStep);
            if (stepType == StepType.IGNORABLE) {
                addIgnorableStep(description, stringStepOneLine);
            } else {
                addPendingStep(description, stringStepOneLine);
            }
        } catch (StartingWordNotFound e) {
            // WHAT NOW?
        }
    }

I traced my tests through this method, and my stepTypes were being instantiated correctly (Given, When, etc.), but because of the "else" statement, they're all being marked as pending.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.