Skip to content

Commit

Permalink
add browser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Jan 6, 2020
1 parent 62a43de commit 0a876d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global localStorage */
'use strict'

var isElectron = require('is-electron')
Expand Down
16 changes: 9 additions & 7 deletions test-browser/helpers/init.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module.exports = function (browser, callback) {
module.exports = function (browser, callback, url, preloadPlugins = true) {
browser
.url('http://127.0.0.1:8080')
.url(url || 'http://127.0.0.1:8080')
.injectScript('test-browser/helpers/applytestmode.js', function () {
browser.resizeWindow(2560, 1440, () => {
initModules(browser, () => {
browser.clickLaunchIcon('solidity').click('#autoCompile')
.perform(function () {
callback()
if (preloadPlugins) {
initModules(browser, () => {
browser.clickLaunchIcon('solidity').click('#autoCompile')
.perform(function () {
callback()
})
})
})
} else callback()
})
})
}
Expand Down
17 changes: 17 additions & 0 deletions test-browser/tests/workspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'
var init = require('../helpers/init')
var sauce = require('./sauce')

module.exports = {
before: function (browser, done) {
init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false)
},
'CheckSolidityActivatedAndUDapp': function (browser) {
browser
.waitForElementVisible('#icon-panel', 10000)
.clickLaunchIcon('solidity')
.clickLaunchIcon('udapp')
.end()
},
tearDown: sauce
}

0 comments on commit 0a876d5

Please sign in to comment.