remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide/test-browser/helpers/init.js

38 lines
1.4 KiB

require('dotenv').config()
module.exports = function (browser, callback, url, preloadPlugins = true) {
browser
.url(url || 'http://127.0.0.1:4200')
.pause(5000)
.switchBrowserTab(0)
.injectScript('test-browser/helpers/applytestmode.js', function () {
browser.fullscreenWindow(() => {
if (preloadPlugins) {
initModules(browser, () => {
browser.clickLaunchIcon('solidity')
.pause(2000)
.execute(() => {
document.getElementById('autoCompile').click()
})
7 years ago
})
}
})
4 years ago
})
.perform(() => {
callback()
})
}
function initModules (browser, callback) {
browser.pause(5000)
.click('[data-id="verticalIconsKindpluginManager"]')
.scrollAndClick('[data-id="pluginManagerComponentActivateButtonsolidityStaticAnalysis"]')
.scrollAndClick('[data-id="pluginManagerComponentActivateButtondebugger"]')
.scrollAndClick('[data-id="verticalIconsKindfileExplorers"]')
.clickLaunchIcon('settings')
.setValue('[data-id="settingsTabGistAccessToken"]', process.env.gist_token)
.click('[data-id="settingsTabSaveGistToken"]')
.click('[data-id="settingsTabThemeFlatly"]') // e2e tests were initially developed with Flatly. Some tests are failing with the default one (Dark), because the dark theme put uppercase everywhere.
.perform(() => { callback() })
}