From 38432bf72de8e1c24de275d7724510bc760462b8 Mon Sep 17 00:00:00 2001 From: Elio Di Puma Date: Fri, 25 Aug 2023 08:57:16 +0200 Subject: [PATCH] XIVY-12055 Moved Mock-API to demo-project and updated Readme --- .github/workflows/ci.yml | 4 +- pom.xml | 1 + .../org.eclipse.wst.common.component | 20 ----- .../.settings/ch.ivyteam.ivy.designer.prefs | 2 +- .../config/variables.yaml | 3 + .../srf/weather/connector/WeatherMock.java | 1 - .../srf/weather/connector/json/forecast.json | 0 .../weather/connector/json/geolocation.json | 0 srf-weather-connector-product/README.md | 9 +- .../.settings/ch.ivyteam.ivy.designer.prefs | 2 +- srf-weather-connector-test/pom.xml | 90 ++++++++++--------- .../.classpath | 0 .../.gitignore | 0 .../.project | 0 .../.settings/.jsdtscope | 0 .../.settings/ch.ivyteam.ivy.designer.prefs | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.m2e.core.prefs | 4 + .../org.eclipse.wst.common.component | 20 +++++ ...se.wst.common.project.facet.core.prefs.xml | 0 ....eclipse.wst.common.project.facet.core.xml | 0 .../.settings/org.eclipse.wst.css.core.prefs | 0 ...rg.eclipse.wst.jsdt.ui.superType.container | 0 .../org.eclipse.wst.jsdt.ui.superType.name | 0 .../config/custom-fields.yaml | 0 .../config/databases.yaml | 0 .../config/overrides.any | 0 .../config/persistence.xml | 0 .../config/rest-clients.yaml | 0 .../config/roles.xml | 0 .../config/users.xml | 0 .../config/variables.yaml | 0 .../config/webservice-clients.yaml | 0 .../connector/srf/weather/test/Data.ivyClass | 0 .../pom.xml | 12 +-- .../processes/config.p.json | 0 .../srf/weather/test/ConfigManipulator.java | 0 .../connector/srf/weather/test/DemoWebIT.java | 21 +++-- .../.settings/ch.ivyteam.ivy.designer.prefs | 2 +- srf-weather-connector/config/variables.yaml | 2 - 40 files changed, 104 insertions(+), 89 deletions(-) delete mode 100644 srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.component rename {srf-weather-connector-test => srf-weather-connector-demo}/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java (97%) rename {srf-weather-connector-test => srf-weather-connector-demo}/src/com/axonivy/connector/srf/weather/connector/json/forecast.json (100%) rename {srf-weather-connector-test => srf-weather-connector-demo}/src/com/axonivy/connector/srf/weather/connector/json/geolocation.json (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.classpath (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.gitignore (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.project (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/.jsdtscope (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/ch.ivyteam.ivy.designer.prefs (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.jdt.core.prefs (100%) create mode 100644 srf-weather-connector-webTest/.settings/org.eclipse.m2e.core.prefs create mode 100644 srf-weather-connector-webTest/.settings/org.eclipse.wst.common.component rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.wst.common.project.facet.core.xml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.wst.css.core.prefs (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.wst.jsdt.ui.superType.container (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/.settings/org.eclipse.wst.jsdt.ui.superType.name (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/custom-fields.yaml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/databases.yaml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/overrides.any (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/persistence.xml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/rest-clients.yaml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/roles.xml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/users.xml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/variables.yaml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/config/webservice-clients.yaml (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/dataclasses/com/axonivy/connector/srf/weather/test/Data.ivyClass (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/pom.xml (75%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/processes/config.p.json (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/src/com/axonivy/connector/srf/weather/test/ConfigManipulator.java (100%) rename {srf-weather-connector-WebTest => srf-weather-connector-webTest}/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java (60%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8245c6f..48339ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,11 +4,11 @@ on: push: pull_request: schedule: - - cron: '21 21 * * *' + - cron: "21 21 * * *" workflow_dispatch: jobs: build: uses: axonivy-market/github-workflows/.github/workflows/ci.yml@v2 with: - mvnArgs: -Dmaven.test.failure.ignore=true + mvnArgs: -Dmaven.test.failure.ignore=true -Divy.engine.version=10.0.11 diff --git a/pom.xml b/pom.xml index 834a55e..d83a653 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ ${project.name}-demo ${project.name}-test ${project.name}-product + ${project.name}-webTest diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.component b/srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.component deleted file mode 100644 index 88f6754..0000000 --- a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/srf-weather-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs b/srf-weather-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs index 89bd9e3..3db8145 100644 --- a/srf-weather-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs +++ b/srf-weather-connector-demo/.settings/ch.ivyteam.ivy.designer.prefs @@ -1,5 +1,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.connector.srf.weather.connector.demo.Data ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.srf.weather.connector.demo ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=111000 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 eclipse.preferences.version=1 diff --git a/srf-weather-connector-demo/config/variables.yaml b/srf-weather-connector-demo/config/variables.yaml index 0ea7900..7254548 100644 --- a/srf-weather-connector-demo/config/variables.yaml +++ b/srf-weather-connector-demo/config/variables.yaml @@ -5,6 +5,9 @@ Variables: # All variables related to the SRF Weather connector SrfWeatherConnector: + # For testing you can use the following Variable to refer to the testing Mock API under: 'http://localhost:8081/designer/api/weatherMock' + # Url: http://localhost:8081/designer/api/weatherMock + # Your Access Token for SRF weather connector # This token serves as your authentication key for accessing the SRF API. # [password] diff --git a/srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java b/srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java similarity index 97% rename from srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java rename to srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java index 5c63a17..2a654e7 100644 --- a/srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java +++ b/srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/WeatherMock.java @@ -18,7 +18,6 @@ @Path(WeatherMock.PATH_SUFFIX) @PermitAll public class WeatherMock { - static final String PATH_SUFFIX = "weatherMock"; // URI where this mock can be reached: to be referenced in tests that use it! public static final String URI = "{ivy.app.baseurl}/api/" + PATH_SUFFIX; diff --git a/srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/json/forecast.json b/srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/json/forecast.json similarity index 100% rename from srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/json/forecast.json rename to srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/json/forecast.json diff --git a/srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/json/geolocation.json b/srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/json/geolocation.json similarity index 100% rename from srf-weather-connector-test/src/com/axonivy/connector/srf/weather/connector/json/geolocation.json rename to srf-weather-connector-demo/src/com/axonivy/connector/srf/weather/connector/json/geolocation.json diff --git a/srf-weather-connector-product/README.md b/srf-weather-connector-product/README.md index 19e8875..00abfb9 100644 --- a/srf-weather-connector-product/README.md +++ b/srf-weather-connector-product/README.md @@ -9,13 +9,16 @@ The connector: * supports you with an easy-to-copy demo implementation to reduce your integration effort. * enables low code citizen developers to enhance existing business processes - with currency converter features. + with weather forecast features. ## Demo Install the SRF Weather Connector and call it as a sub-process. Adjust the mapping accordingly. ![set connector as subprocess](images/demo1.png) +For testing purposes, a mock API can be used in the demo instead of the official SRF API. For this purpose, the variable "Url" can be commented out under 'Variables.SrfWeatherConnector'. +This way you can avoid the need to generate an access token via the SRF Developer website first. In this mock mode, only the ZIP code "6300" must be entered in the "zip" field. + In the demo, you can now specify either the name of the location or its ZIP code and use the "Get Weather" button to output the weather for the next seven days at this location. ![enter data name or zip](images/demo2.png) @@ -28,7 +31,7 @@ The use of the SRF Weather API is not free of charge. For development purposes t To use the connector, you must select a suitable API package via the [SRF API Developer website](https://developer.srgssr.ch/api-catalog/srf-weather) and generate a "bearer token". This is described in the following instructions: [SRF instruction](https://developer.srgssr.ch/getting-started/easy-description-get-accesstoken) -After a Bearer Token is available, you can store it in the Connector project in the variable "srfWeatherConnector.Token"(under Config-->variables.yaml). +After a Bearer Token is available, you can store it in your project in the variables.yaml as the variable "srfWeatherConnector.Token" (as you can see in the Demo). 1. Register an account on [developer.srgssr.ch/](https://developer.srgssr.ch/). 2. Once logged in, click Apps on the top right and add a new app with the "+ ADD APP" button. 3. After the app is created, you will receive a Consumer Key and Consumer Secret with which you can generate the Bearer Token. @@ -36,4 +39,4 @@ After a Bearer Token is available, you can store it in the Connector project in ``` @variables.yaml@ -``` \ No newline at end of file +``` diff --git a/srf-weather-connector-test/.settings/ch.ivyteam.ivy.designer.prefs b/srf-weather-connector-test/.settings/ch.ivyteam.ivy.designer.prefs index 5c982b7..f28de65 100644 --- a/srf-weather-connector-test/.settings/ch.ivyteam.ivy.designer.prefs +++ b/srf-weather-connector-test/.settings/ch.ivyteam.ivy.designer.prefs @@ -1,5 +1,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS=com.axonivy.connector.srf.weather.test.Data ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.srf.weather.test ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=111000 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 eclipse.preferences.version=1 diff --git a/srf-weather-connector-test/pom.xml b/srf-weather-connector-test/pom.xml index 582ce84..df3658f 100644 --- a/srf-weather-connector-test/pom.xml +++ b/srf-weather-connector-test/pom.xml @@ -1,44 +1,50 @@ - 4.0.0 - com.axonivy.connector.srf.weather - srf-weather-connector-test - 10.0.2-SNAPSHOT - iar - - - com.axonivy.ivy.test - unit-tester - 10.0.0 - test - - - com.axonivy.connector.srf.weather - srf-weather-connector - ${project.version} - iar - - - - src_test - - - - maven-deploy-plugin - 3.0.0-M1 - - true - - - - - - - com.axonivy.ivy.ci - project-build-plugin - 10.0.6 - true - - - - + 4.0.0 + com.axonivy.connector.srf.weather + srf-weather-connector-test + 10.0.2-SNAPSHOT + iar + + + com.axonivy.ivy.test + unit-tester + 10.0.0 + test + + + com.axonivy.connector.srf.weather + srf-weather-connector + ${project.version} + iar + + + com.axonivy.connector.srf.weather + srf-weather-connector-demo + 10.0.2-SNAPSHOT + iar + + + + src_test + + + + maven-deploy-plugin + 3.0.0-M1 + + true + + + + + + + com.axonivy.ivy.ci + project-build-plugin + 10.0.6 + true + + + + \ No newline at end of file diff --git a/srf-weather-connector-WebTest/.classpath b/srf-weather-connector-webTest/.classpath similarity index 100% rename from srf-weather-connector-WebTest/.classpath rename to srf-weather-connector-webTest/.classpath diff --git a/srf-weather-connector-WebTest/.gitignore b/srf-weather-connector-webTest/.gitignore similarity index 100% rename from srf-weather-connector-WebTest/.gitignore rename to srf-weather-connector-webTest/.gitignore diff --git a/srf-weather-connector-WebTest/.project b/srf-weather-connector-webTest/.project similarity index 100% rename from srf-weather-connector-WebTest/.project rename to srf-weather-connector-webTest/.project diff --git a/srf-weather-connector-WebTest/.settings/.jsdtscope b/srf-weather-connector-webTest/.settings/.jsdtscope similarity index 100% rename from srf-weather-connector-WebTest/.settings/.jsdtscope rename to srf-weather-connector-webTest/.settings/.jsdtscope diff --git a/srf-weather-connector-WebTest/.settings/ch.ivyteam.ivy.designer.prefs b/srf-weather-connector-webTest/.settings/ch.ivyteam.ivy.designer.prefs similarity index 100% rename from srf-weather-connector-WebTest/.settings/ch.ivyteam.ivy.designer.prefs rename to srf-weather-connector-webTest/.settings/ch.ivyteam.ivy.designer.prefs diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.jdt.core.prefs b/srf-weather-connector-webTest/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.jdt.core.prefs rename to srf-weather-connector-webTest/.settings/org.eclipse.jdt.core.prefs diff --git a/srf-weather-connector-webTest/.settings/org.eclipse.m2e.core.prefs b/srf-weather-connector-webTest/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/srf-weather-connector-webTest/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/srf-weather-connector-webTest/.settings/org.eclipse.wst.common.component b/srf-weather-connector-webTest/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..d596c96 --- /dev/null +++ b/srf-weather-connector-webTest/.settings/org.eclipse.wst.common.component @@ -0,0 +1,20 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/srf-weather-connector-webTest/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml rename to srf-weather-connector-webTest/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml b/srf-weather-connector-webTest/.settings/org.eclipse.wst.common.project.facet.core.xml similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml rename to srf-weather-connector-webTest/.settings/org.eclipse.wst.common.project.facet.core.xml diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.css.core.prefs b/srf-weather-connector-webTest/.settings/org.eclipse.wst.css.core.prefs similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.wst.css.core.prefs rename to srf-weather-connector-webTest/.settings/org.eclipse.wst.css.core.prefs diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container b/srf-weather-connector-webTest/.settings/org.eclipse.wst.jsdt.ui.superType.container similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container rename to srf-weather-connector-webTest/.settings/org.eclipse.wst.jsdt.ui.superType.container diff --git a/srf-weather-connector-WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name b/srf-weather-connector-webTest/.settings/org.eclipse.wst.jsdt.ui.superType.name similarity index 100% rename from srf-weather-connector-WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name rename to srf-weather-connector-webTest/.settings/org.eclipse.wst.jsdt.ui.superType.name diff --git a/srf-weather-connector-WebTest/config/custom-fields.yaml b/srf-weather-connector-webTest/config/custom-fields.yaml similarity index 100% rename from srf-weather-connector-WebTest/config/custom-fields.yaml rename to srf-weather-connector-webTest/config/custom-fields.yaml diff --git a/srf-weather-connector-WebTest/config/databases.yaml b/srf-weather-connector-webTest/config/databases.yaml similarity index 100% rename from srf-weather-connector-WebTest/config/databases.yaml rename to srf-weather-connector-webTest/config/databases.yaml diff --git a/srf-weather-connector-WebTest/config/overrides.any b/srf-weather-connector-webTest/config/overrides.any similarity index 100% rename from srf-weather-connector-WebTest/config/overrides.any rename to srf-weather-connector-webTest/config/overrides.any diff --git a/srf-weather-connector-WebTest/config/persistence.xml b/srf-weather-connector-webTest/config/persistence.xml similarity index 100% rename from srf-weather-connector-WebTest/config/persistence.xml rename to srf-weather-connector-webTest/config/persistence.xml diff --git a/srf-weather-connector-WebTest/config/rest-clients.yaml b/srf-weather-connector-webTest/config/rest-clients.yaml similarity index 100% rename from srf-weather-connector-WebTest/config/rest-clients.yaml rename to srf-weather-connector-webTest/config/rest-clients.yaml diff --git a/srf-weather-connector-WebTest/config/roles.xml b/srf-weather-connector-webTest/config/roles.xml similarity index 100% rename from srf-weather-connector-WebTest/config/roles.xml rename to srf-weather-connector-webTest/config/roles.xml diff --git a/srf-weather-connector-WebTest/config/users.xml b/srf-weather-connector-webTest/config/users.xml similarity index 100% rename from srf-weather-connector-WebTest/config/users.xml rename to srf-weather-connector-webTest/config/users.xml diff --git a/srf-weather-connector-WebTest/config/variables.yaml b/srf-weather-connector-webTest/config/variables.yaml similarity index 100% rename from srf-weather-connector-WebTest/config/variables.yaml rename to srf-weather-connector-webTest/config/variables.yaml diff --git a/srf-weather-connector-WebTest/config/webservice-clients.yaml b/srf-weather-connector-webTest/config/webservice-clients.yaml similarity index 100% rename from srf-weather-connector-WebTest/config/webservice-clients.yaml rename to srf-weather-connector-webTest/config/webservice-clients.yaml diff --git a/srf-weather-connector-WebTest/dataclasses/com/axonivy/connector/srf/weather/test/Data.ivyClass b/srf-weather-connector-webTest/dataclasses/com/axonivy/connector/srf/weather/test/Data.ivyClass similarity index 100% rename from srf-weather-connector-WebTest/dataclasses/com/axonivy/connector/srf/weather/test/Data.ivyClass rename to srf-weather-connector-webTest/dataclasses/com/axonivy/connector/srf/weather/test/Data.ivyClass diff --git a/srf-weather-connector-WebTest/pom.xml b/srf-weather-connector-webTest/pom.xml similarity index 75% rename from srf-weather-connector-WebTest/pom.xml rename to srf-weather-connector-webTest/pom.xml index 9e6c742..bac545a 100644 --- a/srf-weather-connector-WebTest/pom.xml +++ b/srf-weather-connector-webTest/pom.xml @@ -3,20 +3,14 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.axonivy.connector.srf.weather - srf-weather-connector-web-test - 1.0.0-SNAPSHOT + srf-weather-connector-webTest + 10.0.2-SNAPSHOT iar-integration-test com.axonivy.connector.srf.weather srf-weather-connector-demo - 10.0.0-SNAPSHOT - iar - - - com.axonivy.connector.srf.weather - srf-weather-connector-test - 10.0.0-SNAPSHOT + 10.0.2-SNAPSHOT iar diff --git a/srf-weather-connector-WebTest/processes/config.p.json b/srf-weather-connector-webTest/processes/config.p.json similarity index 100% rename from srf-weather-connector-WebTest/processes/config.p.json rename to srf-weather-connector-webTest/processes/config.p.json diff --git a/srf-weather-connector-WebTest/src/com/axonivy/connector/srf/weather/test/ConfigManipulator.java b/srf-weather-connector-webTest/src/com/axonivy/connector/srf/weather/test/ConfigManipulator.java similarity index 100% rename from srf-weather-connector-WebTest/src/com/axonivy/connector/srf/weather/test/ConfigManipulator.java rename to srf-weather-connector-webTest/src/com/axonivy/connector/srf/weather/test/ConfigManipulator.java diff --git a/srf-weather-connector-WebTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java b/srf-weather-connector-webTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java similarity index 60% rename from srf-weather-connector-WebTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java rename to srf-weather-connector-webTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java index 162cf4e..ca7f30c 100644 --- a/srf-weather-connector-WebTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java +++ b/srf-weather-connector-webTest/src_test/com/axonivy/connector/srf/weather/test/DemoWebIT.java @@ -10,22 +10,29 @@ import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.ivy.webtest.engine.EngineUrl; - +import static com.axonivy.ivy.webtest.engine.EngineUrl.isDesigner; +import static com.codeborne.selenide.WebDriverConditions.urlContaining; @IvyWebTest public class DemoWebIT { + public static void assertCurrentUrlContains(String contains) { + webdriver().shouldHave(urlContaining(contains)); + } + @BeforeEach void beforeEach() { - open(EngineUrl.createProcessUrl("srf-weather-connector-WebTest/18A17804D90373B1/setMockConfig.ivp")); - open(EngineUrl.createProcessUrl("srf-weather-connector-demo/189FE26D94E3ECBA/start.ivp")); + open(EngineUrl.createProcessUrl("srf-weather-connector-webTest/18A17804D90373B1/setMockConfig.ivp")); + assertCurrentUrlContains(isDesigner() ? "/default-workflow/faces" : "end"); + open(EngineUrl.createProcessUrl("srf-weather-connector-demo/189FE26D94E3ECBA/start.ivp")); } - + @AfterEach void afterEach() { - open(EngineUrl.createProcessUrl("srf-weather-connector-WebTest/18A17804D90373B1/cleanupMockConfig.ivp")); + open(EngineUrl.createProcessUrl("srf-weather-connector-webTest/18A17804D90373B1/cleanupMockConfig.ivp")); + } - + @Test public void checkWeatherTitle() { $(By.id("form:dataZip")).sendKeys("6300"); @@ -33,7 +40,7 @@ public void checkWeatherTitle() { $(By.id("form:noMatchMsg")).shouldBe(hidden); $(By.id("form:headerWeatherResult")).shouldHave(exactText("Zug")); } - + @Test public void checkWarningMsg() { $(By.id("form:dataZip")).sendKeys("6301456"); diff --git a/srf-weather-connector/.settings/ch.ivyteam.ivy.designer.prefs b/srf-weather-connector/.settings/ch.ivyteam.ivy.designer.prefs index db2da55..b1a6fe3 100644 --- a/srf-weather-connector/.settings/ch.ivyteam.ivy.designer.prefs +++ b/srf-weather-connector/.settings/ch.ivyteam.ivy.designer.prefs @@ -2,5 +2,5 @@ ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_DATA_CLASS= ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:DEFAULT_NAMESPACE=com.axonivy.connector.srf.weather.connector ch.ivyteam.ivy.designer.preferences.DataClassPreferencePage\:useProjectSettings=true ch.ivyteam.ivy.project.preferences\:PRIMEFACES_VERSION=11 -ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=111000 +ch.ivyteam.ivy.project.preferences\:PROJECT_VERSION=100000 eclipse.preferences.version=1 diff --git a/srf-weather-connector/config/variables.yaml b/srf-weather-connector/config/variables.yaml index a81c6ab..d49a8ef 100644 --- a/srf-weather-connector/config/variables.yaml +++ b/srf-weather-connector/config/variables.yaml @@ -6,8 +6,6 @@ Variables: SrfWeatherConnector: # The url for the SRF weather API Url: https://api.srgssr.ch/srf-meteo/v2 - # For testing you can use the following Variable to refer to the testing Mock API under: 'http://localhost:8081/designer/api/weatherMock' - MockUrl: http://localhost:8081/designer/api/weatherMock # Your SRF API token # This token serves as your authentication key for accessing the SRF API. # [password]