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

Test suite update - Closes #844 #876

Merged
merged 32 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a27d7b3
Use Node.js version from .nvmrc in Jenkinsfile
francoilol Nov 30, 2018
8569e3a
Use Node.js version 8.14.0
francoilol Nov 30, 2018
555c303
Test against Core 1.3.0
francoilol Nov 30, 2018
0709404
Known address base improvement
Jan 3, 2019
add8437
Test script and config update
Jan 3, 2019
ecdbb09
Update test for address
Jan 3, 2019
d382945
update testing for Blocks
Jan 3, 2019
c2529e5
update testing for delegate
Jan 3, 2019
df419bb
update testing for delegate monitor
Jan 3, 2019
bd49adc
Update testing for footer
Jan 3, 2019
dc3641a
Update testing for menu feature
Jan 3, 2019
f737a07
Update testing for home
Jan 3, 2019
2b35b15
Change the pagination btn class name for testing
Jan 3, 2019
aa23308
Merge with 837-use-node.js-8.14.0
Jan 4, 2019
2133d93
Add testing for breadcrumb feature
Jan 4, 2019
cd283dd
Jenkinsfile update
Jan 4, 2019
0b3e547
Update Lisk Core to 1.3.1
Jan 4, 2019
86da58e
Update testing for tools feature
Jan 4, 2019
eacc020
Fixed bug to display 20 items on a page for transactions
Jan 4, 2019
67a93f7
Add testing for transactions page
Jan 4, 2019
4f7578b
Update testing for cookie
Jan 7, 2019
d60d471
Update testing for top accounts
Jan 7, 2019
05c52a2
Update testing for Activity Graph
Jan 7, 2019
eac4537
Update testing for Market Watcher
Jan 7, 2019
5f650a5
Update testing for transaction
Jan 7, 2019
801b2a5
Remove unnecesarry css class at nav dropdown
Jan 7, 2019
62fc7d8
Update h1 elements for testing
Jan 7, 2019
850df3a
Add testing for Blocks page
Jan 7, 2019
b7e4ea7
Update testing for home and tweak for Market Watcher
Jan 7, 2019
4f80e59
Update config for testing Core
Jan 7, 2019
2bac29b
Merge branch '844-test-core' of github.com:LiskHQ/lisk-explorer into …
Jan 8, 2019
b37a88b
Update core_config.json
Jan 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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