-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add ability to run without test param #12
Conversation
); | ||
} | ||
if (!test) { | ||
return await runTask(task, page, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the intent here. You are marking test
as optional, but then failing if it is not provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not failing, it runs the runTask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition here is to run the flow without the test
param, (it returns the result immediately before the flow with the test
usage a few lines after).
I've tested it locally and it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Sorry, misread. Hm. What's the reason for this change?
Like.. why do you want it? I am thinking this will backfire if I need to access test
in order to log steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. I need this mainly to use playwright as a browser automation tool. Eg, not in a test scenario. This can be really useful to interact with websites using a real browser.
I get that it could be a bit annoying with logs for test
, might I suggest to create a log helper function that will fail silently or log somewhere else if the test param is undefined? That way both with work. And it will be easy to maintain and add logs.
If you don't add this I'll have to fork/create a new repo for it and we would have duplicated code and maintenance. I really liked your work so I decided to fork and work from what you created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an example to the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thank you for the added context. Just waiting for checks to pass and will release.
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #11