diff --git a/docs/mastering-plone/add-ons.md b/docs/mastering-plone/add-ons.md index 084b87a67..ffbd0c688 100644 --- a/docs/mastering-plone/add-ons.md +++ b/docs/mastering-plone/add-ons.md @@ -141,7 +141,7 @@ Running `make build` has three effects: So an add-on can be enabled per Plone instance. ```{seealso} -Documentation {doc}`plone6docs:manage/backend` +Documentation {doc}`plone6docs:admin-guide/add-ons` ``` ### Enabling add-ons in your Plone site diff --git a/docs/mastering-plone/case.md b/docs/mastering-plone/case.md index b666ab813..8cf4ba730 100644 --- a/docs/mastering-plone/case.md +++ b/docs/mastering-plone/case.md @@ -4,7 +4,7 @@ myst: "description": "Our training story" "property=og:description": "Our training story" "property=og:title": "The Case Study" - "keywords": "" + "keywords": "Plone, training" --- (case-label)= diff --git a/docs/mastering-plone/events.md b/docs/mastering-plone/events.md index dfcbbc4cc..bcc7e0ddc 100644 --- a/docs/mastering-plone/events.md +++ b/docs/mastering-plone/events.md @@ -81,7 +81,7 @@ While we're editing behaviors we can also add our own featured-behavior to News Add {file}`profiles/default/types/News_Item.xml`: -``` +```xml diff --git a/docs/mastering-plone/installation.md b/docs/mastering-plone/installation.md index f536215d9..caaecbcc0 100644 --- a/docs/mastering-plone/installation.md +++ b/docs/mastering-plone/installation.md @@ -11,7 +11,7 @@ myst: This chapter provides instructions on how to install **Plone with the training code**. -For installation, deployment and hosting of Plone in general, see {ref}`Installation` on `docs.plone.org`. +For installation, deployment and hosting of Plone in general, see {doc}`plone6docs:admin-guide/index` on `docs.plone.org`. (installation-tools-label)= @@ -83,7 +83,7 @@ By creating and working with a **Python virtual environment**, we are independen The build generates a file structure to be prepared to install **Plone from packages** with `pip` and `mxdev`. The tool `mxdev` helps with configuration files to define which add-ons and which versions to install. It also allows to override Plone core package versions or force a checkout from `github`. -The documentation {doc}`plone6docs:manage/backend` provides information on common tasks. +The documentation {doc}`plone6docs:admin-guide/add-ons` provides information on common tasks. The build generates **Zope configuration** files with Cookiecutter `cookiecutter-zope-instance`. The file we will modify to update our Zope / Plone configuration is `instance.yaml`. diff --git a/docs/mastering-plone/volto_testing.md b/docs/mastering-plone/volto_testing.md index fe839b05a..886e8bd4b 100644 --- a/docs/mastering-plone/volto_testing.md +++ b/docs/mastering-plone/volto_testing.md @@ -99,7 +99,7 @@ make test See the snapshot in folder `__snapshots__`. If this is a rendering you expect, you are good to go. -For example you see that the heading is the talk title with preceding type. +For example you see that the heading is the talk title with preceding type of talk. {file}`packages/volto-ploneconf/src/components/Views/__snapshots__/Talk.test.js.snap` @@ -150,6 +150,10 @@ exports[`renders a talk view component with only required props 1`] = ` `; ``` +```{seealso} +{doc}`plone6docs:volto/contributing/testing` in docs.plone.org. +``` + (testing-cypress)= ## Testing permissions, features and user interface topics @@ -160,22 +164,34 @@ The following simple test checks if an editor can add an instance of the custom The test mimics the editor visiting her site and adding a talk via the appropriate menu action. -**Prerequisites**: - -{ref}`Install docker` - Create a test file {file}`cypress/tests/content.cy.js` ```{code-block} js -:emphasize-lines: 3-4,8 , 25-28 +:emphasize-lines: 4, 18, 23, 40 +:linenos: -describe('talk tests', () => { +describe('content type tests', () => { beforeEach(() => { - // Login as editor - cy.autologin(); + cy.intercept('GET', `/**/*?expand*`).as('content'); + cy.createUser({ + username: 'editor', + fullname: 'Editor', + roles: ['Member', 'Reader', 'Contributor'], + }); + cy.visit('/'); + cy.wait('@content'); }); + + afterEach(() => { + cy.removeUser('editor', 'password'); + }); + it('As editor I can add a talk.', function () { + cy.autologin('editor', 'password'); + cy.visit('/'); + cy.wait('@content'); + // when I add a talk with title, type and details cy.get('#toolbar-add').click(); cy.get('#toolbar-add-talk').click(); @@ -201,14 +217,16 @@ describe('talk tests', () => { }); ``` -With a simple test file you would be good to go with a frontend package that doesn't rely on a backend package. -You could proceed with {ref}`testing-cypress-run`. +With a frontend package NOT relying on a backend package, you could proceed with next step {ref}`testing-cypress-run`. + +### Preparing acceptance backend with add-ons -For a test like this with talks, the acceptance backend needs the backend package with content type talk to be installed. +For a test like above, with talks, the acceptance backend needs the backend package with content type talk to be installed. -Have a look at the code and see `docker compose` used to assemble a backend with the package `ploneconf-site` installed. -The Dockerfile instructs docker to install the package from the main branch of its repository. -So you can proceed with development of the backend package while working on the frontend package. +Have a look at `/frontend/backend/`, where a backend with the add-on `ploneconf-site` is configured. +The configuration instructs to install the package from its repository and editable. +So you can proceed developing the backend package while working on the frontend package. +Necessary changes of the backend package while developing the couple of backend add-on and frontend add-on can be committed right out of `/frontend/backend/sources/ploneconf.site`. (testing-cypress-run)= @@ -224,33 +242,34 @@ All sessions should start from the `frontend` directory. 1. In the first session, start the backend server. ```shell + make backend-install make acceptance-backend-start ``` -2. In the second session, start the frontend server. +1. In the second session, start the frontend server. ```shell make acceptance-frontend-dev-start ``` -3. In the third session, start the Cypress tests runner. +1. In the third session, start the Cypress tests runner. ```shell make acceptance-test ``` -4. In the Cypress pop-up test style, choose `E2E Testing`, since Volto's tests are end-to-end tests. +1. In the Cypress pop-up test style, choose `E2E Testing`, since Volto's tests are end-to-end tests. -5. In the next section, select the browser you want Cypress to run in. +1. In the next section, select the browser you want Cypress to run in. Although the core tests use `headless Electron` by default, you can choose your preferred browser for the tests development. -6. In the main Cypress runner section, you will see all test specs. +1. In the main Cypress runner section, you will see all test specs. -7. To run a test, interact with the file based tree that displays all possible tests to run, and click on the test spec you want to run. +1. To run a test, interact with the file based tree that displays all possible tests to run, and click on the test spec you want to run. -Have a look in the code of `volto-ploneconf` to see that the continuous integration includes these cypress tests: `.github/workflows/acceptance.yml` +Have a look in the code of `volto-ploneconf` to see that the continuous integration includes these cypress tests: `.github/workflows/acceptance.yml`. Commits to pull requests trigger a run of the tests. -```{note} -Find helper functions for an auto login, create content, etc. from [Volto](https://github.com/plone/volto/tree/main/packages/volto/cypress/support). +```{seealso} +Helper functions for an auto login, creating content, etc. from [Volto](https://github.com/plone/volto/tree/main/packages/volto/cypress/support). ``` diff --git a/docs/mastering-plone/voting-story/index.md b/docs/mastering-plone/voting-story/index.md index 96a90c249..5b0a3671d 100644 --- a/docs/mastering-plone/voting-story/index.md +++ b/docs/mastering-plone/voting-story/index.md @@ -37,7 +37,6 @@ The jury votes for talks to be accepted or rejected. --- name: toc-voting-story maxdepth: 2 - numbered: 1 --- behaviors_2 @@ -158,7 +157,7 @@ module.exports = { }; ``` -Be sure keep the main package at the end of the array `addons`. +Be sure keep the main (project policy) package at the end of the array `addons`. By this the main package can override add-ons configurations. Check {file}`packages.json` to include the add-on in your app: