DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 671 forks source link

Expose remoteChrome.Client types on CDPSession #8228

Closed Klaster1 closed 1 month ago

Klaster1 commented 2 months ago

What is your Scenario?

Thanks to the recent addition of getCurrentCDPSession, direct calls to CDP became much more ergonomic. However, the method returns an unknown, offering no CDP client method completion. This is awkward.

What are you suggesting?

TestCafe already uses "remote-chrome-interface" internally, make the getCurrentCDPSession return remoteChrome.Client instead of unknown.

What alternatives have you considered?

For now, I use a wrapper with explicit type casting:

import type remoteChrome from 'chrome-remote-interface';
export const getCdpClient = async () => (await t.getCurrentCDPSession()) as remoteChrome.Client;
github-actions[bot] commented 2 months ago

Thank you for bringing this enhancement to our attention. We will be happy to look into it. We'll update this thread once we have news. If we do not publish any new comments, it's safe to assume that there are no new updates.