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

feat: Add @cypress/puppeteer plugin #28370

Merged
merged 24 commits into from
Nov 22, 2023
Merged

Conversation

chrisbreiding
Copy link
Contributor

@chrisbreiding chrisbreiding commented Nov 20, 2023

Additional details

Steps to test

How has the user experience changed?

PR Tasks

Copy link

cypress bot commented Nov 20, 2023

@chrisbreiding chrisbreiding changed the base branch from develop to crb/nohoist-devtools-protocol November 21, 2023 12:37
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clean and great documentation. Just a few comments.

on,
onMessage: {
async switchToTabAndGetContent (browser) {
// ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisbreiding I would probably put an explicit comment here that says you need to now write Puppeteer code to execute what you want. I think someone might copy/paste this and assume it should do what it says. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Addressed in 1d8356a

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this addressed? I don't see an explicit comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch, I had put the comment here but it's a good idea to add it in this spot as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually addressed this time here

npm/puppeteer/README.md Outdated Show resolved Hide resolved
npm/puppeteer/test/unit/retry.spec.ts Outdated Show resolved Hide resolved
Base automatically changed from crb/nohoist-devtools-protocol to develop November 22, 2023 13:19
## yarn

```sh
yarn add @cypress/puppeteer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yarn add @cypress/puppeteer
yarn add @cypress/puppeteer --dev

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed here

- `onMessage` _required_: An object with string keys and function values (see more details [below](#onmessage))
- `puppeteer` _optional_: The `puppeteer` library imported from `puppeteer-core`, overriding the default version of `puppeteer-core` used by this plugin

#### onMessage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to explicitly call out that you can't run cypress commands in the message handlers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I like it. Addressed here


## Compatibility

`@cypress/puppeteer` requires Cypress version 13.6.0 or greater.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add a peerDependency in the package.json for this requirement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Addressed here

@chrisbreiding chrisbreiding merged commit b34d145 into develop Nov 22, 2023
5 checks passed
@chrisbreiding chrisbreiding deleted the issue-28023-cy-puppeteer branch November 22, 2023 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a puppeteer plugin
3 participants