using getValue in test

pull/5370/head
LianaHus 4 years ago committed by Liana Husikyan
parent 21f8544eea
commit 5568844672
  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) { function addInstance (browser: NightwatchBrowser, address: string, isValidFormat: boolean, isValidChecksum: boolean, callback: VoidFunction) {
browser.clickLaunchIcon('udapp').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { browser.clickLaunchIcon('udapp').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () {
browser.click('button[id^="runAndDeployAtAdressButton"]') browser.click('button[id^="runAndDeployAtAdressButton"]')
.execute(function () { .execute(function () {
const ret = document.querySelector('div[class^="modal-body"] div').innerHTML const ret = document.querySelector('div[class^="modal-body"] div').innerHTML
const modal = document.querySelector('#modal-footer-ok') as HTMLElement const modal = document.querySelector('#modal-footer-ok') as HTMLElement
modal.click() modal.click()
return ret return ret
}, [], function (result) { }, [], function (result) {
if (!isValidFormat) { if (!isValidFormat) {
browser.assert.equal(result.value, 'Invalid address.') browser.assert.equal(result.value, 'Invalid address.')
} else if (!isValidChecksum) { } else if (!isValidChecksum) {
browser.assert.equal(result.value, 'Invalid checksum address.') browser.assert.equal(result.value, 'Invalid checksum address.')
} }
callback() callback()
}) })
}) })
} }

@ -1,4 +1,5 @@
'use strict' 'use strict'
import { doesNotThrow } from 'assert'
import { NightwatchBrowser } from "nightwatch" import { NightwatchBrowser } from "nightwatch"
import init from '../helpers/init' import init from '../helpers/init'
import sauce from './sauce' import sauce from './sauce'
@ -29,15 +30,39 @@ module.exports = {
.clearValue('#value') .clearValue('#value')
.setValue('#value', '0000') .setValue('#value', '0000')
.click('*[data-id="remixDRValueLabel"]') .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') .clearValue('#value')
.setValue('#value', '-44') .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') .clearValue('#value')
.setValue('#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') .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) { 'Should sign message using account key': function (browser: NightwatchBrowser) {

Loading…
Cancel
Save