update tests

pull/2092/head
filip mertens 3 years ago
parent b9b5d4c6d1
commit 513e670fd0
  1. 16
      apps/remix-ide-e2e/src/tests/search.test.ts
  2. 2
      libs/remix-ui/search/src/lib/components/OverWriteCheck.tsx
  3. 2
      libs/remix-ui/search/src/lib/components/results/ResultSummary.tsx

@ -72,12 +72,28 @@ module.exports = {
.moveToElement('*[data-id="contracts/2_Owner.sol-30-71"]', 10, 10)
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-30-71"]')
.click('*[data-id="replace-contracts/2_Owner.sol-30-71"]').pause(2000).
modalFooterOKClick('confirmreplace').pause(2000).
getEditorValue((content) => {
browser.assert.ok(content.includes('replacing deployer for a constructor'), 'should replace text ok')
})
},
'Should replace text without confirmation': function (browser: NightwatchBrowser) {
browser.click('*[data-id="confirm_replace_label"]').pause(500)
.clearValue('*[id="search_input"]')
.setValue('*[id="search_input"]', 'replacing').pause(1000)
.setValue('*[id="search_replace"]', '2').pause(1000)
.waitForElementVisible('*[data-id="contracts/2_Owner.sol-30-71"]')
.moveToElement('*[data-id="contracts/2_Owner.sol-30-71"]', 10, 10)
.waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-30-71"]')
.click('*[data-id="replace-contracts/2_Owner.sol-30-71"]').pause(2000).
getEditorValue((content) => {
browser.assert.ok(content.includes('replacing2 deployer for a constructor'), 'should replace text ok')
})
},
'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_line', (res) => {
Array.isArray(res.value) && browser.assert.equal(res.value.length, 4)

@ -21,7 +21,7 @@ export const OverWriteCheck = props => {
/>
<label
htmlFor='confirm_replace'
data-id="compilerNightliesBuild"
data-id="confirm_replace_label"
className="form-check-label custom-control-label"
>
replace without confirmation

@ -29,7 +29,7 @@ export const ResultSummary = (props: ResultSummaryProps) => {
if(state.replaceWithOutConfirmation){
confirmReplace(line)
}else{
modal({ id: 'matomoModal', title: 'Replace', message: `Are you sure you want to replace '${line.center}' by '${state.replace}' in ${props.searchResult.filename}?`, okLabel: 'Yes', okFn: confirmReplace, cancelLabel: 'No', cancelFn: ()=>{}, data: line })
modal({ id: 'confirmreplace', title: 'Replace', message: `Are you sure you want to replace '${line.center}' by '${state.replace}' in ${props.searchResult.filename}?`, okLabel: 'Yes', okFn: confirmReplace, cancelLabel: 'No', cancelFn: ()=>{}, data: line })
}
}

Loading…
Cancel
Save