Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CustomLocator plugin takes all selector as key

Open
#2,924 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
testing-qa

Research direction

Reproduce the two I.click examples from the issue with the customLocator plugin enabled. Trace the plugin's selector handling, then add regression coverage for a custom locator followed by a CSS suffix; done means the suffix is preserved and the resulting element can be clicked.

Written by the indexing model from the issue text.

Description

bug plugin
What are you trying to achieve?

I'd like to use a custom locator and a suffix css selector

What do you get instead?

Instead of concatening the custom locator and the end of the css selector, I've got a full length of customLocator

Provide test source code if related

// What I want to achieve:
 I.click('[data-testid=register_button] option:first-child()');
// ==> gives OK

// When using the custom locator:
 I.click('$register_button option:first-child()');
// ==> gives     [1] <pause> Error | Error: Clickable element ".//*[@data-testid='register_button option:first-child()']" was not found by text|CSS|XPath
Details
  • CodeceptJS version: 3.0.5
  • NodeJS Version: 14.16
  • Operating System: Linux
  • Configuration file:
plugins: {
        allure: {},
        pauseOnFail: {},
        customLocator: {
            enabled: true,
            attribute: 'data-testid',
            showActual: true,
        },
    },

Would it be possible to add a new option like 'final delimiter'? (space by default) It would truncate the locator to be used?

Dominant language
JavaScript
Stars
4.2k
Forks
756
Avg merge
2d 9h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codeceptjs/CodeceptJS

All issues in codeceptjs/CodeceptJS

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.