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

chore: Refactor chainer / Commands.add for readability #22571

Merged
merged 2 commits into from Jun 29, 2022

Conversation

BlueWinds
Copy link
Contributor

User facing changelog

No user-facing changes.

Additional details

This PR is the first of hopefully several with some cleanup and refactoring of a very hard to read and central part of our code base: How commands are added, queued, and executed.

There are no functional changes. The code is logically identical - but hopefully easier to read, with less internal state tracking and passing around of variables "to be used at some later point."

Steps to test

All cypress tests execute identically. The CI build passing without test changes should show this well enough, but feel free to manually play with it as well.

How has the user experience changed?

UX is unchanged. DX, reading this code, should be far better.

PR Tasks

  • [n/a] Have tests been added/updated? No test changes, because new code is functionally equivalent.
  • [n/a] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?

@BlueWinds BlueWinds requested a review from a team as a code owner June 28, 2022 19:36
@BlueWinds BlueWinds requested review from emilyrohrbough and removed request for a team June 28, 2022 19:36
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 28, 2022

Thanks for taking the time to open a PR!

@flotwig flotwig self-requested a review June 29, 2022 14:50
@cypress
Copy link

cypress bot commented Jun 29, 2022



Test summary

4904 0 63 0Flakiness 0


Run details

Project cypress
Status Passed
Commit d3aef86
Started Jun 29, 2022 3:03 PM
Ended Jun 29, 2022 3:18 PM
Duration 14:24 💡
OS Linux Debian - 10.11
Browser Firefox 98

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

Nice! Love to see cleanup in this area. It's a 🐻

@BlueWinds BlueWinds merged commit d378ec4 into develop Jun 29, 2022
@BlueWinds BlueWinds deleted the issue-7306-addSelector branch June 29, 2022 19:43
return null
addSelector (name, fn) {
// TODO: Add overriding stuff.
return cy.addSelector(name, fn)
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, whoops, slight code-splatter here, had meant to remove this before committing. I'll clean it up in an upcoming refactor. Not used yet, shouldn't be in yet. Same with selectorFns below.

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.

None yet

3 participants