From b99f952b6f6e8efda0aec3ae9455cfa0f7de8378 Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 12 Dec 2024 15:30:02 +0200 Subject: [PATCH 01/14] Cypress-toolkit make commands. --- make/qa.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/make/qa.mk b/make/qa.mk index f4988fb..320a128 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -71,3 +71,15 @@ define cs $(call warn,CodeSniffer is not installed!) endef endif + +PHONY += cypress-init +cypress-init: ## Init cypress + $(call step,Adding cypress-toolkit to the project...\n) + @git submodule add git@github.com:druidfi/cypress-toolkit.git + +PHONY += cypress-run-tests +cypress-run-tests: ## Run cypress tests + @cd tests && \ + chmod u+x $(NVM_SH) && \ + $(NVM_SH) use $(NODE_VERSION) && \ + npx cypress run From 638016ff9a165b60ead5ece389cfa3651da188ce Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Thu, 12 Dec 2024 16:53:09 +0200 Subject: [PATCH 02/14] Cypress project tests --- make/qa.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/make/qa.mk b/make/qa.mk index 320a128..a555da5 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -4,6 +4,10 @@ LINT_PHP_TARGETS := CS_INSTALLED := $(shell test -f $(COMPOSER_JSON_PATH)/vendor/bin/phpcs && echo yes || echo no) CS_CONF_EXISTS := $(shell test -f phpcs.xml.dist && echo yes || echo no) TESTSUITES ?= unit,kernel,functional +CYPRESS_DIR = cypress-toolkit +CYPRESS_SETUP = $(shell test -d $(CYPRESS_DIR) && echo yes || echo no) +CYPRESS_PROJECT_TESTS_DIR = tests +CYPRESS_PROJECT_TESTS = $(shell test -d $(CYPRESS_PROJECT_TESTS_DIR) && echo yes || echo no) PHONY += fix fix: ## Fix code style @@ -79,7 +83,13 @@ cypress-init: ## Init cypress PHONY += cypress-run-tests cypress-run-tests: ## Run cypress tests - @cd tests && \ +ifeq ($(CYPRESS_SETUP), yes) + @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ $(NVM_SH) use $(NODE_VERSION) && \ npx cypress run +endif +ifeq ($(CYPRESS_PROJECT_TESTS), yes) + @cd $(CYPRESS_PROJECT_TESTS_DIR) && \ + npx cypress run +endif From 5d09ceb7436f99ee74ca310883395fcbfea539ad Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Thu, 12 Dec 2024 16:59:43 +0200 Subject: [PATCH 03/14] update cypress command --- make/qa.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/make/qa.mk b/make/qa.mk index a555da5..fa55318 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -81,6 +81,11 @@ cypress-init: ## Init cypress $(call step,Adding cypress-toolkit to the project...\n) @git submodule add git@github.com:druidfi/cypress-toolkit.git +PHONY += cypress-update +cypress-update: ## Update cypress + $(call step,Update cypress-toolkit from github...\n) + @git submodule update --init --recursive + PHONY += cypress-run-tests cypress-run-tests: ## Run cypress tests ifeq ($(CYPRESS_SETUP), yes) From f55a115d329bebf33fa42df559b4a62529bd7bd5 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Fri, 13 Dec 2024 09:27:48 +0200 Subject: [PATCH 04/14] Cypress install and update --- make/qa.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/make/qa.mk b/make/qa.mk index fa55318..cf16f74 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -81,10 +81,23 @@ cypress-init: ## Init cypress $(call step,Adding cypress-toolkit to the project...\n) @git submodule add git@github.com:druidfi/cypress-toolkit.git +PHONY += cypress-install +cypress-install: ## Init cypress + $(call step,Install npm packages\n) + @cd $(CYPRESS_DIR) && \ + chmod u+x $(NVM_SH) && \ + $(NVM_SH) use $(NODE_VERSION) && \ + npm i --silence + PHONY += cypress-update cypress-update: ## Update cypress $(call step,Update cypress-toolkit from github...\n) @git submodule update --init --recursive + $(call step,Update npm packages\n) + @cd $(CYPRESS_DIR) && \ + chmod u+x $(NVM_SH) && \ + $(NVM_SH) use $(NODE_VERSION) && \ + npm update PHONY += cypress-run-tests cypress-run-tests: ## Run cypress tests From b1ed73089d372157ead7b0d9ff97b2c15f068481 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Fri, 13 Dec 2024 10:20:43 +0200 Subject: [PATCH 05/14] cypress remove project folder tests --- make/qa.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index cf16f74..c32dc2d 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -6,8 +6,6 @@ CS_CONF_EXISTS := $(shell test -f phpcs.xml.dist && echo yes || echo no) TESTSUITES ?= unit,kernel,functional CYPRESS_DIR = cypress-toolkit CYPRESS_SETUP = $(shell test -d $(CYPRESS_DIR) && echo yes || echo no) -CYPRESS_PROJECT_TESTS_DIR = tests -CYPRESS_PROJECT_TESTS = $(shell test -d $(CYPRESS_PROJECT_TESTS_DIR) && echo yes || echo no) PHONY += fix fix: ## Fix code style @@ -107,7 +105,3 @@ ifeq ($(CYPRESS_SETUP), yes) $(NVM_SH) use $(NODE_VERSION) && \ npx cypress run endif -ifeq ($(CYPRESS_PROJECT_TESTS), yes) - @cd $(CYPRESS_PROJECT_TESTS_DIR) && \ - npx cypress run -endif From 8303a5827bffcc92752b908d6ef680265967a651 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Fri, 13 Dec 2024 13:21:15 +0200 Subject: [PATCH 06/14] Cypress add submodules to git clone --- make/qa.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index c32dc2d..f16b020 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -77,7 +77,7 @@ endif PHONY += cypress-init cypress-init: ## Init cypress $(call step,Adding cypress-toolkit to the project...\n) - @git submodule add git@github.com:druidfi/cypress-toolkit.git + @git clone --recursive git@github.com:druidfi/cypress-toolkit.git PHONY += cypress-install cypress-install: ## Init cypress @@ -90,7 +90,7 @@ cypress-install: ## Init cypress PHONY += cypress-update cypress-update: ## Update cypress $(call step,Update cypress-toolkit from github...\n) - @git submodule update --init --recursive + @git submodule update --init --remote --recursive $(call step,Update npm packages\n) @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ From 726941e52a45582fe2da73636a953a12bf767ed6 Mon Sep 17 00:00:00 2001 From: Oscar Date: Fri, 13 Dec 2024 17:31:33 +0200 Subject: [PATCH 07/14] Add NVM_SH and NODE_VERSION. --- make/qa.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/qa.mk b/make/qa.mk index f16b020..302e1f5 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -6,6 +6,8 @@ CS_CONF_EXISTS := $(shell test -f phpcs.xml.dist && echo yes || echo no) TESTSUITES ?= unit,kernel,functional CYPRESS_DIR = cypress-toolkit CYPRESS_SETUP = $(shell test -d $(CYPRESS_DIR) && echo yes || echo no) +NVM_SH := $(HOME)/.nvm/nvm.sh +NODE_VERSION ?= 20 PHONY += fix fix: ## Fix code style From 7a70108fac62f6efcfd32ecafba74406ee976e1b Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Mon, 16 Dec 2024 16:25:03 +0200 Subject: [PATCH 08/14] Add make open Cypress UI --- make/qa.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make/qa.mk b/make/qa.mk index f16b020..3f4c54e 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -97,6 +97,12 @@ cypress-update: ## Update cypress $(NVM_SH) use $(NODE_VERSION) && \ npm update +PHONY += cypress-open +cypress-open: ## Update cypress + $(call step,Open Cypress UI...\n) + @cd $(CYPRESS_DIR) && \ + npx cypress open + PHONY += cypress-run-tests cypress-run-tests: ## Run cypress tests ifeq ($(CYPRESS_SETUP), yes) From 856834640c01f88f2443e57ee6466a21ec5cadb7 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Tue, 17 Dec 2024 09:04:34 +0200 Subject: [PATCH 09/14] update cypress command comments --- make/qa.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index 67d09f8..2fa6fc1 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -82,7 +82,7 @@ cypress-init: ## Init cypress @git clone --recursive git@github.com:druidfi/cypress-toolkit.git PHONY += cypress-install -cypress-install: ## Init cypress +cypress-install: ## Install Cypress packages $(call step,Install npm packages\n) @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ @@ -90,7 +90,7 @@ cypress-install: ## Init cypress npm i --silence PHONY += cypress-update -cypress-update: ## Update cypress +cypress-update: ## Update Cypress packages $(call step,Update cypress-toolkit from github...\n) @git submodule update --init --remote --recursive $(call step,Update npm packages\n) @@ -100,13 +100,13 @@ cypress-update: ## Update cypress npm update PHONY += cypress-open -cypress-open: ## Update cypress +cypress-open: ## Open Cypress UI $(call step,Open Cypress UI...\n) @cd $(CYPRESS_DIR) && \ npx cypress open PHONY += cypress-run-tests -cypress-run-tests: ## Run cypress tests +cypress-run-tests: ## Run Cypress tests ifeq ($(CYPRESS_SETUP), yes) @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ From 4c0f24b8e05ffc274a6972bbe5d4b64b85787d0e Mon Sep 17 00:00:00 2001 From: Oscar Date: Fri, 20 Dec 2024 09:09:26 +0200 Subject: [PATCH 10/14] Fixed version of cypress-update, pull origin. --- make/qa.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index 2fa6fc1..69594f7 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -92,9 +92,9 @@ cypress-install: ## Install Cypress packages PHONY += cypress-update cypress-update: ## Update Cypress packages $(call step,Update cypress-toolkit from github...\n) - @git submodule update --init --remote --recursive - $(call step,Update npm packages\n) @cd $(CYPRESS_DIR) && \ + git pull origin main + $(call step,Update npm packages\n) chmod u+x $(NVM_SH) && \ $(NVM_SH) use $(NODE_VERSION) && \ npm update From 5dd24ffd85c35973a6cb6b0f498f64d01c339df4 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Fri, 20 Dec 2024 15:20:13 +0200 Subject: [PATCH 11/14] cypress loading project config & cypress remove --- make/qa.mk | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index 69594f7..9a7684b 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -106,10 +106,21 @@ cypress-open: ## Open Cypress UI npx cypress open PHONY += cypress-run-tests -cypress-run-tests: ## Run Cypress tests +cypress-run-tests: ## Run cypress tests ifeq ($(CYPRESS_SETUP), yes) @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ - $(NVM_SH) use $(NODE_VERSION) && \ - npx cypress run + $(NVM_SH) use $(NODE_VERSION) + ifeq ($(CYPRESS_LOCAL_CONFIG),yes) + @cd ../CYPRESS_LOCAL_DIR && \ + cypress run --config-file ../tests/cypress/cypress.config.js + else + npx cypress run + endif +endif + +PHONY += cypress-remove +cypress-remove: ## Run cypress tests +ifeq ($(CYPRESS_SETUP), yes) + @rm -fR $(CYPRESS_DIR) endif From d673220aec2d73db07bcfb72a484f30a6fe19183 Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Mon, 23 Dec 2024 12:04:25 +0200 Subject: [PATCH 12/14] update typo fix --- make/qa.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/qa.mk b/make/qa.mk index 9a7684b..7a89857 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -94,7 +94,7 @@ cypress-update: ## Update Cypress packages $(call step,Update cypress-toolkit from github...\n) @cd $(CYPRESS_DIR) && \ git pull origin main - $(call step,Update npm packages\n) + $(call step,Update npm packages\n) && \ chmod u+x $(NVM_SH) && \ $(NVM_SH) use $(NODE_VERSION) && \ npm update From eebc14a262af6a145e49d16ef70e1e8a897c1e7b Mon Sep 17 00:00:00 2001 From: Tuomas Vlimaa <50957-tvalimaa@users.noreply.drupalcode.org> Date: Thu, 27 Mar 2025 12:39:42 +0200 Subject: [PATCH 13/14] cypress install & update nvm fix --- make/qa.mk | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/make/qa.mk b/make/qa.mk index 7a89857..52825b3 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -82,35 +82,39 @@ cypress-init: ## Init cypress @git clone --recursive git@github.com:druidfi/cypress-toolkit.git PHONY += cypress-install -cypress-install: ## Install Cypress packages +cypress-install: ## Install cypress $(call step,Install npm packages\n) @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ - $(NVM_SH) use $(NODE_VERSION) && \ + . $(NVM_SH) && nvm use $(NODE_VERSION) && \ + node -v && pwd \ npm i --silence PHONY += cypress-update -cypress-update: ## Update Cypress packages +cypress-update: ## Update cypress $(call step,Update cypress-toolkit from github...\n) + @git submodule update --init --remote --recursive + $(call step,Update npm packages\n) @cd $(CYPRESS_DIR) && \ - git pull origin main - $(call step,Update npm packages\n) && \ chmod u+x $(NVM_SH) && \ - $(NVM_SH) use $(NODE_VERSION) && \ + . $(NVM_SH) && nvm use $(NODE_VERSION) && \ + node -v && \ npm update PHONY += cypress-open -cypress-open: ## Open Cypress UI +cypress-open: ## Update cypress $(call step,Open Cypress UI...\n) @cd $(CYPRESS_DIR) && \ + . $(NVM_SH) && nvm use $(NODE_VERSION) && \ + node -v && \ npx cypress open PHONY += cypress-run-tests cypress-run-tests: ## Run cypress tests ifeq ($(CYPRESS_SETUP), yes) @cd $(CYPRESS_DIR) && \ - chmod u+x $(NVM_SH) && \ - $(NVM_SH) use $(NODE_VERSION) + . $(NVM_SH) && nvm use $(NODE_VERSION) && \ + node -v \ ifeq ($(CYPRESS_LOCAL_CONFIG),yes) @cd ../CYPRESS_LOCAL_DIR && \ cypress run --config-file ../tests/cypress/cypress.config.js From 775c7be6714eb0f23984fbaeec0076dccdfb6005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuomas=20V=C3=A4limaa?= Date: Mon, 31 Mar 2025 13:55:38 +0300 Subject: [PATCH 14/14] Update qa.mk install typo --- make/qa.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/qa.mk b/make/qa.mk index 52825b3..2340823 100644 --- a/make/qa.mk +++ b/make/qa.mk @@ -87,7 +87,7 @@ cypress-install: ## Install cypress @cd $(CYPRESS_DIR) && \ chmod u+x $(NVM_SH) && \ . $(NVM_SH) && nvm use $(NODE_VERSION) && \ - node -v && pwd \ + node -v && pwd && \ npm i --silence PHONY += cypress-update