Skip to content

Commit

Permalink
Merge pull request #285 from TESTARtool/master_documentation
Browse files Browse the repository at this point in the history
Doc and code updates and bug fixing
  • Loading branch information
ferpasri committed Dec 20, 2021
2 parents 89e183a + 68ef14d commit ae6fc62
Show file tree
Hide file tree
Showing 31 changed files with 508 additions and 298 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,87 +36,87 @@ jobs:
- name: Run desktop_generic protocol with TESTAR using COMMAND_LINE
run: ./gradlew runTestDesktopGenericCommandLineOk
- name: Save runTestDesktopGenericCommandLineOk HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericCommandLineOk-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_ok

- name: Run desktop_generic protocol that contains SuspiciousTitle with TESTAR
run: ./gradlew runTestDesktopGenericCommandLineSuspiciousTitle
- name: Save runTestDesktopGenericCommandLineSuspiciousTitle HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericCommandLineSuspiciousTitle-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_command_and_suspicious

- name: Run desktop_generic protocol using specific filtering and detect a SuspiciousTitle with TESTAR
run: ./gradlew runTestDesktopGenericCommandLineSettingsFilterSuspiciousTitle
- name: Save runTestDesktopGenericCommandLineSettingsFilterSuspiciousTitle HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericCommandLineSettingsFilterSuspiciousTitle-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_command_settings_filter_and_suspicious

- name: Run desktop_generic protocol but connect using SUT_PROCESS_NAME and detect SuspiciousTitle
run: ./gradlew runTestDesktopGenericProcessNameSuspiciousTitle
- name: Save runTestDesktopGenericProcessNameSuspiciousTitle HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericProcessNameSuspiciousTitle-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_process_and_suspicious

- name: Run desktop_generic protocol but connect using SUT_WINDOW_TITLE and detect SuspiciousTitle
run: ./gradlew runTestDesktopGenericTitleNameSuspiciousTitle
- name: Save runTestDesktopGenericTitleNameSuspiciousTitle HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericTitleNameSuspiciousTitle-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_title_and_suspicious

- name: Run desktop_generic with OrientDB to infer a TESTAR State Model
run: ./gradlew runTestDesktopGenericStateModel
- name: Save runTestDesktopGenericStateModel HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericStateModel-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_state_model

- name: Run desktop_generic doing a customization in the AbstractIDCustom identifer
run: ./gradlew runTestDesktopGenericStateModelCustomAbstraction
- name: Save runTestDesktopGenericStateModelCustomAbstraction HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestDesktopGenericStateModelCustomAbstraction-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_state_model_custom

- name: Run webdriver protocol and detect SuspiciousTitle
run: ./gradlew runTestWebdriverSuspiciousTitle
- name: Save runTestWebdriverSuspiciousTitle HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestWebdriverSuspiciousTitle-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_and_suspicious

- name: Run webdriver to login in parabank app
run: ./gradlew runTestWebdriverParabankLogin
- name: Save runTestWebdriverParabankLogin HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestWebdriverParabankLogin-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_login

- name: Run TESTAR Replay mode with a web page to check that replayed correctly
run: ./gradlew runTestWebdriverCorrectReplay
- name: Save runTestWebdriverCorrectReplay HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestWebdriverCorrectReplay-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_replay

