format tests. update test to use snekmate

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

@ -27,28 +27,29 @@ module.exports = {
.frameParent() .frameParent()
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementVisible({ .waitForElementVisible({
selector: "//*[@data-id='workspacesSelect' and contains(.,'vyper-lang')]", selector: "//*[@data-id='workspacesSelect' and contains(.,'snekmate')]",
locateStrategy: 'xpath', locateStrategy: 'xpath',
timeout: 60000 timeout: 60000
}) })
.currentWorkspaceIs('vyper-lang') .currentWorkspaceIs('snekmate')
.waitForElementVisible({ .waitForElementVisible({
selector: "//*[@data-id='treeViewLitreeViewItemexamples' and contains(.,'examples')]", selector: "//*[@data-id='treeViewLitreeViewItemexamples' and contains(.,'examples')]",
locateStrategy: 'xpath', locateStrategy: 'xpath',
timeout: 60000 timeout: 60000
}) })
.openFile('examples') .openFile('src')
.openFile('examples/auctions') .openFile('src/tokens')
.openFile('examples/auctions/blind_auction.vy') .openFile('src/tokens/ERC721.vy')
}, },
// 'Add vyper file to run tests #group1': function (browser: NightwatchBrowser) { // 'Add vyper file to run tests #group1': function (browser: NightwatchBrowser) {
// browser.addFile('TestBallot.sol', sources[0]['TestBallot.sol']) // browser.addFile('TestBallot.sol', sources[0]['TestBallot.sol'])
// }, // },
'@sources': () => sources,
'Context menu click to compile blind_auction should succeed #group1': function (browser: NightwatchBrowser) { 'Context menu click to compile blind_auction should succeed #group1': function (browser: NightwatchBrowser) {
browser browser
.click('*[data-id="treeViewLitreeViewItemexamples/auctions/blind_auction.vy"]') .addFile('blind_auction.vy', sources[0]['blindAuction'])
.rightClick('*[data-id="treeViewLitreeViewItemexamples/auctions/blind_auction.vy"]') .click('*[data-id="treeViewLitreeViewItemblind_auction.vy"]')
.rightClick('*[data-id="treeViewLitreeViewItemblind_auction.vy"]')
.waitForElementPresent('[data-id="contextMenuItemvyper"]') .waitForElementPresent('[data-id="contextMenuItemvyper"]')
.click('[data-id="contextMenuItemvyper"]') .click('[data-id="contextMenuItemvyper"]')
.clickLaunchIcon('vyper') .clickLaunchIcon('vyper')
@ -180,8 +181,9 @@ def _createPokemon(_name: String[32], _dna: uint256, _HP: uint256):
wins: 0 wins: 0
}) })
self.totalPokemonCount += 1` 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) # 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 #pragma version ^0.3.10
@ -358,4 +360,6 @@ def auctionEnd():
# Transfer funds to beneficiary # Transfer funds to beneficiary
send(self.beneficiary, self.highestBid) send(self.beneficiary, self.highestBid)
` `}
}
]

@ -80,20 +80,20 @@ export class RemixClient extends PluginClient {
async cloneVyperRepo() { async cloneVyperRepo() {
try { try {
// @ts-ignore // @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('manager', 'activatePlugin', 'dGitProvider')
await this.call( await this.call(
'dGitProvider', 'dGitProvider',
'clone', '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 // @ts-ignore
'vyper-lang' 'snekmate'
) )
this.call( this.call(
// @ts-ignore // @ts-ignore
'notification', 'notification',
'toast', 'toast',
'Vyper repository cloned, the workspace Vyper has been created.' 'Snekmate Vyper repository cloned, the workspace snekmate has been created.'
) )
} catch (e) { } catch (e) {
// @ts-ignore // @ts-ignore

Loading…
Cancel
Save