using getValue in test

pull/719/head
LianaHus 4 years ago committed by Liana Husikyan
parent 42847dde8c
commit 774bc6f94f
  1. 28
      apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts
  2. 33
      apps/remix-ide-e2e/src/tests/runAndDeploy.ts

@ -16,20 +16,20 @@ class addAtAddressInstance extends EventEmitter {
function addInstance (browser: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean, callback: VoidFunction) {
browser.clickLaunchIcon('udapp').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () {
browser.click('button[id^="runAndDeployAtAdressButton"]')
.execute(function () {
const ret = document.querySelector('div[class^="modal-body"] div').innerHTML
const modal = document.querySelector('#modal-footer-ok') as HTMLElement
modal.click()
return ret
}, [], function (result) {
if (!isValidFormat) {
browser.assert.equal(result.value, 'Invalid address.')
} else if (!isValidChecksum) {
browser.assert.equal(result.value, 'Invalid checksum address.')
}
callback()
})
.execute(function () {
const ret = document.querySelector('div[class^="modal-body"] div').innerHTML
const modal = document.querySelector('#modal-footer-ok') as HTMLElement
modal.click()
return ret
}, [], function (result) {
if (!isValidFormat) {
browser.assert.equal(result.value, 'Invalid address.')
} else if (!isValidChecksum) {
browser.assert.equal(result.value, 'Invalid checksum address.')
}
callback()
})
})
}

@ -1,4 +1,5 @@
'use strict'
import { doesNotThrow } from 'assert'
import { NightwatchBrowser } from "nightwatch"
import init from '../helpers/init'
import sauce from './sauce'
@ -29,15 +30,39 @@ module.exports = {
.clearValue('#value')
.setValue('#value', '0000')
.click('*[data-id="remixDRValueLabel"]')
.assert.containsText('*[data-id="dandrValue"]', '0')
.execute(function () {
const elem = document.getElementById('value') as HTMLInputElement
return elem.value
}, [], function (result) {
console.log('logging ', result)
browser.assert.equal(result.value, "0")
})
.clearValue('#value')
.setValue('#value', '-44')
.assert.containsText('*[data-id="dandrValue"]', '0')
.execute(function () {
const elem = document.getElementById('value') as HTMLInputElement
return elem
}, [], function (result) {
console.log('loging ', result.value)
browser.assert.equal(result.value, "0")
})
.clearValue('#value')
.setValue('#value', '')
.assert.containsText('*[data-id="dandrValue"]', '0')
.execute(function () {
const elem = document.getElementById('value') as HTMLInputElement
return elem
}, [], function (result) {
console.log('loging ', result.value)
browser.assert.equal(result.value, "0")
})
.setValue('#value', 'dragon')
.assert.containsText('*[data-id="dandrValue"]', '0')
.execute(function () {
const elem = document.getElementById('value') as HTMLInputElement
return elem
}, [], function (result) {
console.log('loging ', result.value)
browser.assert.equal(result.value, "0")
})
},
'Should sign message using account key': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save