|
| 1 | +#:[acceptance] |
| 2 | +#:title = Volto Acceptance |
| 3 | +#:description = Acceptance testing for Volto projects using Cypress. |
| 4 | +#:depends = volto.core |
| 5 | +#: |
| 6 | +#:[target.volto-acceptance-backend-start] |
| 7 | +#:description = Start Docker-based Plone acceptance backend. |
| 8 | +#: |
| 9 | +#:[target.volto-acceptance-frontend-dev-start] |
| 10 | +#:description = Start acceptance frontend in development mode. |
| 11 | +#: |
| 12 | +#:[target.volto-acceptance-test] |
| 13 | +#:description = Run Cypress acceptance tests in interactive mode. |
| 14 | +#: |
| 15 | +#:[target.volto-ci-acceptance-test] |
| 16 | +#:description = Run Cypress acceptance tests in headless CI mode. |
| 17 | +#: |
| 18 | +#:[setting.VOLTO_ACCEPTANCE_BACKEND_IMAGE] |
| 19 | +#:description = Docker image for Plone acceptance backend. |
| 20 | +#:default = plone/server-acceptance:6 |
| 21 | +#: |
| 22 | +#:[setting.VOLTO_CYPRESS_CONFIG] |
| 23 | +#:description = Path to Cypress configuration file. |
| 24 | +#:default = cypress.config.js |
| 25 | +#: |
| 26 | +#:[setting.VOLTO_CYPRESS_SPEC_PATTERN] |
| 27 | +#:description = Glob pattern for Cypress test specs. |
| 28 | +#:default = cypress/tests/**/*.{js,jsx,ts,tsx} |
| 29 | + |
| 30 | +############################################################################## |
| 31 | +# volto acceptance |
| 32 | +############################################################################## |
| 33 | + |
| 34 | +.PHONY: volto-acceptance-backend-start |
| 35 | +volto-acceptance-backend-start: |
| 36 | + @echo "Start Plone acceptance backend" |
| 37 | + @docker run -it --rm -p 55001:55001 $(VOLTO_ACCEPTANCE_BACKEND_IMAGE) |
| 38 | + |
| 39 | +.PHONY: volto-acceptance-frontend-dev-start |
| 40 | +volto-acceptance-frontend-dev-start: $(VOLTO_TARGET) |
| 41 | + @echo "Start acceptance frontend in development mode" |
| 42 | + @RAZZLE_API_PATH=http://127.0.0.1:55001/plone pnpm start |
| 43 | + |
| 44 | +.PHONY: volto-acceptance-test |
| 45 | +volto-acceptance-test: $(VOLTO_TARGET) |
| 46 | + @echo "Run Cypress acceptance tests" |
| 47 | + @pnpm --filter @plone/volto exec cypress open \ |
| 48 | + --config-file $(CURRENT_DIR)/$(VOLTO_CYPRESS_CONFIG) \ |
| 49 | + --config specPattern=$(CURRENT_DIR)'/$(VOLTO_CYPRESS_SPEC_PATTERN)' |
| 50 | + |
| 51 | +.PHONY: volto-ci-acceptance-test |
| 52 | +volto-ci-acceptance-test: $(VOLTO_TARGET) |
| 53 | + @echo "Run Cypress CI acceptance tests" |
| 54 | + @pnpm --filter @plone/volto exec cypress run \ |
| 55 | + --config-file $(CURRENT_DIR)/$(VOLTO_CYPRESS_CONFIG) \ |
| 56 | + --config specPattern=$(CURRENT_DIR)'/$(VOLTO_CYPRESS_SPEC_PATTERN)' |
0 commit comments