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

With test_runner mocha, describe.only and it.only not excluding other tests #1437

Closed
kentendo opened this issue Apr 13, 2017 · 4 comments
Closed

Comments

@kentendo
Copy link

kentendo commented Apr 13, 2017

.only() does not seem to be working. The 'has button one' and 'had button two' tests both run although 'has button one' should be run exclusively.

describe('my page', () => {
  describe.only('my buttons', () => {
    it.only('has button one', (client) => {
      client
        .url('http://localhost:3000')
        .expect.element('#one').to.be.present.before(1000);
    });
    it('has button two', (client) => {
      client
        .url('http://localhost:3000')
        .expect.element('#two').to.be.present.before(1000);
    });
  });
  describe('other buttons', () => {
    it('has button three', (client) => {
      client
        .url('http://localhost:3000')
        .expect.element('#three').to.be.present.before(1000);
    });
  });
});

Node Version: 6.9.5
Nightwatch Version: 0.9.14
Mac OS: 10.12.2
Chrome: 57

@ocmyhome
Copy link

I have this same problem!

@kentendo kentendo changed the title With test_runner mocha, describe.only and it.only not working With test_runner mocha, describe.only and it.only not excluding other tests Apr 17, 2017
@mrjamesriley
Copy link

This issue has only just appeared in the latest version of Nightwatch (0.9.14).
As a temporary solution, I'd recommend downgrading to version 0.9.13.


I'm not familiar enough with the codebase yet to see what's happening here.
But some pointers to help narrow down the issue:

.only( ) is not working with Nightwatch v0.9.14
But it is working with the version just before: v0.9.13

Nightwatch v0.9.14 depends on mocha-nightwatch 3.2.1
where as Nightwatch v0.9.13 depends on mocha-nightwatch 2.2.9

Mocha-nightwatch 3.2.1 merged Mocha 3.2.0
Mocha-nightwatch 2.2.9 is based on Mocha 2.2.5

It seems the issue here is that version 3 of Mocha brought about significant changes, for which the overriden Runner.js or Runnable.js of Mocha-nightwatch will need to be updated to reflect this, to bring back support for only().

@beatfactor
Copy link
Member

beatfactor commented Apr 27, 2017

I'll look into it and post a fix soon, sorry for the inconvenience.

@beatfactor
Copy link
Member

Should be fixed in v0.9.15.

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

No branches or pull requests

4 participants