- name: Run TESTAR Replay mode to detect a not replayable button
run: ./gradlew runTestWebdriverUnreplayable
- name: Save runTestWebdriverUnreplayable HTML report artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v2.2.4
with:
name: runTestWebdriverUnreplayable-artifact
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_unreplayable
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build.bat
*.sse
*.class
*.log
/logs
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM selenium/standalone-chrome
##FROM ubuntu:20.04
##EXPOSE 5900
##RUN echo Europe/Amsterdam >/etc/timezone
##RUN apt-get update && apt-get install -y curl xvfb chromium-bsu openjdk-14-jdk unzip x11vnc fonts-liberation libcairo2 libgbm1 libgdk-pixbuf2.0-0 libpango-1.0.0 libpangocairo-1.0-0 xdg-utils libgtk-3-0 wget
##RUN apt-get update && apt-get install -y curl xvfb chromium-bsu openjdk-16-jdk unzip x11vnc fonts-liberation libcairo2 libgbm1 libgdk-pixbuf2.0-0 libpango-1.0.0 libpangocairo-1.0-0 xdg-utils libgtk-3-0 wget
##RUN curl -SLO "https://chromedriver.storage.googleapis.com/85.0.4183.87/chromedriver_linux64.zip" \
## && unzip "chromedriver_linux64.zip" -d /usr/local/bin \
## && rm "chromedriver_linux64.zip"
Expand All @@ -17,11 +17,11 @@ FROM selenium/standalone-chrome

# COPY pin_nodesource /etc/apt/preferences.d/nodesource
USER root
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && apt-get install -y openjdk-14-jdk libxkbcommon-x11-0
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update && apt-get install -y openjdk-16-jdk libxkbcommon-x11-0

ADD testar/target/distributions/testar.tar .

ENV JAVA_HOME "/usr/lib/jvm/java-14-openjdk-amd64"
ENV JAVA_HOME "/usr/lib/jvm/java-16-openjdk-amd64"
ENV DISPLAY=":99.0"

COPY runImage /runImage
Expand Down
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,11 @@
This is the github development root folder for TESTAR development.
The software can be build with both ant and gradle.

### Required tools to create TESTAR executable distribution

In order to build the native code, a view manual steps need to be executed;

