Sub pages
Summary
...
In general, each test case is divided into 5 phases in addition to the setUpBeforeClass et tearDownAfterClass
Five phases pattern of testCase | Description |
---|
setUpBeforeClass | - Opening Silenium Driver
- Choosing the Vivo tested instance (I18n or non-i18n instance)
- Purge Tripestore from instance statement (previus sample data manipulation
- loading sampleData
|
Phase 1 | |
Phase 2 | - Adding Data by UI
- verify in the triplestore if the data is correctly added
|
Phase3 | - Modifying Data by UI
- verify in the triplestore if the data is correctly modified
|
Phase 4 | - Delete Data by UI
- verify in the triplestore if the data is correctly Deleted
|
Phase 5 | |
tearDownAfterClass | |
...
4 ) Running A Test Case in the TestBench under UQAM-DEV
...
For complete installation, following: 2. Installing UQAM-DEV
OR FROM SCRATCH
Install Tomcat and SOLR as indicated in the Lyrasis documentation. https://wiki.lyrasis.org/display/VIVODOC111x/Installing+VIVO
Or these documents more specific to this installation:
https://wiki.lyrasis.org/display/VIVO/1%29+Starting+with+basic+installation%3A+Java-Maven-Solr-GIT
https://wiki.lyrasis.org/display/VIVO/3%29+Installing+Tomcat+8.5+for+Vivo-1.11.0-i18n
Variables configuration
Code Block |
---|
language | bash |
---|
title | For UQAM-DEV installation |
---|
linenumbers | true |
---|
|
export REG_TEST_HOME=/c/UQAM-DEV # Home regression test directory
export REG_TEST_GIT=$REG_TEST_HOME/GIT # GIT extraction directory
export JAVA_HOME=$REG_TEST_HOME/jdk # Java Jdk 1.8
export SOLR=$REG_TEST_HOME/solr-7.7.2 # Solr 7.7.2 installation directory
export TOMCAT=$REG_TEST_HOME/apache-tomcat-8.5.11 # Tomcat installation directory
export VIVO_HOME_I18N=$REG_TEST_HOME/vivo_i18n # Vivo-i18n Home directory
export VIVO_HOME_ORIG=$REG_TEST_HOME/vivo_orig # Vivo original (non-i18n) Home directory |
Code Block |
---|
language | bash |
---|
title | For Other installation |
---|
linenumbers | true |
---|
|
export REG_TEST_HOME=YOUR_VALUE # Home regression test directory
export REG_TEST_GIT=YOUR_VALUE # GIT extraction directory
export JAVA_HOME=YOUR_VALUE # Java Jdk 1.8
export SOLR=YOUR_VALUE # Solr 7.7.2 installation directory
export TOMCAT=YOUR_VALUE # Tomcat installation directory
export VIVO_HOME_I18N=YOUR_VALUE # Vivo-i18n Home directory
export VIVO_HOME_ORIG=YOUR_VALUE # Vivo original (non-i18n) Home directory |
Code Block |
---|
language | bash |
---|
title | Example for Linux |
---|
linenumbers | true |
---|
|
export REG_TEST_HOME=/opt/tomcat
export REG_TEST_GIT=/opt/tomcat/GIT
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export SOLR=/opt/solr
export TOMCAT=/opt/tomcat
export VIVO_HOME_I18N=/opt/tomcat/vivo_i18n
export VIVO_HOME_ORIG=/opt/tomcat/vivo_orig
# You can also source the ./linux_var_dir.sh file |
While waiting for the integration of the development branches to the Master branch, it is necessary to perform the extractions from the following repo:
Repos are retrieved from the $REG_TEST_GIT
Code Block |
---|
cd $REG_TEST_GIT |
Repo name | GIT clone commans |
---|
Vitro |
Code Block |
---|
| git clone --single-branch --branch feature-1801-regtest https://github.com/MichelHeon/Vitro.git |
|
Vitro-languages |
Code Block |
---|
| git clone --single-branch --branch feature-1801-regtest https://github.com/MichelHeon/Vitro-languages.git |
|
VIVO |
Code Block |
---|
| git clone --single-branch --branch feature-1801-regtest https://github.com/MichelHeon/VIVO.git |
|
VIVO-languages |
Code Block |
---|
| git clone --single-branch --branch feature-1801-regtest https://github.com/MichelHeon/VIVO-languages.git |
|
Vivo-regression-test |
Code Block |
---|
| git clone --single-branch --branch feature-1801-regtest https://github.com/MichelHeon/vivo-regression-tests.git |
|
Step 3 Installing VIVO's (orig and i18n)
Step 3 a: Installing VIVO 1.11.1 (Original VIVO) from the CLI
The installation procedure below refers to the official Lyrasis installation guide, available here.i: https://wiki.lyrasis.org/display/VIVODOC111x/Installing+VIVO
| Description | Bash command |
---|
1 | Vivo Home and Vivo solr configuration from the directory $REG_TEST_GIT /vivo-regression-tests/vivo-config-proposal/vivo_orig , copy solr and vivo_home in aprropriate directory |
Code Block |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-config-proposal/vivo_orig
mkdir -p $VIVO_HOME_ORIG/home/config
cp -r vivo_home/* $VIVO_HOME_ORIG/home/config
sudo -u solr cp -r solr/server $SOLR |
|
2 | rom the directory C:\UQAM-DEV\GIT\vivo-regression-tests Installing VIVO 1.11.1 original |
Code Block |
---|
language | bash |
---|
title | For UQAM-DEV installation |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-installer-orig
mvn install -s UQAM-DEV-RgTest_orig_settings.xml |
Code Block |
---|
language | bash |
---|
title | For OTHER installation |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-installer-orig
# Edit and change attributes values to appropriate settings of
# NON_UQAM-DEV-RgTest_orig_settings.xml file
vi NON_UQAM-DEV-RgTest_orig_settings.xml
mvn install -s NON_UQAM-DEV-RgTest_orig_settings.xml |
|
Step 3 b: Installing VIVO 1.11.2-SNAPSHOT (VIVO-i18n) from the CLI
| Description | Bash command |
---|
1 | Vivo Home and Vivo solr configuration for i18n from the directory $REG_TEST_GIT /vivo-regression-tests/vivo-config-proposal/vivo_i18n , copy solr and vivo_home in aprropriate directory |
Code Block |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-config-proposal/vivo_i18n
mkdir -p $VIVO_HOME_I18N/home/config
cp -r vivo_home/* $VIVO_HOME_I18N/home/config
sudo -u solr cp -r solr/server $SOLR |
|
2 | From de vivo installer for i18n: cd $REG_TEST_GIT/vivo-regression-tests/vivo-installer-i18n install the vivo-i18n (solr and vivo_home are pre-configured with the UQAM-DEV installation)
|
Code Block |
---|
language | bash |
---|
title | For UQAM-DEV installation |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-installer-i18n
mvn install -s UQAM_DEV_RgTest_i18n_settings.xml -Dmaven.test.skip=true |
Code Block |
---|
language | bash |
---|
title | For OTHER installation |
---|
| cd $REG_TEST_GIT/vivo-regression-tests/vivo-installer-i18n
# Edit and change attributes values to appropriate settings of
# NON_UQAM_DEV_i18n_RgTest_settings.xml file
vi NON_UQAM_DEV_i18n_RgTest_settings.xml
mvn install -s NON_UQAM_DEV_i18n_RgTest_settings.xml -Dmaven.test.skip=true |
|
Step 3 c: Checking the installation
This section is used to verify the co-execution of VIVO-ORIG and VIVO-i18n.
| Description | Bash commands |
---|
1 | Starting solr Info |
---|
Make sure your JAVA_HOME is set up correctly e.g. export JAVA_HOME=C:/UQAM-DEV/jdk |
|
Code Block |
---|
| cd $SOLR/bin/
./solr.cmd start
# Start http://localhost:8983/solr/#/ in your WebBrowser
# and look for vivocore_i18n and vivocore_orig in the
# core selector dropdown menue |
|
2 | Start TOMCAT |
Code Block |
---|
| cd $REG_TEST_HOME/apache-tomcat-8.5.11/bin/
./catalina.bat jpda start |
|
3 | Verify VIVO i18n at http://localhost:8080/vivo/ | Image Added
|
4 | Verify VIVO otiginal at http://localhost:8080/vivo_orig/ | Image Added
|
Step 4: Configure property files in preparation for running a test case
| Description | Commands |
---|
1 | Assign the password for for the user admin
| |
2 | Edit the file C:\UQAM-DEV\vivo_orig\home\config\runtime.properties | Make sure the variable rootUser.emailAddress matches the login you entered in the last step. Don't worry about the variables below, they are not enabled for version 1.11.1 of VIVO. rootUser.passwordChangeRequired rootUser.password |
3 | | edit C:\UQAM-DEV\vivo\home\config\runtime.properties Validate that the variables are correctly configured rootUser.emailAddress = vivo@uqam.ca rootUser.passwordChangeRequired = false rootUser.password = Vivo2435.... RDFService.languageFilter = true languages.selectableLocales = fr_CA, en_CA, en_US, de_DE |
4 | Restarted Tomcat if changes have been made to any of the runtime.properties files. |
|
Step 5: Setting up the test bench
Description | Commands |
---|
Edit the file C:\UQAM-DEV\GIT\vivo-regression-tests\src\main\resources\runtime.properties | Make sure that the content (especially the credential section) corresponds to the VIVO login values. Code Block |
---|
| #
# Credential for connecting to Vivo
#
vivo.i18n.rootlogin=vivo@uqam.ca
vivo.i18n.password=Vivo2435....
vivo.orig.rootlogin=vivo@uqam.ca
vivo.orig.password=Vivo2435....
# ... |
|
Edit the file C:\UQAM-DEV\GIT\vivo-regression-tests\src\main\resources\TestRunner.properties | Select the test case you want to run e.g.: Code Block |
---|
title | TestRunner.properties |
---|
| ResearchOverviewToPerson=true
EmailAddress=false
HeadOfFaculty=true |
|
Edit the file C:\UQAM-DEV\GIT\vivo-regression-tests\settings.xml | Select the test case you want in the activeProfile section. Seul une profile peut être sélectionné e.g.: Code Block |
---|
| <activeProfiles>
<activeProfile>ResearchOverviewToPersonTest</activeProfile>
<!-- <activeProfile>EmailAddressTest</activeProfile> -->
<!-- <activeProfile>HeadOfFaculty</activeProfile> -->
</activeProfiles> |
|
|
Code Block |
---|
| #Edit the texbenvh runtime.properties
vi $REG_TEST_GIT/vivo-regression-tests/src/main/resources/runtime.properties
# Comment the line selenium.driver.location=./lib/geckodriver-v0.26.0-win64/geckodriver.exe
# and
# uncomment selenium.driver.location=./lib/geckodriver-v0.26.0-linux/geckodriver
|
|
Step 6: Running a test case
Description | Command |
---|
|
Code Block |
---|
export DISPLAY=:0 (For Linux user)
cd $REG_TEST_GIT/vivo-regression-tests
mvn install
mvn exec:java |
|
|
Code Block |
---|
export DISPLAY=:0 (For Linux user)
cd $REG_TEST_GIT/vivo-regression-tests
mvn install
mvn test -s settings.xml |
|
|
Code Block |
---|
export DISPLAY=:0 (For Linux user)
cd $REG_TEST_GIT/vivo-regression-tests
mvn install
mvn test -P EmailAddressTest,HeadOfFacultyTest,ResearchOverviewToPersonTest |
|
...
Done