Skip to content

Commit

Permalink
Add new Makefile commands for Seven, improve Cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Jan 23, 2025
1 parent 830ee60 commit 5fa4c98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 33 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,28 @@ acceptance-server-detached-start: ## Starts test acceptance server main fixture
acceptance-server-detached-stop: ## Stop test acceptance server main fixture in detached mode (daemon)
docker kill plone-client-acceptance-server

######### Seven acceptance tests

.PHONY: seven-acceptance-frontend-dev-start
seven-acceptance-frontend-dev-start: ## Start acceptance frontend in development mode for Seven
$(MAKE) -C "./packages/seven/" acceptance-frontend-dev-start

.PHONY: seven-acceptance-frontend-prod-start
seven-acceptance-frontend-prod-start:: ## Start acceptance frontend in production mode for Seven
$(MAKE) -C "./packages/seven/" acceptance-frontend-prod-start

.PHONY: seven-acceptance-test
seven-acceptance-test: ## Start Cypress in interactive mode for Seven
$(MAKE) -C "./packages/seven/" acceptance-test

.PHONY: seven-ci-acceptance-test
seven-ci-acceptance-test: ## Run cypress tests in headless mode for CI for Seven
$(MAKE) -C "./packages/seven/" ci-acceptance-test

.PHONY: seven-ci-acceptance-test-run-all
seven-ci-acceptance-test-run-all: ## With a single command, start both the acceptance frontend and backend acceptance server, and run Cypress tests in headless mode for Seven
$(MAKE) -C "./packages/seven/" ci-acceptance-test-run-all

# include local overrides if present
-include Makefile.local
-include ../../../Makefile.local
30 changes: 1 addition & 29 deletions packages/seven/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ acceptance-test: ## Start Cypress in interactive mode

.PHONY: ci-acceptance-test
ci-acceptance-test: ## Run cypress tests in headless mode for CI
NODE_ENV=production CYPRESS_API=plone $(NODEBIN)/cypress run --config specPattern='cypress/tests/core/**/*.{js,jsx,ts,tsx}'
NODE_ENV=production CYPRESS_API=plone $(NODEBIN)/cypress run --config specPattern='cypress/tests/core/**/*.{ts,tsx}'

.PHONY: ci-acceptance-test-run-all
ci-acceptance-test-run-all: ## With a single command, start both the acceptance frontend and backend acceptance server, and run Cypress tests in headless mode
Expand Down Expand Up @@ -272,31 +272,3 @@ working-copy-ci-acceptance-test: ## Run Cypress tests in headless mode for CI fo
.PHONY: working-copy-ci-acceptance-test-run-all
working-copy-ci-acceptance-test-run-all: ## With a single command, run the backend, frontend, and the Cypress tests in headless mode for CI for working copy tests
$(NODEBIN)/start-test "make working-copy-acceptance-backend-start" http-get://127.0.0.1:55001/plone "make working-copy-acceptance-frontend-prod-start" http://127.0.0.1:3000 "make working-copy-ci-acceptance-test"

######### Guillotina Acceptance tests

.PHONY: guillotina-acceptance-backend-start
guillotina-acceptance-backend-start: ## Start backend acceptance server for Guillotina tests
docker-compose -f g-api/docker-compose.yml up > /dev/null

.PHONY: guillotina-acceptance-frontend-prod-start
guillotina-acceptance-frontend-prod-start: ## Start acceptance frontend in production mode for Guillotina tests
ADDONS=volto-guillotina PLONE_API_PATH=http://127.0.0.1:8081/db/web RAZZLE_LEGACY_TRAVERSE=true pnpm build && pnpm start:prod

.PHONY: guillotina-acceptance-test
guillotina-acceptance-test: ## Start Cypress in interactive mode for Guillotina tests
NODE_ENV=production CYPRESS_API=guillotina $(NODEBIN)/cypress open --config specPattern='cypress/tests/guillotina/**/*.{js,jsx,ts,tsx}'

.PHONY: guillotina-ci-acceptance-test
guillotina-ci-acceptance-test: ## Run Cypress tests in headless mode for CI for Guillotina tests
NODE_ENV=production CYPRESS_API=guillotina $(NODEBIN)/cypress run --config specPattern='cypress/tests/guillotina/**/*.{js,jsx,ts,tsx}'

.PHONY: guillotina-ci-acceptance-test-run-all
guillotina-ci-acceptance-test-run-all: ## With a single command, run the backend, frontend, and the Cypress tests in headless mode for CI for Guillotina tests
$(NODEBIN)/start-test "make guillotina-acceptance-backend-start" http-get://127.0.0.1:8081 "make guillotina-acceptance-frontend-prod-start" http://127.0.0.1:3000 "make guillotina-ci-acceptance-test"

######### Plone 5 Acceptance tests

.PHONY: plone5-acceptance-backend-start
plone5-acceptance-backend-start: ## Start backend acceptance server for Plone 5 tests
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS5) $(TESTING_ADDONS)' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE5) ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING
1 change: 1 addition & 0 deletions packages/seven/cypress/tests/core/basic/basic.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ describe('Basic Cypress Test', () => {
it('should visit the root URL', () => {
cy.visit('/');
cy.url().should('eq', Cypress.config().baseUrl + '/');
cy.contains('Welcome to Plone 6');
});
});
8 changes: 4 additions & 4 deletions packages/volto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ acceptance-frontend-dev-start: ## Start acceptance frontend in development mode

.PHONY: acceptance-backend-start
acceptance-backend-start: ## Start backend acceptance server
#docker run -it --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)
docker run -it --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)
# Uncomment next line and comment line above to use a custom image with the acceptance server (in case you need to use an specific backend add-on or version)
docker run -it --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) $(TESTING_ADDONS)' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING
# docker run -it --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) $(TESTING_ADDONS)' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING

.PHONY: ci-acceptance-backend-start
ci-acceptance-backend-start: ## Start backend acceptance server in headless mode for CI
#docker run -i --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)
docker run -i --rm -p 55001:55001 $(DOCKER_IMAGE_ACCEPTANCE)
# Uncomment next line and comment line above to use a custom image with the acceptance server (in case you need to use an specific backend add-on or version)
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) $(TESTING_ADDONS)' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING
# docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e ADDONS='$(KGS) $(TESTING_ADDONS)' -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors $(DOCKER_IMAGE) ./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING

.PHONY: acceptance-frontend-prod-start
acceptance-frontend-prod-start: build-deps ## Start acceptance frontend in production mode
Expand Down

0 comments on commit 5fa4c98

Please sign in to comment.