1. In order to build the windows native code, Nmake and the compile for Microsoft visual studio are required.
These tools can be downloaded using the following [link](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15#).
2. Install the Visual Studio tools on your machine (remember the path where the tools are installed)
3. Download [compile_w10.bat](https://github.com/florendg/testar_floren/releases/download/PERFORMANCE/compile_w10.bat)
and [clean_w10.bat](https://github.com/florendg/testar_floren/releases/download/PERFORMANCE/clean_w10.bat)
4. Copy clean.bat and compile.bat to the folder windows/native_src within the TESTAR project
5. Adapt compile.bat and clean.bat. Set *PATH* to the installation folder used in step 2.
CALL "C:<*PATH*>\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=x64

### Import Gradle project into Eclipse (similar for other IDEs with Gradle)

1. Create a new empty workspace for Eclipse in a folder which is not the folder that contains the source
code.
1. Create a new workspace
2. Select File -> Import to open the import dialog
3. Select Gradle -> Existing Gradle project to open te import dialog
3. Select Gradle -> Existing Gradle project to open the import dialog
4. Select the folder that contains the root of the source code and start the import

It should be possible to build the project using the instructions provided in the next section
Expand All @@ -41,10 +27,9 @@ NOTE that this task doesn't generate an executable distribution by default.
TESTAR includes by default the file `windows.dll` inside `\testar\resources\windows10\` directory, which allows to run TESTAR on Windows 10 systems.

#### gradlew windowsDistribution (Allows TESTAR execution on Windows)
`gradlew windowsDistribution` task : uses the `Required tools to build the software` (see above) to create a new file `windows.dll`, which has preference over the default one.

NOTE: TESTAR requires Visual Redistributable which can be downloaded from the following
[link]( https://go.microsoft.com/fwlink/?LinkId=746572 ). Also a JAVA 1.8 JDK is required.
`gradlew windowsDistribution` task : Create a new file `windows.dll`, which has preference over the default one.
This tasks requires the installation of Visual Studio tools:
https://github.com/TESTARtool/TESTAR_dev/wiki/Update-Windows-UIAutomation-(windows.dll)

#### gradlew installDist (Create TESTAR Distribution)
`gradlew installDist` task : creates a runnable TESTAR distribution in the `\testar\target\install\testar\bin\` directory.
Expand All @@ -63,9 +48,6 @@ To build the zip execute the following command.
1. Run `.\gradlew distZip` in the root of the project.
2. Extract the zip on the machine where TESTAR is used.

NOTE: TESTAR requires Visual Redistributable which can be downloaded from the following
[link](https://go.microsoft.com/fwlink/?LinkId=746572) .Also a JAVA 1.8 JDK is required.

#### Running Gradle in Eclipse
The following procedure has been performed

Expand All @@ -75,7 +57,6 @@ code.
3. Select Gradle -> Existing Gradle project to open te import dialog
4. Select the folder that contains the root of the source code and start the import


#### Running TESTAR from Gradle
`gradlew runTestar` task : creates a TESTAR distribution with `gradlew installDist` task, and executes TESTAR from the runnable file `\testar\target\install\testar\bin\testar.bat`

Expand Down Expand Up @@ -189,3 +170,6 @@ https://github.com/TESTARtool/TESTAR_dev/issues

## Release notes
https://github.com/TESTARtool/TESTAR_dev/wiki/TESTAR-release-notes

## Required tools to create a windows.dll to update UIAutomation API
https://github.com/TESTARtool/TESTAR_dev/wiki/Update-Windows-UIAutomation-(windows.dll)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ subprojects {
mavenCentral()
}
dependencies {
testCompile group:'junit', name:'junit', version:'4.12'
testImplementation group:'junit', name:'junit', version:'4.12'
}

buildDir = new File('./target')
Expand Down
8 changes: 4 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
compile 'com.google.guava:guava:26.0-jre'
compile group: 'org.apache.commons', name: 'commons-text', version: '1.8'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.2'
runtimeOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.2'
implementation 'com.google.guava:guava:26.0-jre'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.8'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.15.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.15.0'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
22 changes: 12 additions & 10 deletions graphdb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jmhReport {
}

dependencies {
compile project(':core')
compile group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '3.0.34'
//compile group: 'com.tinkerpop.gremlin', name: 'gremlin-java', version: '2.6.0'
//compile group: 'com.tinkerpop.gremlin', name: 'gremlin-groovy', version: '2.6.0'
//compile group: 'org.codehaus.groovy', name: 'groovy', version: '1.8.9'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'

jmhCompile project
jmhCompile 'org.openjdk.jmh:jmh-core:1.19'
jmhCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
implementation project(':core')
implementation group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '3.0.34'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.15.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.15.0'
//implementation group: 'com.tinkerpop.gremlin', name: 'gremlin-java', version: '2.6.0'
//implementation group: 'com.tinkerpop.gremlin', name: 'gremlin-groovy', version: '2.6.0'
//implementation group: 'org.codehaus.groovy', name: 'groovy', version: '1.8.9'
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'

jmhImplementation project
jmhImplementation 'org.openjdk.jmh:jmh-core:1.19'
jmhImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
}

task jmh(type: JavaExec, description: 'Executing JMH benchmarks') {
Expand Down
6 changes: 3 additions & 3 deletions linux/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compile files('./lib/libatspi.jar')
compile files('./lib/junit-jupiter-api-5.0.0-M3.jar')
compile project(':core')
implementation files('./lib/libatspi.jar')
implementation files('./lib/junit-jupiter-api-5.0.0-M3.jar')
implementation project(':core')
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static JavaScreenCanvas fromPrimaryMonitor(Pen defaultPen){
*/
private void runningCheck() {
if(!_running)
throw new IllegalStateException();
throw new IllegalStateException("Linux Spy window is not running!");
}


Expand Down
10 changes: 5 additions & 5 deletions native/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dependencies {
compile project(':core')
compile project(':windows')
compile project(':webdriver')
compile project(':linux')
compile files('../linux/lib/libatspi.jar')
implementation project(':core')
implementation project(':windows')
implementation project(':webdriver')
implementation project(':linux')
implementation files('../linux/lib/libatspi.jar')
}

50 changes: 28 additions & 22 deletions testar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,34 @@ task customZipDistribution(type: Zip) {
}

dependencies {
compile project(':core')
compile project(':native')
compile project(':graphdb')
compile files('./lib/jsyntaxpane-1.1.5.jar')
compile files('./lib/sikulixapi.jar')
compile files('./lib/eye2.jar')
compile files('./lib/gson-2.8.5.jar')
compile jnativehook
compile 'com.google.guava:guava:26.0-jre'
compile group: 'com.jgoodies', name: 'jgoodies-common', version: '1.8.1'
compile group: 'com.jgoodies', name: 'jgoodies-forms', version: '1.9.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.30.v20200611'
compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.30.v20200611'
compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.30.v20200611'
compile group: 'org.eclipse.jetty', name: 'jetty-annotations', version: '9.4.30.v20200611'
compile group: 'org.eclipse.jetty', name: 'apache-jsp', version: '9.4.30.v20200611'
compile group: 'org.eclipse.jetty', name: 'apache-jstl', version: '9.4.30.v20200611'
compile group: 'commons-io', name: 'commons-io', version: '2.7'
runtime project(':windows')
}
evaluationDependsOn(':windows')
implementation project(':core')
implementation project(':native')
implementation project(':graphdb')
implementation project(':webdriver')
implementation project(':windows')
implementation files('./lib/jsyntaxpane-1.1.5.jar')
implementation files('./lib/sikulixapi.jar')
implementation files('./lib/eye2.jar')
implementation files('./lib/gson-2.8.5.jar')
implementation jnativehook
implementation 'com.google.guava:guava:26.0-jre'
implementation group: 'com.jgoodies', name: 'jgoodies-common', version: '1.8.1'
implementation group: 'com.jgoodies', name: 'jgoodies-forms', version: '1.9.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.30.v20200611'
implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.30.v20200611'
implementation group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.30.v20200611'
implementation group: 'org.eclipse.jetty', name: 'jetty-annotations', version: '9.4.30.v20200611'
implementation group: 'org.eclipse.jetty', name: 'apache-jsp', version: '9.4.30.v20200611'
implementation group: 'org.eclipse.jetty', name: 'apache-jstl', version: '9.4.30.v20200611'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.15.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.15.0'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.14.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
implementation group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '3.0.34'
}

task prepareSettings(type: Copy) {
from 'resources/settings'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected Action selectAction(State state, Set<Action> actions){
// HTML is not having the unvisited actions by default, so
// adding actions and unvisited actions to the HTML sequence report:
try {
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getConcreteIdsOfUnvisitedActions(state));
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getAbstractCustomIdsOfUnvisitedActions(state));
}catch(Exception e){
// catching null for the first state or any new state, when unvisited actions is still null,
// not adding the unvisited actions on those cases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected Action selectAction(State state, Set<Action> actions){
// HTML is not having the unvisited actions by default, so
// adding actions and unvisited actions to the HTML sequence report:
try {
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getConcreteIdsOfUnvisitedActions(state));
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getAbstractCustomIdsOfUnvisitedActions(state));
}catch(Exception e){
// catching null for the first state or any new state, when unvisited actions is still null,
// not adding the unvisited actions on those cases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected Action selectAction(State state, Set<Action> actions){
// HTML is not having the unvisited actions by default, so
// adding actions and unvisited actions to the HTML sequence report:
try {
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getConcreteIdsOfUnvisitedActions(state));
htmlReport.addActionsAndUnvisitedActions(actions, stateGraphWithVisitedActions.getAbstractCustomIdsOfUnvisitedActions(state));
}catch(Exception e){
// catching null for the first state or any new state, when unvisited actions is still null,
// not adding the unvisited actions on those cases:
Expand Down

0 comments on commit ae6fc62

Please sign in to comment.