From 01bb4cb1a0670c71b3c94a2472eaae9cc9551016 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20M=C3=BCller?= Date: Fri, 16 Nov 2018 15:39:53 +0100 Subject: [PATCH] mgr/dashboard: npm run e2e:dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The new command introduced will make developing e2e tests faster, as Protractor will attach to the running development server that was previously started running 'npm start'. Fixes: https://tracker.ceph.com/issues/37291 Signed-off-by: Stephan Müller --- src/pybind/mgr/dashboard/HACKING.rst | 10 ++++++++++ src/pybind/mgr/dashboard/frontend/package.json | 1 + 2 files changed, 11 insertions(+) diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index afc044582561..09c2bd0799d3 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -153,6 +153,16 @@ Note: When using docker, as your device, you might need to run the script with sudo permissions. +Writing End-to-End Tests +~~~~~~~~~~~~~~~~~~~~~~~~ + +When writing e2e tests you don't want to recompile every time from scratch to +try out if your test has succeeded. As usual you have your development server +open (``npm start``) which already has compiled all files. To attach +`Protractor `__ to this process, instead of +spinning up it's own server, you can use ``npm run e2e -- --dev-server-target`` +or just ``npm run e2e:dev`` which is equivalent. + Further Help ~~~~~~~~~~~~ diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index cd12a536e81a..d3a3aae28d04 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -10,6 +10,7 @@ "test": "jest --watch", "test:ci": "JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter", "e2e": "ng e2e", + "e2e:dev": "ng e2e --dev-server-target", "lint:tslint": "ng lint", "lint:prettier": "prettier --list-different \"{src,e2e}/**/*.{ts,scss}\"", "lint:html": "html-linter --config html-linter.config.json", -- 2.47.3