Skip to content

describe.only() does not work when string is the same as another describe() block #5345

@c32hedge

Description

@c32hedge

Current behavior:

If you have multiple describe blocks with the same description string, marking one of them with describe.only will run all describe blocks with the same description instead of just the one with .only:

image

Desired behavior:

Marking a describe block with .only should "only" run that describe block, not others with the same description.

Steps to reproduce: (app code and test code)

Run the following spec:

describe('outer describe', () => {
  describe('inner describe', () => {
    it('works', () => {});
  });

  describe.only('inner describe', () => {
    it('works again', () => {});
  });

  describe('unique name', () => {
    it('still works', () => {});
  });

  describe('inner describe', () => {
    it('works yet again', () => {});
  });
});

Instead of just running one test with the description "works again", three tests are executed, in all three describe('inner describe'...) blocks.

Versions

Cypress 3.4.1
Ubuntu 18.04
Chrome 77

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions