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

An error appeared when try to get a non-existent child by index #1240

Closed
AlexanderMoskovkin opened this issue Feb 15, 2017 · 3 comments
Closed
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: reporting SYSTEM: runner TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

AlexanderMoskovkin commented Feb 15, 2017

Are you requesting a feature or reporting a bug?

bug

What is the current behavior?

Function that specifies a selector can only return a DOM node, an array of nodes, NodeList, HTMLCollection, null or undefined. Use ClientFunction to return other values error is appeared

What is the expected behavior?

Should return a Selector instance that returns false for await element.exists

How would you reproduce the current behavior (if this is a bug)?

run the test

Provide the test code and the tested page URL (if applicable)

Tested page URL:
any. For example:
https://testcafe-discuss.devexpress.com/

Test code

import { Selector } from 'testcafe';

fixture `Example`
    .page `https://testcafe-discuss.devexpress.com/`;
    

test('Example', async t => {
    const btn = Selector('#main').child(2);
    
    console.log(await btn.exists);
});

Specify your

  • testcafe version: 0.13.0-alpha2
@AlexanderMoskovkin AlexanderMoskovkin added SYSTEM: reporting SYSTEM: runner TYPE: bug The described behavior is considered as wrong (bug). labels Feb 15, 2017
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #5 milestone Feb 15, 2017
@AlexanderMoskovkin AlexanderMoskovkin changed the title Incorrect error when try to non-existent child via Selector Incorrect error when try to get a non-existent child via Selector Feb 15, 2017
@p-bakker
Copy link

Should it raise an error at all? Shouldn't it just return a Selector instance that returns false when you call .exists on it?

@AlexanderMoskovkin
Copy link
Contributor Author

You are right. I've updated the initial post

@AlexanderMoskovkin AlexanderMoskovkin changed the title Incorrect error when try to get a non-existent child via Selector An error appeared when try to check a non-existent child via Selector Feb 22, 2017
@AlexanderMoskovkin AlexanderMoskovkin changed the title An error appeared when try to check a non-existent child via Selector An error appeared when try to get a non-existent child by index Feb 22, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Feb 22, 2017
AlexanderMoskovkin added a commit to AlexanderMoskovkin/testcafe that referenced this issue Feb 22, 2017
@AlexanderMoskovkin AlexanderMoskovkin self-assigned this Feb 22, 2017
@lock
Copy link

lock bot commented Mar 29, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 29, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: reporting SYSTEM: runner TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants