rename path

pull/5370/head
filip mertens 11 months ago
parent af6f6d2e4e
commit e705a6d430
  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 () {
browser
.click('#menuitemrename')
.perform((client, doneSetValue) => {
browser.execute(function (path, addvalue) {
document.querySelector('[data-path="' + path + '"]').innerHTML = addvalue
}, [path, newFileName], () => {
doneSetValue()
})
})
.pause(1000)
.click('div[data-id="remixIdeMainPanel"]') // focus out to save
.pause(2000)
.sendKeys('[data-input-path="' + path + '"]', newFileName)
.sendKeys('[data-input-path="' + path + '"]', browser.Keys.ENTER)
.waitForElementNotPresent('[data-path="' + path + '"]')
.waitForElementPresent('[data-path="' + renamedPath + '"]')
.perform(() => {

@ -32,7 +32,7 @@ module.exports = {
browser
.waitForElementVisible('*[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"]')
},

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

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

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

Loading…
Cancel
Save