From d234fd6d9ccead6261d1733dc66f9ec36aca6c49 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 9 Dec 2024 01:22:44 -0800 Subject: [PATCH 1/3] Recording videos and images for documentation - Initialize and install environment - Run servers --- Makefile | 6 +++++ RECORDINGS.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 RECORDINGS.md diff --git a/Makefile b/Makefile index 90cefa23e..b4a5b4ae1 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . VALEFILES := $(shell find -L $(DOCS_DIR) -type d \( -path $(DOCS_DIR)/plone.restapi/lib/* -o -path $(DOCS_DIR)"/plone.restapi/performance/*" \) -prune -false -o -type f -name "*.md" -print) +RECORDINGS = ./recordings # Add the following 'help' target to your Makefile # And add help text after each target name starting with '\#\#' @@ -246,5 +247,10 @@ rtd-pr-preview: ## Build pull request preview on Read the Docs storybook: cd submodules/volto && pnpm i && pnpm build:registry && pnpm --filter @plone/volto build-storybook -o ../../../../_build/html/storybook +.PHONY: recording-init ## Initializes the image and video recording environment +recording-init: + mkdir "$(RECORDINGS)" && cd "$(RECORDINGS)" && pipx run cookieplone --no-input project + cd "$(RECORDINGS)/project-title" && make install + .PHONY: all all: clean vale linkcheck html ## Clean docs build, then run vale and linkcheck, and build html diff --git a/RECORDINGS.md b/RECORDINGS.md new file mode 100644 index 000000000..abac7e13b --- /dev/null +++ b/RECORDINGS.md @@ -0,0 +1,65 @@ +# Recordings + +This file describes the steps needed to set up an environment to record images and videos for Plone 6 Documentation. + + +## Set up the environment + +Open a terminal session and issue the following command. + +```shell +make recording-init +``` + +The command will run Cookieplone, generator a project, and install it. + +Next edit the file `recordings/project-title/frontend/cypress.config.js`, inserting the emphasized line. + +```{code-block} js +:emphasize-lines: 11 +const { defineConfig } = require('cypress'); + +module.exports = defineConfig({ + viewportWidth: 1280, + viewportHeight: 1280, + retries: { + runMode: 3, + }, + e2e: { + baseUrl: 'http://localhost:3000', + experimentalStudio: true, + specPattern: 'cypress/tests/**/*.cy.{js,jsx,ts,tsx}', + }, +}); +``` + +Now you will start the backend, frontend, and acceptance test servers, one each in its own terminal session. + +In the current session, issue the following command to start the backend server. + +```shell +make acceptance-backend-dev-start +``` + +In the second session, issue the following command to start the frontend server. + +```shell +make acceptance-frontend-dev-start +``` + +In the third session, issue the following command to start the acceptance test server. + +```shell +make acceptance-test +``` + +A new browser window will pop up. + +Select {guilabel}`E2E Testing`. + +Select {guilabel}`Chrome`, because it is the only browser that supports Cypress Studio. + +Click {guilabel}`Start E2E Testing in Chrome`. + +And that's pretty much as far as I got. +Even though I created a page, `/document`, and ran the sample test, it failed. From 7690765345088f0c271d846c31b4334083e5440a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 9 Dec 2024 02:59:28 -0800 Subject: [PATCH 2/3] Add step to copy tests from volto clone to project and note about commands. --- RECORDINGS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RECORDINGS.md b/RECORDINGS.md index abac7e13b..09253a702 100644 --- a/RECORDINGS.md +++ b/RECORDINGS.md @@ -33,8 +33,16 @@ module.exports = defineConfig({ }); ``` +Copy all the tests from {file}`submodules/volto/packages/volto/cypress` to {file}`recordings/project-title/frontend/cypress` so you have something to start from. + Now you will start the backend, frontend, and acceptance test servers, one each in its own terminal session. +```{note} +None of these commands are documented anywhere. +You could run `make help`, and get a dump of the commands, but that lacks context for usage. +See https://github.com/plone/documentation/issues/1758. +``` + In the current session, issue the following command to start the backend server. ```shell From 7fb9b2e5cc719d352bb4e5288e8acb19292ae9d7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 9 Dec 2024 14:34:57 -0800 Subject: [PATCH 3/3] Update tips submodules/plone.api submodules/volto --- submodules/plone.api | 2 +- submodules/volto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/plone.api b/submodules/plone.api index 0526ecddd..a6145e06a 160000 --- a/submodules/plone.api +++ b/submodules/plone.api @@ -1 +1 @@ -Subproject commit 0526ecddd21ba08a3a8753cf1a2ca4611750d2b3 +Subproject commit a6145e06a8a6d4c7fd68f0b87ddea68213d4a979 diff --git a/submodules/volto b/submodules/volto index cfea4d988..0987c96db 160000 --- a/submodules/volto +++ b/submodules/volto @@ -1 +1 @@ -Subproject commit cfea4d988d25e41779b0742606bf43fa43d2bbee +Subproject commit 0987c96dbc4597b8ab36009af4e4bfa125f123ec