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

Accessing to the 'visible' property of the Selector shouldn't interrupt a test execution #2386

Closed
miherlosev opened this issue May 10, 2018 · 5 comments · Fixed by amalsgit/testcafe-curr-conveter#16
Assignees
Labels
AREA: server FREQUENCY: level 2 STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@miherlosev
Copy link
Collaborator

See example to reproduce

import { Selector } from 'testcafe';

fixture `Fixture`
	.page('https://devexpress.github.io/testcafe/example/');
	
test('i2383', async t => {
		const dummySelecotor = Selector('.dummy-class');
		
// Fails here
>		if (await dummySelecotor.visible) { 
			console.log('Wrong!! Dummy Selector is visible');
		} else {
			console.log('Executed `else` statement');
		}
});	

The test will interrupt with message 'Cannot obtain information about about the node because....'.
If I will change the await dummySelecotor.visible to await dummySelecotor.exists it works as expected.

  • testcafe version: 0.20.0
@miherlosev miherlosev added TYPE: bug The described behavior is considered as wrong (bug). AREA: server labels May 10, 2018
@miherlosev miherlosev added this to the Sprint #12 milestone May 10, 2018
@AndreyBelym AndreyBelym added this to Needs triage in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym moved this from Needs triage to Hammerhead in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym moved this from Hammerhead to Server in Bugs triage Jul 13, 2018
@AndreyBelym AndreyBelym added TYPE: enhancement The accepted proposal for future implementation. and removed TYPE: bug The described behavior is considered as wrong (bug). labels Aug 30, 2018
@AndreyBelym AndreyBelym changed the title Accessing to the 'visible' property of the Selector for non-existing element interrupts a test execution Accessing to the 'visible' property of the Selector shouldn't interrupt a test execution Aug 30, 2018
@AndreyBelym AndreyBelym added this to Bug-like in Enhancements processing Mar 1, 2019
@AndreyBelym AndreyBelym removed their assignment Aug 22, 2019
@noamaankhan
Copy link

noamaankhan commented Aug 28, 2019

@LavrovArtem By when do you think this issue would be addressed? In the mean time is there an alternative way to work around this? How can I contribute?
We just moved from Puppeteer to TestCafe in our project for I found it easier and offering out-of-box solutions to almost every problem we intended to address (parallel test runs, request mocking, multi-browser support, debugging ability to name a few).
So I want to be able to contribute as this would help my project.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Aug 28, 2019
@miherlosev miherlosev self-assigned this Aug 29, 2019
@miherlosev
Copy link
Collaborator Author

Hi @noamaankhan

We cannot provide you with precise time estimation. If this feature is important for you, the pull request would be appreciated. For more information, refer to the Contribution guide section in our documentation.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Aug 29, 2019
@SacredSkull
Copy link

I may be interested in providing a PR for this. I'm struggling with this issue due to a loader element disappearing after an exists check.

Basically the following:

function waitForElementToDisappear(selector) {
    while (maxPollingChecksEtc && await selector.exists) {
        --- element disappears here ---
        let invisible = !await selector.visible; // test ends because visible depends on element existence (not sure why it does!)
        if (invisible) break;
        await t.sleep(pollDelay)
    }
}

In my opinion, an element that does not exist is not visible - and calling visible on an inexistant element should not throw an error.

If backwards compatibility is a concern, perhaps some Selector {} option that will make visible return false in this case (perhaps called relaxedVisibilityChecks)?

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 20, 2019
@AlexKamaev
Copy link
Contributor

@SacredSkull
I agree with you. If the element does not exist, this means that it is not visible and the error should not be thrown.
I think we do not need any additional options for this.
Your PR will be appreciated.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 23, 2019
@miherlosev miherlosev modified the milestones: Planned, Sprint #53 Mar 23, 2020
Bugs triage automation moved this from Server to Closed Mar 27, 2020
Enhancements processing automation moved this from Bug-like to Closed Mar 27, 2020
@lock
Copy link

lock bot commented Apr 15, 2020

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 Apr 15, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: server FREQUENCY: level 2 STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: API TYPE: enhancement The accepted proposal for future implementation.
Projects
Bugs triage
  
Closed
6 participants