My question is about using jest-puppeteer(or any other tools for integration tests) with next.js and auto deploy feature from now. When one creates a project with nextjs and wants to test it using circleci or any other ci for that matter for every PR, one can use jest-puppeteer for integration tests. Now creates a staging deploy for a PR and provides two links to access this deploy
https:zeit.co/<username>/<project-name>/<commit>https:<branch-name>.<username>.now.shMy question is whether there is a preferred method of how to access these links from one's CI. Sure one can generate the second one. And if there are any good practices about how to go about this? There is also a question about delaying the testing in the CI until now has deployed the PR.
I have not found any examples in your repo and googling around didn't really got me any results. Perhaps this issue can help others too. Thank you!
Hello @antonk52 ,
You have a few very important questions embedded in your text. I hope to answer all of them successfully with the following:
Q: How can I retrieve the URL of my deployment?
_A1:_ You can drop our bot and use GitHub actions to leverage the CLI: OUTPUT="$(now -t <token>)" && echo $OUTPUT. Do notice that this is a DIY solution since it will require a manual setup of workflows.
_A2:_ Doing a call to the API is also a good fit if you want to deal with more levels of customization. Check this here.
_A3:_ We are pushing updated to ZEIT Now so you can better manage staging environments. So it is quite possible we will give you a better experience in the future with "staging URLs".
_PS_ It is not possible to "extract" the URL generated by our BOT, unless you use the GitHub API or other tweaks on GitHub's side.
Q: How do I know if my deployment is READY?
_A: We simply do a pooling to our API in our CLI source code. You can see the endpoint here._
Q: Do you recommend any tools for tests?
_A1: At ZEIT, we use Checkly, which gives you a toolbelt at your disposal._
_A2: Check https://spectrum.chat/zeit/now/how-to-setup-ghost-inspector-with-now-github~d1789606-f719-44a9-9613-99d47485393c as well_
If you have any questions, let me know.
Wow really did not expect such a detailed answer. Thanks a lot, this definitely answers my question
There's also a deploy event as ZEIT Now creates GitHub deployments automatically, so you can trigger GH actions based on that too (using the ZEIT Now GitHub integration).
Most helpful comment
Hello @antonk52 ,
You have a few very important questions embedded in your text. I hope to answer all of them successfully with the following:
Q: How can I retrieve the URL of my deployment?
_A1:_ You can drop our bot and use GitHub actions to leverage the CLI:
OUTPUT="$(now -t <token>)" && echo $OUTPUT. Do notice that this is a DIY solution since it will require a manual setup of workflows._A2:_ Doing a call to the API is also a good fit if you want to deal with more levels of customization. Check this here.
_A3:_ We are pushing updated to ZEIT Now so you can better manage staging environments. So it is quite possible we will give you a better experience in the future with "staging URLs".
_PS_ It is not possible to "extract" the URL generated by our BOT, unless you use the GitHub API or other tweaks on GitHub's side.
Q: How do I know if my deployment is READY?
_A: We simply do a pooling to our API in our CLI source code. You can see the endpoint here._
Q: Do you recommend any tools for tests?
_A1: At ZEIT, we use Checkly, which gives you a toolbelt at your disposal._
_A2: Check https://spectrum.chat/zeit/now/how-to-setup-ghost-inspector-with-now-github~d1789606-f719-44a9-9613-99d47485393c as well_
If you have any questions, let me know.