nano / docs
Add fetch artifacts from gitlab and add docs route
Requires
- curl/curl: ~1.9
- laravel/dusk: >=4.0
README
Add to your composer.json:
"repositories": [
{
"type": "vcs",
"url": "https://git.nano.rocks/Kailum/nano-docs-package.git"
}
]
Run composer require --dev nano/docs:dev-master
Make sure your Dusk Test Case extends NanoDocsTestCase
use Nano\Docs\NanoDocsTestCase;
abstract class DuskTestCase extends NanoDocsTestCase
{
...
}
Or contains the following code:
abstract class DuskTestCase extends BaseTestCase
{
protected function newBrowser($driver) {
return new \Nano\Docs\NanoDocsBrowser($driver);
}
...
}
Publish the package config ./artisan vendor:publish
In gitlab .env, add DOCS_SCREENSHOTS=true
On the server, add DOCS=true
, PROJECT_URL
, GITLAB_TOKEN
, DOCS_GITLAB_JOBS
to the .env file
Project url will be similar to: https://git.lab.example/api/v4/projects/{project_id}
Gitlab jobs will be the names of the jobs that gitlab runs (in your gitlab-ci.yml)
Gitlab token: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
To view screenshots from git tests, run ./artisan docs:fetch
on the server and visit /docs (can be changed by setting DOCS_URL in server .env)
To view screenshots from local tests, run ./artisan docs:local
and visit DOCS_URL/local