-
Notifications
You must be signed in to change notification settings - Fork 60
Move network selection to login module - Closes #89 #102
Changes from 2 commits
877eb84
80a1a2a
f2a83cd
47035c6
0729eda
4e5edef
83a1afb
cef335a
c8e1571
00c3b1f
c72a85d
59fc3d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,7 @@ md-content(layout='column', layout-gt-xs='row') | |
i.material-icons.offline(ng-show='!$ctrl.$peers.online') error | ||
i.material-icons.online(ng-show='$ctrl.$peers.online') check circle | ||
span.md-title.title Peer | ||
md-select(ng-model='$ctrl.$peers.currentPeerConfig', aria-label='Peer') | ||
md-optgroup(ng-repeat='(name, peers) in $ctrl.$peers.stack', ng-if='peers.length', label='{{ name }}') | ||
md-option(ng-repeat='peer in peers', ng-value='peer') {{ peer.node }}{{ peer.port ? ':' + peer.port : '' }} | ||
div.address.value {{ $ctrl.$peers.currentPeerConfig.node }}:{{ $ctrl.$peers.currentPeerConfig.port }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .address class shouldn't be here, it causes this warning in e2e tests:
|
||
md-card.offline-hide(flex-gt-xs=33) | ||
md-card-content(layout='column', layout-align='center center') | ||
span.md-title.title Balance | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,7 @@ module.exports = function (config) { | |
// If true, Karma captures browsers, runs the tests and exits | ||
singleRun: !opts.live, | ||
client: { | ||
captureConsole: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should go a separate commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree |
||
mocha: { | ||
opts: 'test/mocha.opts', // You can set opts to equal true then plugin will load opts from default location 'test/mocha.opts' | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ function checkErrorMessage(message) { | |
|
||
function launchApp() { | ||
browser.ignoreSynchronization = true; | ||
browser.driver.manage().window().setSize(1000, 1000); | ||
browser.get('http://localhost:8080#?peerStack=localhost'); | ||
} | ||
|
||
|
@@ -83,11 +84,15 @@ function testNewAccount() { | |
launchApp(); | ||
|
||
element.all(by.css('.md-button.md-primary')).get(0).click(); | ||
/** | ||
* To generate a random pattern of mousemove events, we're randomizing the x,y pairs that | ||
* based on even/odd valkuds of i will locate right/left halves of screen | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spelling and grammar.
|
||
*/ | ||
for (let i = 0; i < 250; i++) { | ||
browser.actions() | ||
.mouseMove(element(by.css('body')), { | ||
x: Math.floor(Math.random() * 1000), | ||
y: Math.floor(Math.random() * 1000), | ||
x: 500 + (Math.floor((((i % 2) * 2) - 1) * (249 + (Math.random() * 250)))), | ||
y: 500 + (Math.floor((((i % 2) * 2) - 1) * (249 + (Math.random() * 250)))), | ||
}).perform(); | ||
browser.sleep(5); | ||
} | ||
|
@@ -120,22 +125,19 @@ function testAddress() { | |
} | ||
|
||
function testPeer() { | ||
login(masterAccount); | ||
waitForElemAndCheckItsText('.peer md-select-value .md-text', 'localhost:4000'); | ||
expect(element.all(by.css('form md-select md-select-value span:first-child')).get(0).getText()).toEqual('Choose your network node'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't work if you run only this one because you first need to |
||
} | ||
|
||
function testChangePeer() { | ||
login(masterAccount); | ||
|
||
const peerElem = element(by.css('.peer md-select-value')); | ||
browser.wait(EC.presenceOf(peerElem), waitTime); | ||
const peerElem = element(by.css('form md-select')); | ||
// browser.wait(EC.presenceOf(peerElem), waitTime); | ||
peerElem.click(); | ||
|
||
const optionElem = element.all(by.css('md-select-menu md-optgroup md-option')).get(0); | ||
browser.wait(EC.presenceOf(optionElem), waitTime); | ||
optionElem.click(); | ||
|
||
waitForElemAndCheckItsText('.peer md-select-value .md-text', 'node01.lisk.io'); | ||
waitForElemAndCheckItsText('form md-select-value .md-text', 'node01.lisk.io'); | ||
} | ||
|
||
function testShowBalance() { | ||
|
@@ -177,16 +179,17 @@ function testLoadMoreTransactions() { | |
const moreButton = element(by.css('transactions button.more')); | ||
browser.wait(EC.presenceOf(moreButton), waitTime); | ||
moreButton.click(); | ||
browser.sleep(200); | ||
|
||
expect(element.all(by.css('transactions table tbody tr')).count()).toEqual(20); | ||
} | ||
|
||
describe('Lisk Nano functionality', () => { | ||
it('should allow to login', testLogin); | ||
it('should allow to logout', testLogout); | ||
it('should show address', testAddress); | ||
it('should show peer', testPeer); | ||
it('should allow to change peer', testChangePeer); | ||
it('should show address', testAddress); | ||
it('should show balance', testShowBalance); | ||
it('should allow to send transaction when enough funds and correct address form', testSend); | ||
it('should not allow to send transaction when not enough funds', testSendWithNotEnoughFunds); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ const PATHS = { | |
}; | ||
|
||
const common = { | ||
devtool: 'source-map', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should go a separate commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree |
||
entry: nodeEnvironment === 'test' ? {} : { | ||
app: PATHS.app, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would phrase it as:
Choose a peer
.Also, upon logging in, the selection is referred to as a "Peer", not a node.
I'm happy to see either or, as long as the terminology is consistently applied.