Skip to content

Commit

Permalink
Merge pull request #2762 from ethereum/local-fileexplorer-e2e
Browse files Browse the repository at this point in the history
E2E Tests: Upload Local File to File Explorer
  • Loading branch information
yann300 authored Apr 22, 2020
2 parents 1e03b6d + d36b797 commit 65a30f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/files/file-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ fileExplorer.prototype.renderMenuItems = function () {
class="${icon} ${css.newFile}"
title="${title}"
>
<input type="file" onchange=${(event) => {
<input id="fileUpload" data-id="fileExplorerFileUpload" type="file" onchange=${(event) => {
event.stopPropagation()
this.uploadFile(event)
}} multiple />
Expand Down
17 changes: 17 additions & 0 deletions test-browser/tests/fileExplorer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
'use strict'
const init = require('../helpers/init')
const sauce = require('./sauce')
const path = require('path')
const testData = {
testFile1: path.resolve(__dirname + '/editor.js'), // eslint-disable-line
testFile2: path.resolve(__dirname + '/fileExplorer.js'), // eslint-disable-line
testFile3: path.resolve(__dirname + '/generalSettings.js') // eslint-disable-line
}

module.exports = {

Expand Down Expand Up @@ -88,9 +94,20 @@ module.exports = {
if (runtimeBrowser === 'chrome') {
browser.switchBrowserTab(1)
.assert.urlContains('https://gist.github.com')
.switchBrowserTab(0)
}
done()
})
},

'Should open local filesystem explorer': function (browser) {
browser.waitForElementVisible('*[data-id="filePanelFileExplorerTree"]')
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2)
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3)
.waitForElementVisible('*[key="browser/editor.js"]')
.waitForElementVisible('*[key="browser/fileExplorer.js"]')
.waitForElementVisible('*[key="browser/generalSettings.js"]')
.end()
},

Expand Down

0 comments on commit 65a30f3

Please sign in to comment.