Skip to content

Commit

Permalink
update-webtests (#111)
Browse files Browse the repository at this point in the history
* run Google Chrome.
* updated WebTestUtil.
* upload test screenshots for debugging.
* updated webtests.
* Updated Test Logs Page BPMN file.
* All webtests updated and working.
* Updated test_workers_page BPMN file.
* Set workflow to run daily at 5 AM PST.
* Updated WorkersTestIT.
* Send Slack message to CWS Dev Team.
* Create LoadTestIT.
* Update unit tests.
* Update Maven dependencies for asserts.
* Updated workflow file.
  • Loading branch information
RonnyFrayRegato authored Aug 5, 2022
1 parent bb69f53 commit cb7d781
Show file tree
Hide file tree
Showing 40 changed files with 840 additions and 653 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: CWS CI

# Triggers the workflow on push or pull request
#on: [push, pull_request]
on: [push]
on:
push:
schedule:
# trigger a build and test of CWS daily at 5 AM PST / 12 PM UTC
- cron: '0 12 * * *'

jobs:

Expand Down Expand Up @@ -57,6 +61,8 @@ jobs:
run: |
cd dist/console-only/cws/server/apache-tomcat-9.0.33/logs
ls -al
- uses: browser-actions/setup-chrome@latest
- run: chrome --version
- name: Run Unit and Integration Tests
run: |
chmod +x test.sh
Expand All @@ -67,23 +73,28 @@ jobs:
with:
name: jacoco-report
path: jacoco-reports/aggregate/index.html


#run-tests:

#runs-on: ubuntu-latest

#needs: build-cws

#steps:
#- uses: actions/checkout@v3
#- name: Set up JDK 8
#uses: actions/setup-java@v3
#with:
#java-version: '8'
#distribution: 'temurin'
#cache: maven
#- name: CWS Unit and Integration Test Run
#run: |
#chmod +x test.sh
#./test.sh
- name: Upload test screenshots
uses: actions/upload-artifact@v3
with:
name: test-screenshots
path: test-screenshots/
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
6 changes: 5 additions & 1 deletion cws-adaptation-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.extension</groupId>
<groupId>org.camunda.bpm.assert</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand All @@ -35,6 +35,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
Expand Down
6 changes: 5 additions & 1 deletion cws-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.extension</groupId>
<groupId>org.camunda.bpm.assert</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand All @@ -109,6 +109,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
Expand Down
6 changes: 5 additions & 1 deletion cws-engine-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.extension</groupId>
<groupId>org.camunda.bpm.assert</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand All @@ -86,6 +86,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion cws-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</dependency>

<dependency> <!-- FOR TESTING -->
<groupId>org.camunda.bpm.extension</groupId>
<groupId>org.camunda.bpm.assert</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand All @@ -80,6 +80,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>org.mybatis</groupId>
Expand Down
9 changes: 6 additions & 3 deletions cws-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.extension</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<scope>test</scope>
<groupId>org.camunda.bpm.assert</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
Expand Down
3 changes: 2 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/CmdLineExecTaskTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables;
import static org.junit.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.junit.Assert.fail;

Expand Down
4 changes: 2 additions & 2 deletions cws-test/src/test/java/jpl/cws/test/Cws331Test.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.execute;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.job;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
Expand All @@ -20,7 +21,6 @@
/**
*
*/
@Ignore
public class Cws331Test extends CwsTestBase {
private static final Logger log = LoggerFactory.getLogger(Cws331Test.class);

Expand Down
3 changes: 2 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/CwsTestBase.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.claim;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.complete;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.task;
Expand Down
3 changes: 2 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/CwsTestBase2.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.claim;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.complete;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.task;
Expand Down
3 changes: 2 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/EmailTaskTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables;
import static org.junit.Assert.assertTrue;
Expand Down
4 changes: 1 addition & 3 deletions cws-test/src/test/java/jpl/cws/test/Issue16Test.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;

import java.util.Map;

Expand Down
1 change: 0 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/RestGetTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* Tests related to RestGetTask
*
*/
@Ignore
public class RestGetTaskTest extends CwsTestBase {
private static final Logger log = LoggerFactory.getLogger(RestGetTaskTest.class);

Expand Down
1 change: 0 additions & 1 deletion cws-test/src/test/java/jpl/cws/test/RestPostTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* Tests related to RestGetTask
*
*/
@Ignore
public class RestPostTaskTest extends CwsTestBase {
private static final Logger log = LoggerFactory.getLogger(RestPostTaskTest.class);

Expand Down
6 changes: 3 additions & 3 deletions cws-test/src/test/java/jpl/cws/test/SleepTaskTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand All @@ -15,7 +16,6 @@
* Tests related to EmailTask
*
*/
@Ignore
public class SleepTaskTest {


Expand Down Expand Up @@ -47,7 +47,7 @@ public void testSyncProcessWithSleep() {
long t1 = System.currentTimeMillis();
System.out.println("************************** "+(t1-t0));
assertTrue((t1-t0)>1000); // best case
assertTrue((t1-t0)<3000); // worst case
assertTrue((t1-t0)<6000); // worst case
assertThat(processInstance).isEnded();
} catch(Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.junit.Assert.fail;

Expand All @@ -19,7 +20,6 @@
* (in this case a sub-process container).
*
*/
@Ignore
public class SubProcessBoundaryCatchTest extends CwsTestBase {
private static final Logger log = LoggerFactory.getLogger(SubProcessBoundaryCatchTest.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.test;

import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService;
import static org.junit.Assert.fail;

Expand All @@ -20,7 +21,6 @@
* the same type.
*
*/
@Ignore
public class TaskInstanceCountTest {


Expand Down
2 changes: 1 addition & 1 deletion cws-test/src/test/java/jpl/cws/test/WebTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void runProcessTest() {
log.info("------ START runProcessTest ------");
gotoLoginPage();
login();
startProcDef("test_simplest", "Test Simplest");
startProcDef("test_simplest", "Test Simplest", 90000);
deleteProc("test_simplest");
logout();
log.info("------ END runProcessTest ------");
Expand Down
10 changes: 5 additions & 5 deletions cws-test/src/test/java/jpl/cws/test/WebTestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void runDeployTest() {
findOnPage("<title>Camunda Tasklist</title>");

sleep(10000);

WebElement start = driver.findElement(By.xpath("//*[contains(@class,'start-process-action')]"));
start.click();
sleep(5000);
Expand Down Expand Up @@ -311,11 +311,11 @@ public void runHelloWorldTest() {
WebElement historyButton = driver.findElement(By.xpath("//button[contains(text(),'History')]"));
historyButton.click();
sleep(1000);

findOnPage("ls");
findOnPage("Hello World");
findOnPage("Desktop");
findOnPage("Applications");
findOnPage("Command 'ls' exit code:0");
findOnPage("Command 'ls' event: success");

sleep(9000);

Expand All @@ -333,7 +333,7 @@ public void runProcessTest() {
log.info("------ START runProcessTest ------");
gotoLoginPage();
login();
startProcDef("test_simplest", "Test Simplest");
startProcDef("test_simplest", "Test Simplest", 90000);
deleteProc("test_simplest");
logout();
log.info("------ END runProcessTest ------");
Expand Down
Loading

0 comments on commit cb7d781

Please sign in to comment.