Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #876 from LiskHQ/844-test-core
Browse files Browse the repository at this point in the history
Test suite update - Closes #844
  • Loading branch information
MichalTuleja committed Jan 8, 2019
2 parents 1ded45d + b37a88b commit 43460cf
Show file tree
Hide file tree
Showing 43 changed files with 561 additions and 375 deletions.
63 changes: 39 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pipeline {
agent { node { label 'lisk-explorer' } }
environment {
LISK_VERSION = '1.0.0-beta.9.2'
LISK_CORE_VERSION = '1.3.1'
EXPLORER_PORT = "604$EXECUTOR_NUMBER"
LISK_HOST = 'localhost'
REDIS_DB = "$EXECUTOR_NUMBER"
Expand Down Expand Up @@ -36,7 +36,6 @@ pipeline {
nvm(getNodejsVersion()) {
// marketwatcher needs to be enabled to builds candles
sh '''
cp ./test/known.test.json ./known.json
redis-cli -n $REDIS_DB flushdb
grunt candles:build
'''
Expand All @@ -45,25 +44,41 @@ pipeline {
}
stage ('Start Lisk') {
steps {
dir("$WORKSPACE/$BRANCH_NAME/") {
ansiColor('xterm') {
sh '''
rsync -axl --delete ~/lisk-docker/examples/development/ ./
cp ~/blockchain_explorer.db.gz ./blockchain.db.gz
make coldstart
'''
// show some build-related info
sh '''
sha1sum ./blockchain.db.gz
docker-compose config
docker-compose ps
'''
// Explorer needs the topAccounts feature to be enabled
sh '''
docker-compose exec -T lisk sed -i -r -e 's/(\\s*"topAccounts":)\\s*false,/\\1 true,/' config.json
docker-compose restart lisk
'''
}
dir('lisk') {
checkout([$class: 'GitSCM',
branches: [[name: "v${env.LISK_CORE_VERSION}" ]],
userRemoteConfigs: [[url: 'https://github.com/LiskHQ/lisk']]])
}

ansiColor('xterm') {
sh '''#!/bin/bash -xe
rm -rf $WORKSPACE/$BRANCH_NAME/
cp -rf $WORKSPACE/lisk/docker/ $WORKSPACE/$BRANCH_NAME/
cp $WORKSPACE/test/data/test_blockchain-explorer.db.gz $WORKSPACE/$BRANCH_NAME/dev_blockchain.db.gz
cd $WORKSPACE/$BRANCH_NAME
cp .env.development .env
sed -i -r -e '/ports:/,+2d' docker-compose.yml
# random port assignment
cat <<EOF >docker-compose.override.yml
version: "2"
services:
lisk:
ports:
- \\${ENV_LISK_HTTP_PORT}
- \\${ENV_LISK_WS_PORT}
EOF
ENV_LISK_VERSION="$LISK_CORE_VERSION" make coldstart
'''
// show some build-related info
sh '''
cd $WORKSPACE/$BRANCH_NAME
sha1sum dev_blockchain.db.gz
docker-compose config
docker-compose ps
'''
}
}
}
Expand Down Expand Up @@ -93,9 +108,9 @@ pipeline {
// stage ('Run E2E tests') {
// steps {
// wrap([$class: 'Xvfb']) {
// nvm(getNodejsVersion()) {
// sh 'npm run e2e -- --params.baseURL http://localhost:$EXPLORER_PORT'
// }
// nvm(getNodejsVersion()) {
// sh 'npm run e2e -- --params.baseURL http://localhost:$EXPLORER_PORT'
// }
// }
// }
// }
Expand Down
25 changes: 0 additions & 25 deletions e2e-test-setup.sh

This file was deleted.

3 changes: 2 additions & 1 deletion features/aCookieBanner.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Feature: Cookies information box
Scenario: should be able to close before starting tests
Given I'm on page "/"
And I click "accept-cookies"
Then I should see "Website" in "website-link" element
Then I should see "website link" element that links to "https://lisk.io/"

3 changes: 2 additions & 1 deletion features/activityGraph.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Feature: Activity Graph
Scenario: should display table with statistics
Given I'm on page "/activityGraph"
Then I should see "Activity Graph" in "h1" html element
Then I should see "Activity Graph" in "top title" element
And I should see "Real-time graphical presentation of the network activty" in "sub title" element
And I should see "Home Activity Graph" in "breadcrumb" element
And I should see table "statistics" containing:
| Txs | 0 |
Expand Down
26 changes: 12 additions & 14 deletions features/address.feature
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Feature: Address page
Scenario: should show title, summary, and transactions
Given I'm on page "/address/16313739661670634666L"
Then I should see "Address Summary " in "h1" html element
Then I should see "16313739661670634666L" in "top title" element
And I should see "Regular account" in "sub title" element
And I should see "Home Address 16313739661670634666L" in "breadcrumb" element
And I should see table "summary" containing:
| Address | 16313739661670634666L |
| Public Key | c094ebee7ec0c50ebee32918655e089f6e1a604b83bcaa760293c61e0f18ab6f |
| Total balance | 99,675,450.108366 LSK |
| Transactions | 2 1329 |

And I should see table "transactions" with 50 rows starting with:
And I should see table "transactions" with 25 rows starting with:
| Transaction ID | Date | Sender | Recipient | Amount | Fee | Confirm. |
|----------------|---------------------------|-----------------------|--------------------------|-----------|---------|---------------|
| /\d{18,20}/ | /2017\/06\/16 \d\d:09:08/ | 16313739661670634666L | /standby_\d{3}\|\d{20}L/ | 1,000 LSK | 0.1 LSK | Confirmed |
Expand All @@ -35,23 +36,20 @@ Feature: Address page

Scenario: should allow to load more transactions
Given I'm on page "/address/16313739661670634666L"
When I scroll to "more button"
And I click "more button"
Then I should see table "transactions" with 100 rows
When I click "btn-next"
Then I should see table "transactions" with 25 rows

Scenario: should allow to load less transactions
Given I'm on page "/address/16313739661670634666L"
When I scroll to "more button"
And I click "more button"
And I should see table "transactions" with 100 rows
And I scroll to "less button"
And I click "less button"
Then I should see table "transactions" with 50 rows
When I click "btn-next"
And I should see table "transactions" with 25 rows
And I click "btn-prev"
Then I should see table "transactions" with 25 rows

Scenario: should allow to show only sent transactions
Given I'm on page "/address/16313739661670634666L"
When I click "sent tab"
And I should see table "transactions" with 50 rows starting with:
And I should see table "transactions" with 25 rows starting with:
| Transaction ID | Date | Sender | Recipient | Amount | Fee | Confirm. |
|----------------|---------------------------|-----------------------|--------------------------|-----------|---------|---------------|
| /\d{18,20}/ | /2017\/06\/16 \d\d:09:08/ | 16313739661670634666L | /standby_\d{3}\|\d{20}L/ | 1,000 LSK | 0.1 LSK | Confirmed |
Expand Down Expand Up @@ -80,12 +78,12 @@ Feature: Address page

Scenario: should allow to show votes
Given I'm on page "/address/16313739661670634666L"
When I click "show votes button"
When I click "details tab"
Then I should see "genesis_1 • genesis_10 • genesis_100 • genesis_101 • genesis_11 • genesis_12 • genesis_13 • genesis_14 • genesis_15 • genesis_16 • genesis_17 • genesis_18 • genesis_19 • genesis_2 • genesis_20 • genesis_21 • genesis_22 • genesis_23 • genesis_24 • genesis_25 • genesis_26 • genesis_27 • genesis_28 • genesis_29 • genesis_3 • genesis_30 • genesis_31 • genesis_32 • genesis_33 • genesis_34 • genesis_35 • genesis_36 • genesis_37 • genesis_38 • genesis_39 • genesis_4 • genesis_40 • genesis_41 • genesis_42 • genesis_43 • genesis_44 • genesis_45 • genesis_46 • genesis_47 • genesis_48 • genesis_49 • genesis_5 • genesis_50 • genesis_51 • genesis_52 • genesis_53 • genesis_54 • genesis_55 • genesis_56 • genesis_57 • genesis_58 • genesis_59 • genesis_6 • genesis_60 • genesis_61 • genesis_62 • genesis_63 • genesis_64 • genesis_65 • genesis_66 • genesis_67 • genesis_68 • genesis_69 • genesis_7 • genesis_70 • genesis_71 • genesis_72 • genesis_73 • genesis_74 • genesis_75 • genesis_76 • genesis_77 • genesis_78 • genesis_79 • genesis_8 • genesis_80 • genesis_81 • genesis_82 • genesis_83 • genesis_84 • genesis_85 • genesis_86 • genesis_87 • genesis_88 • genesis_89 • genesis_9 • genesis_90 • genesis_91 • genesis_92 • genesis_93 • genesis_94 • genesis_95 • genesis_96 • genesis_97 • genesis_98 • genesis_99" in "votes" element

Scenario: should link votes to address page
Given I'm on page "/address/16313739661670634666L"
When I click "show votes button"
When I click "details tab"
And I click "vote link" no. 1
Then I should be on page "/address/8273455169423958419L"

31 changes: 18 additions & 13 deletions features/block.feature
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
Feature: Block page
Scenario: should show title, summary, and transactions
Given I'm on page "/block/6524861224470851795"
Then I should see "Block 6524861224470851795" in "h1" html element
Then I should see "6524861224470851795" in "top title" element
And I should see "Block with 103 transactions" in "sub title" element
And I should see "Home Block 6524861224470851795" in "breadcrumb" element
And I should see table "summary" containing:
| Transactions | 103 |
| Confirmations | /\d+/ |
| Height | 1 |
| Reward | 0 LSK |
| Total Fee | 0 LSK |
| Total Forged | 0 LSK |
| Total Amount | 100,000,000 LSK |
| Timestamp | /2016\/05\/24 \d\d:00:00/ |
| Generated by | 1085993630748340485L |
| Version | 0 |
| Block ID | 6524861224470851795 |
| Height | 1 |
| Number of transactions | 103 |
| Confirmations | /\d+/ |
| Reward | 0 LSK |
| Total Fee | 0 LSK |
| Total Forged | 0 LSK |
| Total Amount | 100,000,000 LSK |
| Timestamp | /2016\/05\/24 \d\d:00:00/ |
| Generated by | 1085993630748340485L |
| Version | 0 |
And I should see table "transactions" with 50 rows starting with:
| Transaction ID | Date | Sender | Recipient | Amount | Fee | Confirm. |
|----------------------|---------------------------|-------------------|-----------------------|--------|-------|---------------|
Expand All @@ -22,13 +24,16 @@ Feature: Block page
| /\d{18,20}/ | /2016\/05\/24 \d\d:00:00/ | /genesis_\d{1,3}/ | Delegate registration | 0 LSK | 0 LSK | Confirmed |
| /\d{18,20}/ | /2016\/05\/24 \d\d:00:00/ | /genesis_\d{1,3}/ | Delegate registration | 0 LSK | 0 LSK | Confirmed |
| /\d{18,20}/ | /2016\/05\/24 \d\d:00:00/ | /genesis_\d{1,3}/ | Delegate registration | 0 LSK | 0 LSK | Confirmed |


# TODO: Pagination should be first fixed.
@ignore
Scenario: should allow to load more transactions
Given I'm on page "/block/6524861224470851795"
When I scroll to "more button"
And I click "more button"
Then I should see table "transactions" with 100 rows


@ignore
Scenario: should allow to load less transactions
Given I'm on page "/block/6524861224470851795"
When I scroll to "more button"
Expand Down
34 changes: 34 additions & 0 deletions features/blocks.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Feature: Blocks page
Scenario: should show title, summary, and transactions
Given I'm on page "/blocks/"
Then I should see "Blocks" in "top title" element
And I should see "24254 → 24235" in "sub title" element
And I should see "Home Blocks" in "breadcrumb" element
And I should see table "table blocks" with 20 rows starting with:
| Id | Height | Timestamp | Transactions | Generated by | Amount | Forged |
|----------------|--------|---------------------------|----------------|-------------------|-------------|----------|
| /\d{18,20}/ | 24254 | /2017\/06\/19 \d\d:33:00/ | 0 | /genesis_\d{1,3}/ | 0 LSK | 5.0 LSK |
| /\d{18,20}/ | 24253 | /2017\/06\/19 \d\d:32:50/ | 0 | /genesis_\d{1,3}/ | 0 LSK | 5.0 LSK |
| /\d{18,20}/ | 24252 | /2017\/06\/19 \d\d:32:40/ | 0 | /genesis_\d{1,3}/ | 0 LSK | 5.0 LSK |
| /\d{18,20}/ | 24251 | /2017\/06\/19 \d\d:32:30/ | 0 | /genesis_\d{1,3}/ | 0 LSK | 5.0 LSK |
| /\d{18,20}/ | 24250 | /2017\/06\/19 \d\d:18:20/ | 1 | /genesis_\d{1,3}/ | 123.45 LSK | 5.1 LSK |

Scenario: By clicking 2 should go to page 2
Given I'm on page "/blocks/"
When I click "nav item" no. 2
Then I should be on page "/blocks/2"

Scenario: By clicking 1 should go to page 1
Given I'm on page "/blocks/"
When I click "nav item" no. 1
Then I should be on page "/blocks/1"

Scenario: By clicking next button should go to page 2
Given I'm on page "/blocks/1"
When I click "btn next"
Then I should be on page "/blocks/2"

Scenario: By clicking previous button should go to page 1
Given I'm on page "/blocks/2"
When I click "btn prev"
Then I should be on page "/blocks/1"
Loading

0 comments on commit 43460cf

Please sign in to comment.