This project provides functional tests of TERASOLUNA Server Framework for Java (5.x) Common Library.
Contributing (bug report, pull request, any comments etc.) is welcome !! Please see the contributing guideline for details.
Test case scenarios are managed at wiki pages.
Note:
Currently, support language is Japanese only. (Will translate to English as soon as possible)
Tested environments are managed at wiki page.
Preconditions are as follow:
- JDK 17 installed (
JAVA_HOME
defined as environment variable) - Maven installed (Can run
mvn
command) - Firefox(for personal or ESR) installed (ESR is used on our CI environment)
If PostgreSQL use as database , you need to create database of PostgreSQL into local machine. (PostgreSQL can download via here site).
Note:
If H2 use as database, you can skip this step.
By default, database owner is postgres
user, and password of postgres
user is 'P0stgres'
.
$ createdb -U postgres terasoluna-gfw-functionaltest --locale=C --encoding=UTF8 --template=template0
Clone the terasolunaorg/terasoluna-gfw-functionaltest
repository into local machine.
$ git clone https://github.com/terasolunaorg/terasoluna-gfw-functionaltest.git
Build artifacts using maven commands as follows.
The commands are different for XML-based configuration and Java-based configuration.
XML-based configuration
$ cd {your repository directory}
$ git checkout {target branch}
$ cd {your repository directory}/XmlConfig
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web
Java-based configuration
$ cd {your repository directory}
$ git checkout {target branch}
$ cd {your repository directory}/JavaConfig
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web
The commands are different for XML-based configuration and Java-based configuration.
XML-based configuration
$ cd {your repository directory}
$ git checkout {target branch}
$ cd {your repository directory}/XmlConfig
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web -P tomcat10-postgresql,warpack-env,warpack-jstl,travis
Java-based configuration
$ cd {your repository directory}
$ git checkout {target branch}
$ cd {your repository directory}/JavaConfig
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web -P tomcat10-postgresql,warpack-env,warpack-jstl,travis
Note:
If you not use default user(
postgres
) or password(P0stgres
), you should modify settings interasoluna-gfw-functionaltest-env/configs/travis/ContainerConfigXML/context.xml
.
If PostgreSQL use as database, initialize database before run functional test.
$ mvn -U sql:execute -pl terasoluna-gfw-functionaltest-initdb
Note:
If you not use default user(
postgres
) or password(P0stgres
), you should specify-Ddb.username={your user}
or-Ddb.password={your password}
or both.
Startup Tomcat9 and deploy war file using CARGO maven plugin.
The commands are different for XML-based configuration and Java-based configuration.
XML-based configuration
$ cd {your repository directory}/XmlConfig
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web
Java-based configuration
$ cd {your repository directory}/JavaConfig
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web
The commands are different for XML-based configuration and Java-based configuration.
XML-based configuration
$ cd {your repository directory}/XmlConfig
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web -P travis
Java-based configuration
$ cd {your repository directory}/JavaConfig
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web -P travis
Note:
Shutdown trigger is "Ctrl + C" on console.
Run tests using Selenium(WebDriver
) on JUnit.
The commands are different for XML-based configuration and Java-based configuration.
XML-based configuration
$ cd {your repository directory}/XmlConfig
$ mvn -U test -pl terasoluna-gfw-functionaltest-selenium -Dwdm.cachePath=/opt/geckodriver -Dwdm.geckoDriverVersion=0.32.0
Java-based configuration
$ cd {your repository directory}/JavaConfig
$ mvn -U test -pl terasoluna-gfw-functionaltest-selenium -Dwdm.cachePath=/opt/geckodriver -Dwdm.geckoDriverVersion=0.32.0
Note:
If functional test is failed, try again using latest Selenium(specify with
-Dselenium.version={latest version}
). Please also refer tested environment for more information about our tested environment. At last, please check selenium changelog to make sure your Firefox version is supported.
Note:
By default, webdrivermanager will download the latest geckodriver to
~/.cache/selenium
automatically. If you want to specify the download destination directory, please specify "-Dwdm.cachePath
" in the startup argument. To specify the version of geckoDriver, specify "-Dwdm.geckoDriverVersion
" in the startup argument.See advanced-configuration for details on configuration.
If latest or any branch snapshot of Common Library want to use, install latest or any branch snapshot before build and test.
$ git clone https://github.com/terasolunaorg/terasoluna-gfw.git
$ cd {your repository directory of terasoluna-gfw}
$ git checkout {target branch}
$ mvn clean install
terasoluna-gfw-functionaltest
├─JavaConfig
│ ├─terasoluna-gfw-functionaltest-domain
│ ├─terasoluna-gfw-functionaltest-env
│ ├─terasoluna-gfw-functionaltest-initdb
│ ├─terasoluna-gfw-functionaltest-selenium
│ └─terasoluna-gfw-functionaltest-web
└─XmlConfig
├─terasoluna-gfw-functionaltest-domain
├─terasoluna-gfw-functionaltest-env
├─terasoluna-gfw-functionaltest-initdb
├─terasoluna-gfw-functionaltest-selenium
└─terasoluna-gfw-functionaltest-web
This project is It is divided and managed in two directories: XML-based configuration and Java-based configuration.
The project configurations under XML-based configuration and Java-based configuration are the same.
-
terasoluna-gfw-functionaltest-domain
A project that stores classes and configuration files related to the domain layer
-
terasoluna-gfw-functionaltest-env
A project that stores environment-dependent files, etc.
-
terasoluna-gfw-functionaltest-initdb
A project that manages the SQL file for initializing the database
-
terasoluna-gfw-functionaltest-selenium
Project to manage Selenium tests
-
terasoluna-gfw-functionaltest-web
A project that stores classes and configuration files related to the application layer