|
|
@ -16,11 +16,17 @@ class OpenFile extends EventEmitter { |
|
|
|
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
|
|
|
|
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
|
|
|
|
function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) { |
|
|
|
function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) { |
|
|
|
browser.perform((done) => { |
|
|
|
browser.perform((done) => { |
|
|
|
|
|
|
|
browser.isVisible('[data-id="remixIdeSidePanel"]', (result) => { |
|
|
|
|
|
|
|
console.log(result) |
|
|
|
|
|
|
|
if (result.value) { |
|
|
|
|
|
|
|
// if side panel is shown, check this is the file panel
|
|
|
|
browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { |
|
|
|
browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { |
|
|
|
console.log(result) |
|
|
|
console.log(result) |
|
|
|
if (result.status === 0) { |
|
|
|
if (result.status === 0) { |
|
|
|
browser.clickLaunchIcon('filePanel').perform(done) |
|
|
|
done() |
|
|
|
} else done() |
|
|
|
} else browser.clickLaunchIcon('filePanel').perform(done) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else browser.clickLaunchIcon('filePanel').perform(done) |
|
|
|
})
|
|
|
|
})
|
|
|
|
}) |
|
|
|
}) |
|
|
|
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) |
|
|
|
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) |
|
|
|