mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Docs: Edit of 4 files in contribute/style-guides * Respond to review question * Fix unordered list * Update contribute/style-guides/e2e-core.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update contribute/style-guides/e2e-core.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update contribute/style-guides/e2e-core.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Fix title * Prettier fixes --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
1.6 KiB
1.6 KiB
End-to-end tests for core Grafana
This guide explains how to conduct end-to-end tests for the Grafana repository. Ensure that you've read the generalized E2E document.
Commands
yarn e2e
: Creates an isolatedgrafana-server
home under\<repo-root>/e2e/tmp
with provisioned data sources and dashboards. This makes a local copy of the build binary and frontend assets from your repository root so you need to have a built backend and frontend. The server starts on port3001
so it does not conflict with your normal dev server.yarn e2e:debug
: Same as previous but runs the tests in Chrome and doesn't shut down after completion.yarn e2e:dev
: Same as previous but does not run any tests on startup. It lets you pick a test first.
If you already have a Grafana instance running, you can provide a specific URL by setting the BASE_URL
environment variable:
BASE_URL=http://172.0.10.2:3333 yarn e2e
The previous commands use some utils
scripts under <repo-root>/e2e that you can also use for more control.
./scripts/grafana-server/start-server
: This creates a new Grafana server working directory, sets up configuration. and starts the server. It also kills any previously started server that is still running using thepid
file at\<repo-root>/scripts/grafana-server/tmp/pid
../scripts/grafana-server/wait-for-grafana
: waits for$HOST
and$PORT
to be available. Per defaultlocalhost
and3001
../e2e/run-suite <debug|dev|noarg>
: Starts Cypress in different modes.
Test suites
You can find integration tests at \<repo-root>/e2e/suite\<x>/specs
.