Skip to content

Commit

Permalink
Merge branch 'develop' into copy-abi
Browse files Browse the repository at this point in the history
  • Loading branch information
vbaranov authored Dec 26, 2018
2 parents e155e9e + dca7c49 commit 887b45d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
6 changes: 3 additions & 3 deletions old-ui/app/account-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ AccountDetailScreen.prototype.render = function () {

h('.flex-grow'),

h('button', {
!ifContractAcc(currentKeyring) ? h('button', {
onClick: () => props.dispatch(actions.buyEthView(selected)),
style: { marginRight: '10px' },
}, 'Buy'),
}, 'Buy') : null,

h('button', {
onClick: () => {
Expand All @@ -228,7 +228,7 @@ AccountDetailScreen.prototype.render = function () {
return props.dispatch(actions.showSendPage())
}
},
}, 'Send'),
}, ifContractAcc(currentKeyring) ? 'Execute methods' : 'Send'),

]),
]),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ module.exports = {
buttonNext: By.css('.section > div:nth-child(1) > button:nth-child(2)'),
buttonArrow: By.className('fa fa-arrow-left fa-lg cursor-pointer'),
buttonCopyABI: By.className('btn-violet'),
buttonExecuteMethod: By.css('#app-content > div > div.app-primary.from-right > div > div > div.flex-row > button'),
},

eventsEmitter: {
button: By.className('btn btn-default'),
event: By.className('Toastify__toast-body'),
Expand Down
39 changes: 25 additions & 14 deletions test/e2e/metamask.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,14 @@ describe('Metamask popup page', async function () {
describe('Execute Method screen', () => {
const notContractAddress = '0x56B2e3C3cFf7f3921Dc2e0F8B8e20d1eEc29216b'
describe("Check UI and button's functionality", () => {
it("Click button 'Send', 'Execute Method' screen opens", async function () {

it("Click button 'Execute method'", async function () {
await driver.navigate().refresh()
await delay(2000)
const button = await waitUntilShowUp(screens.main.buttons.send)
await click(button)
const button = await waitUntilShowUp(screens.executeMethod.buttonExecuteMethod)
assert.notEqual(button, false, "button doesn't displayed")
assert.equal(await button.getText(), 'Execute methods', 'button has incorrect name')
await button.click()
})

it('title is displayed and correct', async function () {
Expand All @@ -411,18 +414,19 @@ describe('Metamask popup page', async function () {
const identicon = await waitUntilShowUp(screens.main.identicon, 40)
assert.notEqual(identicon, false, "main screen isn't opened")
})
})
describe('Check output for data type : ADDRESS', () => {
const address = '0x56B2e3C3cFf7f3921Dc2e0F8B8e20d1eEc29216b'

it("Click button 'Send', 'Execute Method' screen opens", async function () {
it("Click button 'Execute method'", async function () {
await driver.navigate().refresh()
await delay(2000)
const button = await waitUntilShowUp(screens.main.buttons.send)
await click(button)
const button = await waitUntilShowUp(screens.executeMethod.buttonExecuteMethod)
assert.notEqual(button, false, "button doesn't displayed")
assert.equal(await button.getText(), 'Execute methods', 'button has incorrect name')
await button.click()
})

})
describe('Check output for data type : ADDRESS', () => {
const address = '0x56B2e3C3cFf7f3921Dc2e0F8B8e20d1eEc29216b'

it("Select method 'returnAddress'", async function () {
const field = await waitUntilShowUp(screens.executeMethod.selectArrow)
await field.click()
Expand Down Expand Up @@ -528,7 +532,8 @@ describe('Metamask popup page', async function () {
})
})
describe('Check output for data type : BOOLEAN', () => {
it("Select method 'returnBoolean'", async function () {

it("Select method 'returnBoolean'", async function () {
const field = await waitUntilShowUp(screens.executeMethod.selectArrow)
await field.click()
await waitUntilShowUp(screens.executeMethod.items)
Expand Down Expand Up @@ -594,8 +599,10 @@ describe('Metamask popup page', async function () {

})
describe('Check output for data type : BYTES', () => {

const bytesValue = '0x010203'
it("Select method 'returnBytes1'", async function () {

it("Select method 'returnBytes1'", async function () {
const field = await waitUntilShowUp(screens.executeMethod.selectArrow)
await field.click()
await waitUntilShowUp(screens.executeMethod.items)
Expand Down Expand Up @@ -638,8 +645,10 @@ describe('Metamask popup page', async function () {

})
describe('Check output for data type : UINT256', () => {

const uint256Value = '1122334455667788991122334455667788'
it("Select method 'returnUint256'", async function () {

it("Select method 'returnUint256'", async function () {
const field = await waitUntilShowUp(screens.executeMethod.selectArrow)
await field.click()
await waitUntilShowUp(screens.executeMethod.items)
Expand Down Expand Up @@ -683,8 +692,10 @@ describe('Metamask popup page', async function () {

})
describe('Check output for data type : INT256', () => {

const int256Value = '-1122334455667788991122334455667788'
it("Select method 'returnInt256'", async function () {

it("Select method 'returnInt256'", async function () {
const field = await waitUntilShowUp(screens.executeMethod.selectArrow)
await field.click()
await waitUntilShowUp(screens.executeMethod.items)
Expand Down

0 comments on commit 887b45d

Please sign in to comment.