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

Setup testnet tests - Closes #925 #960

Merged
merged 4 commits into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,21 @@ node('lisk-nano') {
stage ('Start Dev Server and Run E2E Tests') {
try {
ansiColor('xterm') {
sh '''
N=${EXECUTOR_NUMBER:-0}
withCredentials([string(credentialsId: 'lisk-nano-testnet-passphrase', variable: 'TESTNET_PASSPHRASE')]) {
sh '''
N=${EXECUTOR_NUMBER:-0}

# End to End test configuration
export DISPLAY=:1$N
Xvfb :1$N -ac -screen 0 1280x1024x24 &
# End to End test configuration
export DISPLAY=:1$N
Xvfb :1$N -ac -screen 0 1280x1024x24 &

# Run end-to-end tests
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL http://127.0.0.1:400$N
'''
# Run end-to-end tests

npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL https://testnet.lisk.io --cucumberOpts.tags @testnet --params.useTestnetPassphrase true
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL http://127.0.0.1:400$N --cucumberOpts.tags @testnet --params.useTestnetPassphrase true --params.network testnet
npm run --silent e2e-test -- --params.baseURL file://$WORKSPACE/app/build/index.html --params.liskCoreURL http://127.0.0.1:400$N
'''
}
}
} catch (err) {
echo "Error: ${err}"
Expand Down
1 change: 1 addition & 0 deletions features/send.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Feature: Send dialog
@testnet
Scenario: should allow to send when enough funds and correct address form
Given I'm logged in as "genesis"
When I click "send button"
Expand Down
6 changes: 5 additions & 1 deletion features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {

Given('I\'m logged in as "{accountName}"', { timeout: 2 * defaultTimeout }, (accountName, callback) => {
browser.get(browser.params.baseURL);
waitForElemAndSendKeys('.passphrase input', accounts[accountName].passphrase, () => {
const passphrase = browser.params.useTestnetPassphrase
? browser.params.testnetPassphrase
: accounts[accountName].passphrase;

waitForElemAndSendKeys('.passphrase input', passphrase, () => {
waitForElemAndClickIt('.login-button', callback);
});
});
Expand Down
3 changes: 2 additions & 1 deletion features/step_definitions/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const { defineSupportCode } = require('cucumber');
const fs = require('fs');
const localStorage = require('../support/localStorage.js');
const networks = require('./../../src/constants/networks');

function slugify(text) {
return text.toString().toLowerCase()
Expand Down Expand Up @@ -39,7 +40,7 @@ defineSupportCode(({ Before, After }) => {
browser.get(browser.params.baseURL);
localStorage.clear();
localStorage.setItem('address', browser.params.liskCoreURL);
localStorage.setItem('network', 2);
localStorage.setItem('network', networks[browser.params.network].code);
callback();
});

Expand Down
1 change: 1 addition & 0 deletions features/voting.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Feature: Voting tab
And I click checkbox on table row no. 5
And I should see no "voting bar"

@testnet
Scenario: should allow to select delegates in the "Voting" tab and vote for them
Given I'm logged in as "delegate candidate"
When I click tab number 2
Expand Down
5 changes: 4 additions & 1 deletion protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.config = {

cucumberOpts: {
require: 'features/step_definitions/*.js',
tags: '~@ignore',
tags: [],
format: 'pretty',
profile: false,
'no-source': true,
Expand All @@ -24,5 +24,8 @@ exports.config = {
screenshotFolder: 'e2e-test-screenshots',
baseURL: 'http://localhost:8080/',
liskCoreURL: 'http://localhost:4000/',
testnetPassphrase: process.env.TESTNET_PASSPHRASE,
useTestnetPassphrase: false,
network: 'customNode',
},
};
2 changes: 1 addition & 1 deletion src/constants/networks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
mainnet: { // network name translation t('Mainnet');
name: 'Mainnet',
ssl: true,
Expand Down