Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"fit" doesn't work with jasmine 2.x on protractor #1908

Closed
joaomqcunha opened this issue Mar 6, 2015 · 15 comments
Closed

"fit" doesn't work with jasmine 2.x on protractor #1908

joaomqcunha opened this issue Mar 6, 2015 · 15 comments

Comments

@joaomqcunha
Copy link

I'm using the protractor@1.8.0 with framework: 'jasmine2' on "protractor.conf".

When I set an it as fit, I have the following message:

Running "protractor:smoke" (protractor) task
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.1.3:57112/wd/hub
Spec started

Executed 0 of 10 specs SUCCESS (10 SKIPPED) in 0.002 secs.

0 tests run!

Although, when I use "fdescribe", it works as expected.

@hankduan
Copy link
Contributor

hankduan commented Mar 7, 2015

Please provide a sample case that reproduces this.

@sjelin
Copy link
Contributor

sjelin commented Mar 7, 2015

I am not having this problem

@joaomqcunha
Copy link
Author

For example:

Using fdescribe:

fdescribe('Describe Description', function () {

    it('Test1', function () {
        expect(1).toBe(1);
    });

    it('Test2', function () {
        expect(2).toBe(2);
    });
});

I get the following result:

Spec started

  Describe Description
     Test1
     Test2

Executed 2 of 12 specs SUCCESS (10 SKIPPED) in 0.068 secs.

Using fit:

describe('Describe Description', function () {

    fit('Test1', function () {
        expect(1).toBe(1);
    });

    it('Test2', function () {
        expect(2).toBe(2);
    });
});

I get the following result:

Spec started

Executed 0 of 12 specs SUCCESS (12 SKIPPED) in 0.003 secs.

It should run the test that I've marked with fit, but it didn't run any test.

@hankduan
Copy link
Contributor

hankduan commented Mar 7, 2015

That's strange. Can you provide the conf file you used as well as provide the result of running this with the --troubleshoot flag so I can see the environment you're on?

@joaomqcunha
Copy link
Author

I found the problem. I still don't know how to solve it but basically, is I remove the JUnitXmlReporter from my onPrepare function it works perfectly:

Spec started

  Describe Description
     Test1

Executed 1 of 12 specs SUCCESS (11 SKIPPED) in 0.032 secs.

I removed the following lines from onPrepare function:

jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter(
        {
            'savePath': './reports/junit',
            'consolidate': true,
            'consolidateAll': false,
            'useDotNotation': true,
            'filePrefix': 'SPEC-'
        }
    ));

Any ideas?

@hankduan
Copy link
Contributor

hankduan commented Mar 8, 2015

There's a very similar issue reported on stack overflow: http://stackoverflow.com/questions/28909947/protractor-fdescribe-and-fit-does-not-work-with-jasmine-reporters.

It looks like the theme is fit + some form of jasmine-reporters (https://github.com/larrymyers/jasmine-reporters)

Can you try running fit with JUnitXmlReporter without protractor (i.e. using raw jasmine)

@mourasman
Copy link

I'm using the same setup as João Cunha (protractor 1.8.0 with jasmine 2.0
and JUnitXMLReporter) and I'm not being able to reproduce this issue...
There must be something else missing here. Please make sure that you're
initializing the reporter with all the valid arguments and double-check
your configs, etc... This is working fine on my machine.

2015-03-08 20:15 GMT+00:00 Hank Duan notifications@github.com:

There's a very similar issue reported on stack overflow:
http://stackoverflow.com/questions/28909947/protractor-fdescribe-and-fit-does-not-work-with-jasmine-reporters
.

It looks like the theme is fit + some form of jasmine-reporters (
https://github.com/larrymyers/jasmine-reporters)

Can you try running fit with JUnitXmlReporter without protractor (i.e.
using raw jasmine)


Reply to this email directly or view it on GitHub
#1908 (comment).

@joaomqcunha
Copy link
Author

Thanks @hankduan, i didn't found anything on stack overflow at the time.

@mourasman: Which version of jasmine-reporters are you using? (I'm using the 2.0.4)

@mourasman
Copy link

The reporter's version is the problem, indeed... I've updated from 0.4.1 to
2.0.4 and it started failing, as well. I recommend reverting to an older
reporter version (do you really need it to be the bleeding edge?) while we
investigate the problem further.

2015-03-09 0:21 GMT+00:00 João Cunha notifications@github.com:

Thanks @hankduan https://github.com/hankduan, i didn't found anything
on stack overflow at the time.

@mourasman https://github.com/mourasman: Which version of
jasmine-reporters are you using? (I'm using the 2.0.4)


Reply to this email directly or view it on GitHub
#1908 (comment).

@joaomqcunha
Copy link
Author

Can you use a jasmine-reporters version lower than 2.0.0 with protractor running with jasmine@2.0?! That's strange!

Can you provide me your way to add the JUnitXmlReporter on the onPrepare function?

@mourasman
Copy link

Using "jasmine-reporters": "0.4.1":

jasmine.getEnv().addReporter(new
jasmine.JUnitXmlReporter('./reports/junit', true, true));

Give this a try and let is know if it worked.

2015-03-09 10:36 GMT+00:00 João Cunha notifications@github.com:

Can you use a jasmine-reporters version lower than 2.0.0 with protractor
running with jasmine@2.0?! That's strange!

Can you provide me your way to add the JUnitXmlReporter on the onPrepare
function?


Reply to this email directly or view it on GitHub
#1908 (comment).

@joaomqcunha
Copy link
Author

It seems that we can run tests with fit and fdescribe on jasmine-reporters@0.4.1.
Although, we didn't get any XML report file and it makes sense, since the jasmine-reporters version have to be, at least, 2.0.0 in order for this to work with jasmine2.

So, I'm gonna open an issue on jasmine-reporters github project, since this problem is not related to protractor.

I think we can close this issue. Thanks guys.

@putermancer
Copy link

I've reproduced the issue and am working to track it down. I'll update this thread when larrymyers/jasmine-reporters#87 is fixed.

@putermancer
Copy link

This is fixed in jasmine-reporters@2.0.5, which was just released.

@hankduan
Copy link
Contributor

hankduan commented Mar 9, 2015

Thanks @bloveridge. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants