From db2b4a866640585b2faceb4879ba51817f4a7ccb Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 27 Dec 2024 17:39:46 +0100 Subject: [PATCH] Tikui, vue & cypress headless failling --- .../lite/generator/client/tikui/domain/TikuiModuleFactory.java | 2 ++ .../client/tools/cypress/domain/CypressModuleFactory.java | 2 +- .../client/tools/playwright/domain/PlaywrightModuleFactory.java | 2 +- src/main/resources/generator/dependencies/common/package.json | 1 + .../generator/client/tikui/domain/TikuiModuleFactoryTest.java | 2 ++ .../client/tools/cypress/domain/CypressModuleFactoryTest.java | 2 +- .../tools/playwright/domain/PlaywrightModuleFactoryTest.java | 2 +- 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactory.java index 6dd55e889be..d2a1819fbf1 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactory.java @@ -46,6 +46,7 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .packageJson() .addDependency(packageName("@tikui/core"), COMMON) .addDevDependency(packageName("@prettier/plugin-pug"), COMMON) + .addDevDependency(packageName("serve"), COMMON) .addDevDependency(packageName("stylelint"), COMMON) .addDevDependency(packageName("stylelint-config-concentric-order"), COMMON) .addDevDependency(packageName("stylelint-config-standard-scss"), COMMON) @@ -53,6 +54,7 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .addDevDependency(packageName("tikuidoc-tikui"), COMMON) .addScript(scriptKey("build:tikui"), scriptCommand("tikui-core build")) .addScript(scriptKey("dev:tikui"), scriptCommand("tikui-core serve")) + .addScript(scriptKey("tikui:serve-build"), scriptCommand("tikui-core build && serve -p 9005 target/classes/public/style")) .and() .files() .add(SOURCE.template("tikuiconfig.json"), to("tikuiconfig.json")) diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java index 1e6cbc405aa..278fd796072 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java @@ -35,7 +35,7 @@ public JHipsterModule buildComponentTestsModule(JHipsterModuleProperties propert .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test start http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'")) .addScript( scriptKey("test:component:headless"), - scriptCommand("start-server-and-test start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'") + scriptCommand("start-server-and-test tikui:serve-build http://localhost:9005 start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'") ) .and() .context() diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java index c3a69e22274..a0ee3228c7e 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java @@ -31,7 +31,7 @@ public JHipsterModule buildComponentTestsModule(JHipsterModuleProperties propert .packageJson() .addDevDependency(packageName("start-server-and-test"), COMMON) .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test start http://localhost:9000 'playwright test --ui --config src/test/webapp/component/playwright.config.ts'")) - .addScript(scriptKey("test:component:headless"), scriptCommand("start-server-and-test start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'")) + .addScript(scriptKey("test:component:headless"), scriptCommand("start-server-and-test tikui:serve-build http://localhost:9005 start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'")) .and() .context() .put("reportSubDirectory", "component-tests") diff --git a/src/main/resources/generator/dependencies/common/package.json b/src/main/resources/generator/dependencies/common/package.json index 307c5fa79b9..487667bed7f 100644 --- a/src/main/resources/generator/dependencies/common/package.json +++ b/src/main/resources/generator/dependencies/common/package.json @@ -46,6 +46,7 @@ "prettier-plugin-organize-imports": "4.1.0", "prettier-plugin-packagejson": "2.5.6", "recursive-copy-cli": "1.0.20", + "serve": "14.2.4", "start-server-and-test": "2.0.9", "stylelint": "16.12.0", "stylelint-config-concentric-order": "5.2.0", diff --git a/src/test/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactoryTest.java index 2fc46c938f4..6b63f935b1e 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactoryTest.java @@ -147,6 +147,7 @@ private static JHipsterModuleAsserter assertThatTikuiModule(ModuleFile proxyFile return assertThatModuleWithFiles(module, packageJsonFile(), proxyFile, indexFile) .hasFile("package.json") .containing(nodeDependency("@tikui/core")) + .containing(nodeDependency("serve")) .containing(nodeDependency("stylelint")) .containing(nodeDependency("stylelint-config-concentric-order")) .containing(nodeDependency("stylelint-config-standard-scss")) @@ -154,6 +155,7 @@ private static JHipsterModuleAsserter assertThatTikuiModule(ModuleFile proxyFile .containing(nodeDependency("tikuidoc-tikui")) .containing(nodeScript("build:tikui", "tikui-core build")) .containing(nodeScript("dev:tikui", "tikui-core serve")) + .containing(nodeScript("tikui:serve-build", "tikui-core build && serve -p 9005 target/classes/public/style")) .and() .hasFiles("tikuiconfig.json", ".stylelintrc.json") .hasFile(".gitignore") diff --git a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java index 3fc0412f8ba..9f82f16155e 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java @@ -44,7 +44,7 @@ void shouldBuildComponentTestsModule() { .containing( nodeScript( "test:component:headless", - "start-server-and-test start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'" + "start-server-and-test tikui:serve-build http://localhost:9005 start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'" ) ) .and() diff --git a/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java index 618f29ebdc3..56787757ed8 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java @@ -33,7 +33,7 @@ void shouldBuildComponentTestsModule() { .containing( nodeScript( "test:component:headless", - "start-server-and-test start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'" + "start-server-and-test tikui:serve-build http://localhost:9005 start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'" ) ) .and()