Skip to content

feat: add HTML expectation - #23

Draft
kbond wants to merge 1 commit into
zenstruck:1.xfrom
kbond:html-assertions
Draft

feat: add HTML expectation#23
kbond wants to merge 1 commit into
zenstruck:1.xfrom
kbond:html-assertions

Conversation

@kbond

@kbondkbond commented Apr 5, 2023

Copy link
Copy Markdown
Member

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

@kbondkbond added the enhancement New feature or request label Apr 5, 2023
@kbond
kbond requested a review from nikophilApril 5, 2023 16:59
@kbond
kbondforce-pushed the html-assertions branch 9 times, most recently from 432a48e to 3cba1cdCompareApril 5, 2023 17:40

@nikophilnikophil left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Development

Successfully merging this pull request may close these issues.

2 participants

@kbond@nikophil