question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing complex element, how to get it's state?

See original GitHub issue

What are you trying to achieve?

I would like to test our video player integration. But I am strugeling, due inability to find any documentation. For example how to get Element.

I need the element to be able to access to element, I need to test, that pausing really paused the video etc…

What do you get instead?

Headache… I have on idea where to look. I tried to make a helper:

'use strict';
//@ts-check

class VideoHelper extends Helper {
	async _getVideo() {
		return this.helpers.Puppeteer._locate(`.videojs video`);
	}

	async seeVideoIsPaused() {
		const video = await this._getVideo();
		console.log(video);
	}
}

module.exports = VideoHelper;

Details

  • CodeceptJS version: 1.3.3
  • NodeJS Version: 9.11.1
  • Operating System: Win / Linux
  • Puppeteer (using original chrome, but chromium ain’t any better)
  • Configuration file:
# paste suite config here

PS: class Helper don’t have any definition, this could be possibly improved.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Akxecommented, Sep 12, 2018

My bad this can be closed, but I still think class Helper need some type definition. @LukoyanovE I can not, it is in internal site only.

0reactions
Akxecommented, Sep 18, 2018

I already did, but I haven’t gotten any response to it yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Components – Testing Angular
Testing complex forms ... It talks to Services or other state managers. ... In our test, we need to find this element and...
Read more >
Basics of testing components - Angular
But many components have complex interactions with the DOM elements described in their templates, causing HTML to appear and disappear as the component...
Read more >
Unit Tests, How to Write Testable Code, and Why It Matters
Verifying that the system under test produces correct results, or that its resulting state is correct, is called state-based unit testing, while verifying ......
Read more >
React Testing Library Tutorial #12 - Finding Async ... - YouTube
React Testing Library Tutorial #12 - Finding Async Elements with FindBy ... Get access to extra premium courses on Net Ninja Pro: ...
Read more >
How to Write Test Cases: The Ultimate Guide with Examples
Tutorial #10: State Transition Testing Technique ... #1) Keep it simple but not too simple; make it complex, but not too complex ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found