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 HTML expectation #23

Draft
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Draft

Conversation

kbond
Copy link
Member

@kbond kbond commented Apr 5, 2023

I've created a new zenstruck/assert-html package which is like a plugin for this library to make html assertions. I've extracted this code from zenstruck/browser and will create a followup PR there to utilize this new library. edit: doing this created more complexity than I liked. Additionally, this new package will allow zenstruck/mailer-test#1.

Some notes:

  1. I created as a separate package because of the mink/dom-crawler deps.
  2. At some point I'll move the maintenance here and zenstruck/assert-html will be a readonly sub-tree split.
  3. There is quite a bit of duplication between the mink driver in the plugin and browser which is unfortunate. When/if it becomes a problem, I can move to a separate package.

TODO:

  • wait for 1.0 release of zenstruck/assert-html

@kbond kbond added the enhancement New feature or request label Apr 5, 2023
@kbond kbond requested a review from nikophil April 5, 2023 16:59
@kbond kbond force-pushed the html-assertions branch 9 times, most recently from 432a48e to 3cba1cd Compare April 5, 2023 17:40
@kbond kbond force-pushed the html-assertions branch from 3cba1cd to a0733cc Compare April 5, 2023 17:44
Copy link
Member

@nikophil nikophil left a comment

Choose a reason for hiding this comment

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

👌 LGTM

for my information, what was the complexity of using these html expectations in zenstruck/browser. It feels like thos packages could be compatible

jobs:
tests:
uses: zenstruck/.github/.github/workflows/php-test.yml@main
Copy link
Member

Choose a reason for hiding this comment

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

why have you decided to stop using the shared actions?

Copy link
Member Author

Choose a reason for hiding this comment

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

env variables aren't passed down to shared actions.

Copy link
Member

Choose a reason for hiding this comment

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

if you need this behavior more than once, I'm pretty sure there is some hackto do to pass envs from workflow to external action

@kbond
Copy link
Member Author

kbond commented Apr 13, 2023

I actually have an alternative system I'm cooking up. Stay tuned :)

@kbond kbond marked this pull request as draft April 13, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants