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.
60 lines
2.1 KiB
60 lines
2.1 KiB
5 years ago
|
'use strict'
|
||
|
var init = require('../helpers/init')
|
||
|
var sauce = require('./sauce')
|
||
|
|
||
|
module.exports = {
|
||
|
before: function (browser, done) {
|
||
|
init(browser, done)
|
||
|
},
|
||
|
'@sources': function () {
|
||
|
return []
|
||
|
},
|
||
|
'Publish on IPFS': function (browser) {
|
||
|
browser
|
||
|
.waitForElementVisible('#icon-panel', 10000)
|
||
|
.clickLaunchIcon('fileExplorers')
|
||
5 years ago
|
.openFile('browser/3_Ballot.sol')
|
||
5 years ago
|
.verifyContracts(['Ballot'])
|
||
|
.click('#publishOnIpfs')
|
||
|
.getModalBody((value, done) => {
|
||
5 years ago
|
if (value.indexOf('Metadata of "ballot" was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '')
|
||
5 years ago
|
if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '')
|
||
|
done()
|
||
|
})
|
||
|
.modalFooterOKClick()
|
||
|
},
|
||
5 years ago
|
'Publish on Swarm': '' + function (browser) {
|
||
5 years ago
|
browser
|
||
|
.click('#publishOnSwarm')
|
||
|
.getModalBody((value, done) => {
|
||
5 years ago
|
if (value.indexOf('Metadata of "ballot" was successfully.') === -1) browser.assert.fail('swarm deploy failed', '', '')
|
||
5 years ago
|
if (value.indexOf('bzz') === -1) browser.assert.fail('swarm deploy failed', '', '')
|
||
|
done()
|
||
|
})
|
||
5 years ago
|
.modalFooterOKClick()
|
||
|
},
|
||
|
'Should publish contract metadata to ipfs on deploy': function (browser) {
|
||
|
browser
|
||
|
.waitForElementVisible('#icon-panel')
|
||
|
.clickLaunchIcon('fileExplorers')
|
||
5 years ago
|
.openFile('browser/1_Storage.sol')
|
||
5 years ago
|
.clickLaunchIcon('udapp')
|
||
|
.waitForElementVisible('*[data-id="contractDropdownIpfsCheckbox"]')
|
||
|
.click('*[data-id="contractDropdownIpfsCheckbox"]')
|
||
|
.click('*[data-id="Deploy - transact (not payable)"]')
|
||
|
.pause(5000)
|
||
|
.assert.containsText('*[data-id="modalDialogModalBody"]', 'Metadata of "storage" was published successfully.')
|
||
|
.modalFooterOKClick()
|
||
|
},
|
||
|
'Should remember choice after page refresh': function (browser) {
|
||
|
browser
|
||
|
.refresh()
|
||
5 years ago
|
.openFile('browser/1_Storage.sol')
|
||
5 years ago
|
.clickLaunchIcon('udapp')
|
||
|
.waitForElementVisible('*[data-id="contractDropdownIpfsCheckbox"]')
|
||
|
.verify.elementPresent('*[data-id="contractDropdownIpfsCheckbox"]:checked')
|
||
5 years ago
|
.end()
|
||
|
},
|
||
|
tearDown: sauce
|
||
|
}
|