Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge branch '1.3.0' into 573-multi-account-management
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Nov 10, 2017
2 parents 93e3be3 + be3285f commit cb7ce36
Show file tree
Hide file tree
Showing 19 changed files with 239 additions and 219 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
coverage
app/build
47 changes: 32 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
def fail(reason) {
def pr_branch = ''
def get_build_info() {
pr_branch = ''
if (env.CHANGE_BRANCH != null) {
pr_branch = " (${env.CHANGE_BRANCH})"
}
slackSend color: 'danger', message: "Build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\nCause: ${reason}", channel: '#lisk-nano-jenkins'
build_info = "#${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch}"
return build_info
}

def slack_send(color, message) {
/* Slack channel names are limited to 21 characters */
CHANNEL_MAX_LEN = 21
CHANNEL_SUFFIX = '-jenkins'

channel = "${env.JOB_NAME}".tokenize('/')[0]
channel_len = CHANNEL_MAX_LEN - CHANNEL_SUFFIX.size()
if ( channel.size() > channel_len ) {
channel = channel.substring(0, channel_len)
}
channel += CHANNEL_SUFFIX
echo "[slack_send] channel: ${channel} "

slackSend color: "${color}", message: "${message}", channel: "${channel}"
}

def fail(reason) {
build_info = get_build_info()
slack_send('danger', "Build ${build_info} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\nCause: ${reason}")
currentBuild.result = 'FAILURE'
error("${reason}")
}
Expand All @@ -23,7 +45,7 @@ node('lisk-nano') {

try {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
cd ~/lisk-Linux-x86_64
# work around core bug: config.json gets overwritten; use backup
cp .config.json config_$N.json
Expand Down Expand Up @@ -88,8 +110,8 @@ node('lisk-nano') {

stage ('Deploy') {
try {
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/lisk-nano/$BRANCH_NAME/ && rsync" $WORKSPACE/app/build/ jenkins@master-01:/var/www/test/lisk-nano/$BRANCH_NAME/'
githubNotify context: 'Jenkins test deployment', description: 'Commit was deployed to test', status: 'SUCCESS', targetUrl: "${HUDSON_URL}test/lisk-nano/${BRANCH_NAME}"
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/${JOB_NAME%/*}/$BRANCH_NAME/ && rsync" $WORKSPACE/app/build/ jenkins@master-01:/var/www/test/${JOB_NAME%/*}/$BRANCH_NAME/'
githubNotify context: 'Jenkins test deployment', description: 'Commit was deployed to test', status: 'SUCCESS', targetUrl: "${HUDSON_URL}test/" + "${JOB_NAME}".tokenize('/')[0] + "/${BRANCH_NAME}"
} catch (err) {
echo "Error: ${err}"
fail('Stopping build: deploy failed')
Expand All @@ -116,7 +138,7 @@ node('lisk-nano') {
ansiColor('xterm') {
withCredentials([string(credentialsId: 'lisk-nano-testnet-passphrase', variable: 'TESTNET_PASSPHRASE')]) {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
# End to End test configuration
export DISPLAY=:1$N
Expand All @@ -139,7 +161,7 @@ node('lisk-nano') {
echo "Error: ${err}"
} finally {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
curl --verbose http://127.0.0.1:400$N/api/blocks/getNethash || true
( cd ~/lisk-Linux-x86_64 && bash lisk.sh stop_node -p etc/pm2-lisk_$N.json ) || true
pgrep --list-full -f "Xvfb :1$N" || true
Expand All @@ -154,19 +176,14 @@ node('lisk-nano') {
deleteDir()
}

def pr_branch = ''
if (env.CHANGE_BRANCH != null) {
pr_branch = " (${env.CHANGE_BRANCH})"
}
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
/* delete all files on success */
deleteDir()
/* notify of success if previous build failed */
previous_build = currentBuild.getPreviousBuild()
if (previous_build != null && previous_build.result == 'FAILURE') {
slackSend color: 'good',
message: "Recovery: build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch} was successful.",
channel: '#lisk-nano-jenkins'
build_info = get_build_info()
slack_send('good', "Recovery: build ${build_info} was successful.")
}
} else {
archiveArtifacts allowEmptyArchive: true, artifacts: 'e2e-test-screenshots/'
Expand Down
1 change: 0 additions & 1 deletion config/webpack.config.react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
const { resolve } = require('path');
const webpack = require('webpack');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const I18nScannerPlugin = require('../src/i18n-scanner');
Expand Down
49 changes: 49 additions & 0 deletions features/accountManagement.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Feature: Account management
Scenario: should allow to save account locally, after page reload it should require passphrase to do the first transaction, and remember the passphrase for next transactions
Given I'm logged in as "genesis"
When I click "save account" in main menu
And I click "save account button"
And I wait 1 seconds
And I should see text "Account saved" in "toast" element
And I refresh the page
And I wait 2 seconds
Then I should be logged in
And I click "send button"
And I should see empty "passphrase" field
And I fill in "1" to "amount" field
And I fill in "537318935439898807L" to "recipient" field
And I fill in passphrase of "genesis" to "passphrase" field
And I click "submit button"
And I click "ok button"
And I wait 1 seconds
And I click "send button"
And I fill in "2" to "amount" field
And I fill in "537318935439898807L" to "recipient" field
And I click "submit button"
And I should see alert dialog with title "Success" and text "Your transaction of 2 LSK to 537318935439898807L was accepted and will be processed in a few seconds."

Scenario: should allow to forget locally saved account
Given I'm logged in as "any account"
When I click "save account" in main menu
And I click "save account button"
And I refresh the page
And I wait 2 seconds
And I click "forget account" in main menu
And I wait 1 seconds
Then I should see text "Account was successfully forgotten." in "toast" element
And I refresh the page
And I should be on login page

@integration
Scenario: should allow to exit save account dialog with "cancel button"
Given I'm logged in as "any account"
When I click "save account" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should allow to exit save account dialog with "x button"
Given I'm logged in as "any account"
When I click "save account" in main menu
And I click "x button"
Then I should see no "modal dialog"
11 changes: 4 additions & 7 deletions features/forging.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
Feature: Forging tab
Scenario: should allow to view forging center if account is delegate
Scenario: should allow to view forging center if account is delegate and should show more blocks on scroll
Given I'm logged in as "delegate"
When I click tab number 3
Then I should see forging center
And I should see table with 20 lines
And I scroll to the bottom
And I should see table with 40 lines

Scenario: should show more blocks on scroll
Given I'm logged in as "delegate"
When I click tab number 3
Then I should see table with 20 lines
When I scroll to the bottom
Then I should see table with 40 lines
8 changes: 0 additions & 8 deletions features/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ Feature: Login page
Then I should be logged in
And I should see text "Mainnet" in "peer network" element

Scenario: should allow to login to Testnet
Given I'm on login page
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field
And I select option no. 2 from "network" select
And I click "login button"
Then I should be logged in
And I should see text "Testnet" in "peer network" element

Scenario: should remember the selected network
Given I'm on login page
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field
Expand Down
101 changes: 0 additions & 101 deletions features/menu.feature

This file was deleted.

35 changes: 35 additions & 0 deletions features/registerDelegate.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Feature: Register delegate
Scenario: should allow to register a delegate
Given I'm logged in as "delegate candidate"
When I click "register as delegate" in main menu
And I fill in "test" to "username" field
And I click "register button"
Then I should see alert dialog with title "Success" and text "Delegate registration was successfully submitted with username: "test". It can take several seconds before it is processed."
And I click "ok button"
And I wait 15 seconds
And I should see text "test" in "delegate name" element
And There is no "register as delegate" in main menu

Scenario: should allow to register a delegate with second passphrase
Given I'm logged in as "second passphrase account"
When I click "register as delegate" in main menu
And I fill in "test2" to "username" field
And I fill in second passphrase of "second passphrase account" to "second passphrase" field
And I click "register button"
Then I should see alert dialog with title "Success" and text "Delegate registration was successfully submitted with username: "test2". It can take several seconds before it is processed."

@integration
Scenario: should allow to exit delegate registration dialog
Given I'm logged in as "genesis"
When I click "register as delegate" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should not allow to register delegate if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "register as delegate" in main menu
Then I should see "Insufficient funds for 25 LSK fee" error message
And "register button" should be disabled


28 changes: 28 additions & 0 deletions features/registerSecondPassphrase.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Feature: Register second passphrase
Scenario: should allow to set 2nd passphrase
Given I'm logged in as "second passphrase candidate"
When I click "register second passphrase" in main menu
And I click "next button"
And I 250 times move mouse randomly
And I remember passphrase, click "next button", fill in missing word
And I click "next button"
Then I should see alert dialog with title "Success" and text "Second passphrase registration was successfully submitted. It can take several seconds before it is processed."

Scenario: should not allow to set 2nd passphrase again
Given I'm logged in as "second passphrase account"
Then There is no "register second passphrase" in main menu

@integration
Scenario: should not allow to set 2nd passphrase if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "register second passphrase" in main menu
Then I should see "Insufficient funds for 5 LSK fee" error message
And "next button" should be disabled

@integration
Scenario: should allow to exit 2nd passphrase registration dialog
Given I'm logged in as "genesis"
When I click "register second passphrase" in main menu
And I click "cancel button"
Then I should see no "modal dialog"

17 changes: 2 additions & 15 deletions features/send.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,22 @@ Feature: Send dialog
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your transaction of 1 LSK to 537318935439898807L was accepted and will be processed in a few seconds."

@integration
Scenario: should not allow to send when not enough funds
Given I'm logged in as "empty account"
When I click "send button"
And I fill in "1" to "amount" field
And I fill in "537318935439898807L" to "recipient" field
Then I should see "Insufficient funds" error message

Scenario: should not allow to send when invalid address
Given I'm logged in as "any account"
When I click "send button"
And I fill in "1243409812409" to "recipient" field
And I fill in "1" to "amount" field
Then I should see "Invalid" error message

@integration
Scenario: should allow to exit send dialog
Given I'm logged in as "any account"
When I click "send button"
And I wait 1 seconds
And I click "cancel button"
Then I should see no "modal dialog"

Scenario: should allow to send all funds
Given I'm logged in as "send all account"
When I click "send button"
And I fill in "537318935439898807L" to "recipient" field
And I click "send maximum amount" in "transaction amount" menu
And I click "submit button"
Then I should see alert dialog with title "Success" and text "Your transaction of 100 LSK to 537318935439898807L was accepted and will be processed in a few seconds."

Scenario: should allow to send with second passphrase
Given I'm logged in as "second passphrase account"
When I click "send button"
Expand Down
Loading

0 comments on commit cb7ce36

Please sign in to comment.