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.
116 lines
4.7 KiB
116 lines
4.7 KiB
5 years ago
|
'use strict'
|
||
|
const init = require('../helpers/init')
|
||
|
const sauce = require('./sauce')
|
||
5 years ago
|
const path = require('path')
|
||
|
const testData = {
|
||
5 years ago
|
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
|
||
5 years ago
|
}
|
||
5 years ago
|
|
||
|
module.exports = {
|
||
|
|
||
|
before: function (browser, done) {
|
||
5 years ago
|
init(browser, done)
|
||
5 years ago
|
},
|
||
|
|
||
|
'Should create a new file `5_New_contract.sol` in file explorer': function (browser) {
|
||
|
browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]')
|
||
5 years ago
|
.clickLaunchIcon('fileExplorers')
|
||
5 years ago
|
.assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORERS')
|
||
|
.click('*[data-id="fileExplorerNewFilecreateNewFile"]')
|
||
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.setValue('*[data-id="modalDialogCustomPromptText"]', '5_New_contract.sol')
|
||
|
.modalFooterOKClick()
|
||
|
.pause(2000)
|
||
|
.waitForElementVisible('*[data-id="treeViewLibrowser/5_New_contract.sol"]')
|
||
|
},
|
||
|
|
||
5 years ago
|
'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser) {
|
||
5 years ago
|
browser
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/5_New_contract.sol"]')
|
||
5 years ago
|
.rightClick('[data-path="browser/5_New_contract.sol"]')
|
||
5 years ago
|
.click('*[id="menuitemrename"]')
|
||
5 years ago
|
.sendKeys('[data-path="browser/5_New_contract.sol"]', '5_Renamed_Contract.sol')
|
||
|
.sendKeys('[data-path="browser/5_New_contract.sol"]', browser.Keys.ENTER)
|
||
|
.keys()
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/5_Renamed_Contract.sol"]')
|
||
|
},
|
||
|
|
||
|
'Should delete file `5_Renamed_Contract.sol` from file explorer': function (browser) {
|
||
|
browser
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/5_Renamed_Contract.sol"]')
|
||
|
.rightClick('[data-path="browser/5_Renamed_Contract.sol"]')
|
||
5 years ago
|
.click('*[id="menuitemdelete"]')
|
||
5 years ago
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.modalFooterOKClick()
|
||
5 years ago
|
.waitForElementNotPresent('*[data-id="treeViewLibrowser/5_Renamed_Contract.sol"')
|
||
5 years ago
|
},
|
||
|
|
||
|
'Should create a new folder': function (browser) {
|
||
|
browser
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/1_Storage.sol"]')
|
||
5 years ago
|
.rightClick('[data-path="browser/1_Storage.sol"]')
|
||
5 years ago
|
.click('*[id="menuitemcreate folder"]')
|
||
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.setValue('*[data-id="modalDialogCustomPromptText"]', 'Browser_Tests')
|
||
|
.modalFooterOKClick()
|
||
|
.waitForElementVisible('*[data-id="treeViewLibrowser/Browser_Tests"]')
|
||
|
},
|
||
|
|
||
5 years ago
|
'Should rename Browser_Tests folder to Browser_E2E_Tests': function (browser) {
|
||
|
browser
|
||
|
.waitForElementVisible('*[data-id="treeViewLibrowser/Browser_Tests"]')
|
||
5 years ago
|
.rightClick('[data-path="browser/Browser_Tests"]')
|
||
5 years ago
|
.click('*[id="menuitemrename"]')
|
||
5 years ago
|
.sendKeys('[data-path="browser/Browser_Tests"]', 'Browser_E2E_Tests')
|
||
|
.sendKeys('[data-path="browser/Browser_Tests"]', browser.Keys.ENTER)
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/Browser_E2E_Tests"]')
|
||
|
},
|
||
|
|
||
5 years ago
|
'Should delete Browser_E2E_Tests folder': function (browser) {
|
||
5 years ago
|
browser
|
||
5 years ago
|
.waitForElementVisible('*[data-id="treeViewLibrowser/Browser_E2E_Tests"]')
|
||
5 years ago
|
.rightClick('[data-path="browser/Browser_E2E_Tests"]')
|
||
5 years ago
|
.click('*[id="menuitemdelete"]')
|
||
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.modalFooterOKClick()
|
||
5 years ago
|
.waitForElementNotPresent('*[data-id="treeViewLibrowser/Browser_E2E_Tests"]')
|
||
5 years ago
|
},
|
||
|
|
||
|
'Should publish all explorer files to github gist': function (browser) {
|
||
5 years ago
|
const runtimeBrowser = browser.capabilities.browserName
|
||
|
|
||
5 years ago
|
browser
|
||
|
.waitForElementVisible('*[data-id="fileExplorerNewFilepublishToGist"]')
|
||
|
.click('*[data-id="fileExplorerNewFilepublishToGist"]')
|
||
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.modalFooterOKClick()
|
||
|
.pause(10000)
|
||
|
.waitForElementVisible('*[data-id="modalDialogContainer"]')
|
||
|
.modalFooterOKClick()
|
||
|
.pause(2000)
|
||
5 years ago
|
.perform((done) => {
|
||
|
if (runtimeBrowser === 'chrome') {
|
||
5 years ago
|
browser.switchBrowserTab(1)
|
||
5 years ago
|
.assert.urlContains('https://gist.github.com')
|
||
5 years ago
|
.switchBrowserTab(0)
|
||
5 years ago
|
}
|
||
|
done()
|
||
|
})
|
||
5 years ago
|
},
|
||
|
|
||
|
'Should open local filesystem explorer': function (browser) {
|
||
|
browser.waitForElementVisible('*[data-id="filePanelFileExplorerTree"]')
|
||
5 years ago
|
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1)
|
||
|
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2)
|
||
|
.setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3)
|
||
5 years ago
|
.waitForElementVisible('*[key="browser/editor.js"]')
|
||
|
.waitForElementVisible('*[key="browser/fileExplorer.js"]')
|
||
|
.waitForElementVisible('*[key="browser/generalSettings.js"]')
|
||
5 years ago
|
.end()
|
||
|
},
|
||
|
|
||
|
tearDown: sauce
|
||
|
}
|