|
|
@ -4,14 +4,16 @@ import { NightwatchBrowser } from 'nightwatch' |
|
|
|
import init from '../helpers/init' |
|
|
|
import init from '../helpers/init' |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
module.exports = { |
|
|
|
'@disabled': true, |
|
|
|
|
|
|
|
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
|
|
|
before: function (browser: NightwatchBrowser, done: VoidFunction) { |
|
|
|
init(browser, done, 'http://127.0.0.1:8080', true) |
|
|
|
init(browser, done, 'http://127.0.0.1:8080', true) |
|
|
|
}, |
|
|
|
}, |
|
|
|
'Should find text': function (browser: NightwatchBrowser) { |
|
|
|
'Should find text': function (browser: NightwatchBrowser) { |
|
|
|
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') |
|
|
|
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') |
|
|
|
.click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') |
|
|
|
.click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'read').pause(1000) |
|
|
|
.waitForElementVisible('*[id="search_include"]') |
|
|
|
|
|
|
|
.setValue('*[id="search_include"]', ', *.txt').pause(2000) |
|
|
|
|
|
|
|
.setValue('*[id="search_input"]', 'read').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
|
|
|
|
.pause(1000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'contracts', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'contracts', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'README.TXT', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'README.TXT', 60000) |
|
|
@ -24,12 +26,28 @@ module.exports = { |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 6) |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 6) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
'Should find text with exclude': function (browser: NightwatchBrowser) { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
|
|
|
|
.setValue('*[id="search_input"]', 'contract').pause(1000) |
|
|
|
|
|
|
|
.clearValue('*[id="search_include"]').pause(2000) |
|
|
|
|
|
|
|
.setValue('*[id="search_include"]', '**').sendKeys('*[id="search_include"]', browser.Keys.ENTER).pause(4000) |
|
|
|
|
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
|
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 44) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.setValue('*[id="search_exclude"]', ',contracts/**').sendKeys('*[id="search_exclude"]', browser.Keys.ENTER).pause(4000) |
|
|
|
|
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
|
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 38) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.clearValue('*[id="search_include"]').setValue('*[id="search_include"]', '*.sol, *.js, *.txt') |
|
|
|
|
|
|
|
.clearValue('*[id="search_exclude"]').setValue('*[id="search_exclude"]', '.*/**/*') |
|
|
|
|
|
|
|
}, |
|
|
|
'Should find regex': function (browser: NightwatchBrowser) { |
|
|
|
'Should find regex': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[data-id="search_use_regex"]').click('*[data-id="search_use_regex"]') |
|
|
|
.waitForElementVisible('*[data-id="search_use_regex"]').click('*[data-id="search_use_regex"]') |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', '^contract').pause(1000) |
|
|
|
.setValue('*[id="search_input"]', '^contract').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '2_OWNER.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '2_OWNER.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '1_STORAGE.SOL', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', '1_STORAGE.SOL', 60000) |
|
|
@ -42,39 +60,36 @@ module.exports = { |
|
|
|
'Should find matchcase': function (browser: NightwatchBrowser) { |
|
|
|
'Should find matchcase': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[data-id="search_use_regex"]').click('*[data-id="search_use_regex"]') |
|
|
|
.waitForElementVisible('*[data-id="search_use_regex"]').click('*[data-id="search_use_regex"]') |
|
|
|
.waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]') |
|
|
|
.waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]').pause(4000) |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 0) |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 0) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'Contract').pause(1000) |
|
|
|
.setValue('*[id="search_input"]', 'Contract').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(3000) |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 9) |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 3) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'DEPLOY_ETHERS.JS', 60000) |
|
|
|
|
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'DEPLOY_WEB3.JS', 60000) |
|
|
|
|
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'STORAGE.TEST.JS', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'STORAGE.TEST.JS', 60000) |
|
|
|
.waitForElementContainsText('*[data-id="search_results"]', 'scripts', 60000)
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
'Should find matchword': function (browser: NightwatchBrowser) { |
|
|
|
'Should find matchword': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]') |
|
|
|
.waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]') |
|
|
|
.waitForElementVisible('*[data-id="search_whole_word"]').click('*[data-id="search_whole_word"]') |
|
|
|
.waitForElementVisible('*[data-id="search_whole_word"]').click('*[data-id="search_whole_word"]').pause(2000) |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'contract').pause(1000) |
|
|
|
.setValue('*[id="search_input"]', 'contract').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(4000) |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 29) |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 13) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
'Should replace text': function (browser: NightwatchBrowser) { |
|
|
|
'Should replace text': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') |
|
|
|
.waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') |
|
|
|
.waitForElementVisible('*[id="search_replace"]') |
|
|
|
.waitForElementVisible('*[id="search_replace"]') |
|
|
|
.setValue('*[id="search_replace"]', 'replacing').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', 'replacing').sendKeys('*[id="search_replace"]', browser.Keys.ENTER).pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-30-71"]') |
|
|
|
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-33-71"]') |
|
|
|
.moveToElement('*[data-id="contracts/2_Owner.sol-30-71"]', 10, 10) |
|
|
|
.moveToElement('*[data-id="contracts/2_Owner.sol-33-71"]', 10, 10) |
|
|
|
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-30-71"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-33-71"]') |
|
|
|
.click('*[data-id="replace-contracts/2_Owner.sol-30-71"]').pause(2000). |
|
|
|
.click('*[data-id="replace-contracts/2_Owner.sol-33-71"]').pause(2000). |
|
|
|
modalFooterOKClick('confirmreplace').pause(2000). |
|
|
|
modalFooterOKClick('confirmreplace').pause(2000). |
|
|
|
getEditorValue((content) => { |
|
|
|
getEditorValue((content) => { |
|
|
|
browser.assert.ok(content.includes('replacing deployer for a constructor'), 'should replace text ok') |
|
|
|
browser.assert.ok(content.includes('replacing deployer for a constructor'), 'should replace text ok') |
|
|
@ -83,12 +98,12 @@ module.exports = { |
|
|
|
'Should replace text without confirmation': function (browser: NightwatchBrowser) { |
|
|
|
'Should replace text without confirmation': function (browser: NightwatchBrowser) { |
|
|
|
browser.click('*[data-id="confirm_replace_label"]').pause(500) |
|
|
|
browser.click('*[data-id="confirm_replace_label"]').pause(500) |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'replacing').pause(1000) |
|
|
|
.setValue('*[id="search_input"]', 'replacing').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', '2').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', '2').pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-30-71"]') |
|
|
|
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-33-71"]') |
|
|
|
.moveToElement('*[data-id="contracts/2_Owner.sol-30-71"]', 10, 10) |
|
|
|
.moveToElement('*[data-id="contracts/2_Owner.sol-33-71"]', 10, 10) |
|
|
|
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-30-71"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-33-71"]') |
|
|
|
.click('*[data-id="replace-contracts/2_Owner.sol-30-71"]').pause(2000). |
|
|
|
.click('*[data-id="replace-contracts/2_Owner.sol-33-71"]').pause(2000). |
|
|
|
getEditorValue((content) => { |
|
|
|
getEditorValue((content) => { |
|
|
|
browser.assert.ok(content.includes('replacing2 deployer for a constructor'), 'should replace text ok') |
|
|
|
browser.assert.ok(content.includes('replacing2 deployer for a constructor'), 'should replace text ok') |
|
|
|
}) |
|
|
|
}) |
|
|
@ -96,7 +111,7 @@ module.exports = { |
|
|
|
'Should replace all & undo': function (browser: NightwatchBrowser) { |
|
|
|
'Should replace all & undo': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'storage') |
|
|
|
.setValue('*[id="search_input"]', 'storage').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.setValue('*[id="search_replace"]', '123test').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', '123test').pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="replace-all-contracts/1_Storage.sol"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-all-contracts/1_Storage.sol"]') |
|
|
@ -115,7 +130,7 @@ module.exports = { |
|
|
|
'Should replace all & undo & switch between files': function (browser: NightwatchBrowser) { |
|
|
|
'Should replace all & undo & switch between files': function (browser: NightwatchBrowser) { |
|
|
|
browser.waitForElementVisible('*[id="search_input"]') |
|
|
|
browser.waitForElementVisible('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'storage') |
|
|
|
.setValue('*[id="search_input"]', 'storage').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.setValue('*[id="search_replace"]', '123test').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', '123test').pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="replace-all-contracts/1_Storage.sol"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-all-contracts/1_Storage.sol"]') |
|
|
@ -153,7 +168,7 @@ module.exports = { |
|
|
|
.addFile('test.sol', { content: '123' }) |
|
|
|
.addFile('test.sol', { content: '123' }) |
|
|
|
.click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') |
|
|
|
.click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', '123') |
|
|
|
.setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.setValue('*[id="search_replace"]', '456').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', '456').pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="replace-all-test.sol"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-all-test.sol"]') |
|
|
@ -173,7 +188,7 @@ module.exports = { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', '123') |
|
|
|
.setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.clearValue('*[id="search_replace"]') |
|
|
|
.setValue('*[id="search_replace"]', 'replaced').pause(1000) |
|
|
|
.setValue('*[id="search_replace"]', 'replaced').pause(1000) |
|
|
|
.waitForElementVisible('*[data-id="replace-all-test.sol"]') |
|
|
|
.waitForElementVisible('*[data-id="replace-all-test.sol"]') |
|
|
@ -206,31 +221,11 @@ module.exports = { |
|
|
|
}) |
|
|
|
}) |
|
|
|
.waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') |
|
|
|
.waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') |
|
|
|
}, |
|
|
|
}, |
|
|
|
'Should find text with include': function (browser: NightwatchBrowser) { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.clearValue('*[id="search_input"]') |
|
|
|
|
|
|
|
.setValue('*[id="search_input"]', 'contract').pause(1000) |
|
|
|
|
|
|
|
.setValue('*[id="search_include"]', 'contracts/**').pause(2000) |
|
|
|
|
|
|
|
.elements('css selector','.search_plugin_search_line', (res) => { |
|
|
|
|
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 4) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'Should find text with exclude': function (browser: NightwatchBrowser) { |
|
|
|
|
|
|
|
browser |
|
|
|
|
|
|
|
.clearValue('*[id="search_include"]').pause(2000) |
|
|
|
|
|
|
|
.setValue('*[id="search_include"]', '**').pause(2000) |
|
|
|
|
|
|
|
.elements('css selector','.search_plugin_search_line', (res) => { |
|
|
|
|
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 28) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.setValue('*[id="search_exclude"]', ',contracts/**').pause(2000) |
|
|
|
|
|
|
|
.elements('css selector','.search_plugin_search_line', (res) => { |
|
|
|
|
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 24) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'should clear search': function (browser: NightwatchBrowser) { |
|
|
|
'should clear search': function (browser: NightwatchBrowser) { |
|
|
|
browser |
|
|
|
browser |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.waitForElementVisible('*[id="search_input"]') |
|
|
|
.setValue('*[id="search_input"]', 'nodata').pause(1000) |
|
|
|
.setValue('*[id="search_input"]', 'nodata').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
.elements('css selector', '.search_plugin_search_line', (res) => { |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 0) |
|
|
|
Array.isArray(res.value) && browser.assert.equal(res.value.length, 0) |
|
|
|
}) |
|
|
|
}) |
|
|
|