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

Add ability to run without test param #12

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

agamm
Copy link
Contributor

@agamm agamm commented Nov 15, 2023

Fixes #11

);
}
if (!test) {
return await runTask(task, page, options);
Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

@agamm agamm Nov 15, 2023

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.

Copy link
Owner

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.

Copy link
Contributor Author

@agamm agamm Nov 15, 2023

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

@lucgagan lucgagan merged commit 62f41a3 into lucgagan:main Nov 15, 2023
1 check passed
Copy link

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run without test parameter
2 participants