Skip to content

Commit

Permalink
[FUSEQE-5557] Create an UI test for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mkralik3 committed Aug 25, 2020
1 parent 3113c41 commit 3408c17
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 1 deletion.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
<module>utilities</module>
<module>validation</module>
<module>rest-common</module>
<module>ui-common</module>
<module>upgrade-tests</module>
</modules>
</profile>
Expand Down
4 changes: 4 additions & 0 deletions upgrade-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<groupId>io.syndesis.qe</groupId>
<artifactId>rest-common</artifactId>
</dependency>
<dependency>
<groupId>io.syndesis.qe</groupId>
<artifactId>ui-common</artifactId>
</dependency>
<dependency>
<groupId>io.syndesis.qe</groupId>
<artifactId>validation</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
import io.cucumber.junit.Cucumber;

@RunWith(Cucumber.class)
public class CucumberRunner extends TestSuiteParent {
public class CucumberRunner extends UITestSuiteParent {
}
6 changes: 6 additions & 0 deletions upgrade-tests/src/test/java/io/syndesis/qe/UpgradeSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.syndesis.qe.resource.impl.Syndesis;
import io.syndesis.qe.test.InfraFail;
import io.syndesis.qe.utils.OpenShiftUtils;
import io.syndesis.qe.utils.SampleDbConnectionManager;
import io.syndesis.qe.utils.TestUtils;
import io.syndesis.qe.utils.http.HTTPUtils;
import io.syndesis.qe.wait.OpenShiftWaitUtils;
Expand Down Expand Up @@ -172,6 +173,11 @@ public void checkPullSecret() {
assertThat(found).as("The pull secret should be linked to service account, but wasn't").isTrue();
}

@When("close DB connections")
public void closeDbConnections() {
SampleDbConnectionManager.closeConnections();
}

private String getPreviousVersion(String current, List<String> tags) {
// Semver needs 1.2.3 version style, so add ".0" if it's missing
if (current.matches("^\\d\\.\\d+")) {
Expand Down
126 changes: 126 additions & 0 deletions upgrade-tests/src/test/resources/features/upgrade-ui.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# @sustainer: [email protected]

@syndesis-upgrade-ui
Feature: Upgrade Syndesis

Background: Clean application state
Given prepare upgrade
And clean default namespace
And deploy previous Syndesis CR "syndesis-cr-previous.yaml"
And wait for Syndesis to become ready
And verify syndesis "previous" version
And insert into "todo" table
| task1 |
And log into the Syndesis

Scenario: Upgrade Syndesis
When click on the "Create Integration" link to create a new integration.
Then check that position of connection to fill is "Start"

When select the "Webhook" connection
And select "Incoming Webhook" integration action
And fill in values by element data-testid
| contextpath | test-webhook |
And click on the "Next" button
And click on the "Next" button

When select the "PostgresDB" connection
And select "Invoke SQL" integration action
And fill in invoke query input with "insert into todo(task, completed) values(:#task, 0)" value
And click on the "Next" button

When add integration step on position "0"
And select the "PostgresDB" connection
And select "Invoke SQL" integration action
And fill in invoke query input with "SELECT * FROM todo limit 1" value
And click on the "Done" button

And add integration step on position "1"
And select "Data Mapper" integration step
And create data mapper mappings
| task | task |
And click on the "Done" button

And click on the "Save" link
And set integration name "webhook-before-upgrade"
And publish integration
And navigate to the "Integrations" page
And wait until integration "webhook-before-upgrade" gets into "Running" state

When invoke post request to webhook in integration webhook-before-upgrade with token test-webhook and body {}
And wait until integration webhook-before-upgrade processed at least 1 message
Then check that query "select * from todo where task='task1'" has 2 rows output

# close all connections used by DB steps. The new connection will be created by that step later
When close DB connections
And perform syndesis upgrade to newer version using operator
Then wait until upgrade is done
And sleep for jenkins delay or 180 seconds
And wait for Syndesis to become ready
And verify syndesis "upgraded" version
And check that pull secret is linked in the service accounts

When log into the Syndesis
And navigate to the "Home" page

# redeploy old integration TODO check steps
And navigate to the "Integrations" page
And select the "webhook-before-upgrade" integration
And click on the "Edit Integration" link

And add integration step on position "0"
And select "Log" integration step
And fill in values by element data-testid
| customtext | after update log |
And click on the "Done" button
And click on the "Save" link
And publish integration
And navigate to the "Integrations" page
And wait until integration "webhook-before-upgrade" gets into "Running" state

And invoke post request to webhook in integration webhook-before-upgrade with token test-webhook and body {}
And wait until integration webhook-before-upgrade processed at least 2 messages
Then check that query "select * from todo where task='task1'" has 3 rows output
And validate that logs of integration "webhook-before-upgrade" contains string "after update log"

When select the "webhook-before-upgrade" integration
And click on the "Activity" tab
And check that 1. activity version contains Version 2

# create new integration
And navigate to the "Home" page
And navigate click on the "Create Integration" link to create a new integration.
Then check that position of connection to fill is "Start"

When select the "Webhook" connection
And select "Incoming Webhook" integration action
And fill in values by element data-testid
| contextpath | test |
And click on the "Next" button
And click on the "Next" button

When select the "PostgresDB" connection
And select "Invoke SQL" integration action
And fill in invoke query input with "insert into todo(task, completed) values(:#task, 0)" value
And click on the "Next" button

When add integration step on position "0"
And select the "PostgresDB" connection
And select "Invoke SQL" integration action
And fill in invoke query input with "SELECT * FROM todo limit 1" value
And click on the "Done" button

And add integration step on position "1"
And select "Data Mapper" integration step
And create data mapper mappings
| task | task |
And click on the "Done" button

And click on the "Save" link
And set integration name "webhook-after-upgrade"
And publish integration
And navigate to the "Integrations" page
And wait until integration "webhook-after-upgrade" gets into "Running" state
And invoke post request to webhook in integration webhook-after-upgrade with token test and body {}
And wait until integration webhook-after-upgrade processed at least 1 message
Then check that query "select * from todo where task='task1'" has 4 rows output

0 comments on commit 3408c17

Please sign in to comment.