From b1efcf4d98af0791385b65ef0886c2cec256dcda Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 28 Nov 2017 15:42:41 +0100 Subject: [PATCH] test filter --- test-browser/helpers/contracts.js | 19 ++++++++++++++++++- test-browser/tests/compiling.js | 5 +++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/test-browser/helpers/contracts.js b/test-browser/helpers/contracts.js index 3b8d76554b..d88a114f55 100644 --- a/test-browser/helpers/contracts.js +++ b/test-browser/helpers/contracts.js @@ -9,7 +9,8 @@ module.exports = { verifyContract: verifyContract, testFunction, checkDebug, - goToVMtraceStep + goToVMtraceStep, + useFilter } function getCompiledContracts (browser, compiled, callback) { @@ -116,6 +117,22 @@ function addFile (browser, name, content, done) { }) } +function useFilter (browser, filter, test, done) { + var filterClass = '#editor-container div[class^="search"] input[class^="filter"]' + browser.setValue(filterClass, filter, function () { + browser.execute(function () { + return document.querySelector('#modal-dialog #prompt_text').innerHTML === test + }, [], function (result) { + browser.setValue(filterClass, '', function () { + if (!result.value) { + browser.assert.fail('useFilter on ' + filter + ' ' + test, 'info about error', '') + } + done() + }) + }) + }) +} + function switchFile (browser, name, done) { browser .useXpath() diff --git a/test-browser/tests/compiling.js b/test-browser/tests/compiling.js index f8a4aa167b..b9704b2c50 100644 --- a/test-browser/tests/compiling.js +++ b/test-browser/tests/compiling.js @@ -44,6 +44,11 @@ function testSimpleContract (browser, callback) { "0": "uint256: 8" }`) .pause(500) + .perform((client, done) => { + contractHelper.useFilter(browser, '0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '', () => { + done() + }) + }) .testFunction('g - transact (not payable)', '0xb1532162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92781', '[vm] from:0xca3...a733c, to:TestContract.g() 0x692...77b3a, value:0 wei, data:0xe21...79b8e, 0 logs, hash:0xb15...92781', null, `{