format tests. update test to use snekmate

pull/4747/head
Joseph Izang 7 months ago
parent 910418783e
commit a2660c4a88
  1. 12
      apps/remix-ide-e2e/src/commands/openFile.ts
  2. 24
      apps/remix-ide-e2e/src/tests/vyper_api.test.ts
  3. 8
      apps/vyper/src/app/utils/remix-client.tsx

@ -34,12 +34,12 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction)
})
})
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000)
.click('li[data-id="treeViewLitreeViewItem' + name + '"')
.pause(2000)
.perform(() => {
done()
})
.waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000)
.click('li[data-id="treeViewLitreeViewItem' + name + '"')
.pause(2000)
.perform(() => {
done()
})
}
module.exports = OpenFile

@ -27,28 +27,29 @@ module.exports = {
.frameParent()
.clickLaunchIcon('filePanel')
.waitForElementVisible({
selector: "//*[@data-id='workspacesSelect' and contains(.,'vyper-lang')]",
selector: "//*[@data-id='workspacesSelect' and contains(.,'snekmate')]",
locateStrategy: 'xpath',
timeout: 60000
})
.currentWorkspaceIs('vyper-lang')
.currentWorkspaceIs('snekmate')
.waitForElementVisible({
selector: "//*[@data-id='treeViewLitreeViewItemexamples' and contains(.,'examples')]",
locateStrategy: 'xpath',
timeout: 60000
})
.openFile('examples')
.openFile('examples/auctions')
.openFile('examples/auctions/blind_auction.vy')
.openFile('src')
.openFile('src/tokens')
.openFile('src/tokens/ERC721.vy')
},
// 'Add vyper file to run tests #group1': function (browser: NightwatchBrowser) {
// browser.addFile('TestBallot.sol', sources[0]['TestBallot.sol'])
// },
'@sources': () => sources,
'Context menu click to compile blind_auction should succeed #group1': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="treeViewLitreeViewItemexamples/auctions/blind_auction.vy"]')
.rightClick('*[data-id="treeViewLitreeViewItemexamples/auctions/blind_auction.vy"]')
.addFile('blind_auction.vy', sources[0]['blindAuction'])
.click('*[data-id="treeViewLitreeViewItemblind_auction.vy"]')
.rightClick('*[data-id="treeViewLitreeViewItemblind_auction.vy"]')
.waitForElementPresent('[data-id="contextMenuItemvyper"]')
.click('[data-id="contextMenuItemvyper"]')
.clickLaunchIcon('vyper')
@ -180,8 +181,9 @@ def _createPokemon(_name: String[32], _dna: uint256, _HP: uint256):
wins: 0
})
self.totalPokemonCount += 1`
const sources = [{
const blindAuction = `
'blindAuction' : { content: `
# Blind Auction. Adapted to Vyper from [Solidity by Example](https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst#blind-auction-1)
#pragma version ^0.3.10
@ -358,4 +360,6 @@ def auctionEnd():
# Transfer funds to beneficiary
send(self.beneficiary, self.highestBid)
`
`}
}
]

@ -80,20 +80,20 @@ export class RemixClient extends PluginClient {
async cloneVyperRepo() {
try {
// @ts-ignore
this.call('notification', 'toast', 'cloning Vyper repository...')
this.call('notification', 'toast', 'cloning Snekmate Vyper repository...')
await this.call('manager', 'activatePlugin', 'dGitProvider')
await this.call(
'dGitProvider',
'clone',
{url: 'https://github.com/vyperlang/vyper', token: null, branch: 'v0.3.10'},
{url: 'https://github.com/pcaversaccio/snekmate', token: null, branch: 'v0.0.5'},
// @ts-ignore
'vyper-lang'
'snekmate'
)
this.call(
// @ts-ignore
'notification',
'toast',
'Vyper repository cloned, the workspace Vyper has been created.'
'Snekmate Vyper repository cloned, the workspace snekmate has been created.'
)
} catch (e) {
// @ts-ignore

Loading…
Cancel
Save