rename path

flattentree
filip mertens 11 months ago
parent 6851d25644
commit d3d3a6e5b4
  1. 12
      apps/remix-ide-e2e/src/commands/renamePath.ts
  2. 2
      apps/remix-ide-e2e/src/tests/fileExplorer.test.ts
  3. 2
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  4. 2
      apps/remix-ide-e2e/src/tests/workspace_git.test.ts
  5. 1
      libs/remix-ui/workspace/src/lib/components/flat-tree-item-input.tsx

@ -34,16 +34,8 @@ function renamePath (browser: NightwatchBrowser, path: string, newFileName: stri
}, [path], function () { }, [path], function () {
browser browser
.click('#menuitemrename') .click('#menuitemrename')
.perform((client, doneSetValue) => { .sendKeys('[data-input-path="' + path + '"]', newFileName)
browser.execute(function (path, addvalue) { .sendKeys('[data-input-path="' + path + '"]', browser.Keys.ENTER)
document.querySelector('[data-path="' + path + '"]').innerHTML = addvalue
}, [path, newFileName], () => {
doneSetValue()
})
})
.pause(1000)
.click('div[data-id="remixIdeMainPanel"]') // focus out to save
.pause(2000)
.waitForElementNotPresent('[data-path="' + path + '"]') .waitForElementNotPresent('[data-path="' + path + '"]')
.waitForElementPresent('[data-path="' + renamedPath + '"]') .waitForElementPresent('[data-path="' + renamedPath + '"]')
.perform(() => { .perform(() => {

@ -32,7 +32,7 @@ module.exports = {
browser browser
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]')
.click('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') .click('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]')
.renamePath('5_New_contract.sol', '5_Renamed_Contract.sol', '5_Renamed_Contract.sol') .renamePath('5_New_contract.sol', '5_Renamed_Contract', '5_Renamed_Contract.sol')
.waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]')
}, },

@ -277,7 +277,7 @@ function runTests(browser: NightwatchBrowser, done: any) {
.setEditorValue('contract test1 { function get () returns (uint) { return 10; }}') .setEditorValue('contract test1 { function get () returns (uint) { return 10; }}')
.click('[data-path="folder1/contract_' + browserName + '.sol"]') // rename a file and check .click('[data-path="folder1/contract_' + browserName + '.sol"]') // rename a file and check
.pause(1000) .pause(1000)
.renamePath('folder1/contract_' + browserName + '.sol', 'renamed_contract_' + browserName + '.sol', 'folder1/renamed_contract_' + browserName + '.sol') .renamePath('folder1/contract_' + browserName + '.sol', 'renamed_contract_' + browserName, 'folder1/renamed_contract_' + browserName + '.sol')
.pause(1000) .pause(1000)
.removeFile('folder1/contract_' + browserName + '_toremove.sol', 'localhost') .removeFile('folder1/contract_' + browserName + '_toremove.sol', 'localhost')
.perform(function (done) { .perform(function (done) {

@ -226,7 +226,7 @@ module.exports = {
'Should prevent checkout to a branch if local changes exists #group3': function (browser: NightwatchBrowser) { 'Should prevent checkout to a branch if local changes exists #group3': function (browser: NightwatchBrowser) {
browser browser
.renamePath('README.md', 'README.txt', 'README.txt') .renamePath('README.md', 'README_2.md', 'README_2.md')
.waitForElementVisible('[data-id="workspaceGitBranchesDropdown"]') .waitForElementVisible('[data-id="workspaceGitBranchesDropdown"]')
.click('[data-id="workspaceGitBranchesDropdown"]') .click('[data-id="workspaceGitBranchesDropdown"]')
.waitForElementVisible('[data-id="workspaceGit-dev"]') .waitForElementVisible('[data-id="workspaceGit-dev"]')

@ -47,6 +47,7 @@ export const FlatTreeItemInput = (props: FlatTreeItemInputProps) => {
return(<input return(<input
onBlur={handleEditBlur} onBlur={handleEditBlur}
data-id='/blank' data-id='/blank'
data-input-path = {file.path}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}
ref={ref} ref={ref}
style={{ style={{

Loading…
Cancel
Save