Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 '\#\#'
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, clever way to get an up-to-date project ready for recording!


.PHONY: all
all: clean vale linkcheck html ## Clean docs build, then run vale and linkcheck, and build html
73 changes: 73 additions & 0 deletions RECORDINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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}',
},
});
```

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.
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevepiercy this is not true, the commands do what you say below, and in the Makefile help.


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to create a page, the example test does that. But the example test was broken. 😞 Fixed in plone/cookieplone-templates#138

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed now, since I created a dedicated Cypress folder in recordings/cypress, the tests are in there. They will use the generated project as baseline to run. It uses the same approach than the Cookieplone setup.

@stevepiercy let's review it together tomorrow.

2 changes: 1 addition & 1 deletion submodules/plone.api
Loading