|
|
@ -17,6 +17,7 @@ const { |
|
|
|
loadExtension, |
|
|
|
loadExtension, |
|
|
|
verboseReportOnFailure, |
|
|
|
verboseReportOnFailure, |
|
|
|
testContract, |
|
|
|
testContract, |
|
|
|
|
|
|
|
openNewPage, |
|
|
|
} = require('./helpers') |
|
|
|
} = require('./helpers') |
|
|
|
|
|
|
|
|
|
|
|
describe('MetaMask', function () { |
|
|
|
describe('MetaMask', function () { |
|
|
@ -385,11 +386,13 @@ describe('MetaMask', function () { |
|
|
|
|
|
|
|
|
|
|
|
describe('Send ETH from Faucet', () => { |
|
|
|
describe('Send ETH from Faucet', () => { |
|
|
|
it('starts a send transaction inside Faucet', async () => { |
|
|
|
it('starts a send transaction inside Faucet', async () => { |
|
|
|
await driver.executeScript('window.open("https://faucet.metamask.io")') |
|
|
|
await openNewPage(driver, 'https://faucet.metamask.io') |
|
|
|
await delay(waitingNewPageDelayMs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [extension, faucet] = await driver.getAllWindowHandles() |
|
|
|
const [extension, faucet] = await driver.getAllWindowHandles() |
|
|
|
await driver.switchTo().window(faucet) |
|
|
|
await driver.switchTo().window(faucet) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const faucetPageTitle = await findElement(driver, By.css('.container-fluid')) |
|
|
|
|
|
|
|
await driver.wait(until.elementTextMatches(faucetPageTitle, /MetaMask/)) |
|
|
|
await delay(regularDelayMs) |
|
|
|
await delay(regularDelayMs) |
|
|
|
|
|
|
|
|
|
|
|
const send1eth = await findElement(driver, By.xpath(`//button[contains(text(), '10 ether')]`), 14000) |
|
|
|
const send1eth = await findElement(driver, By.xpath(`//button[contains(text(), '10 ether')]`), 14000) |
|
|
@ -417,11 +420,10 @@ describe('MetaMask', function () { |
|
|
|
|
|
|
|
|
|
|
|
describe('Deploy contract and call contract method from Remix', () => { |
|
|
|
describe('Deploy contract and call contract method from Remix', () => { |
|
|
|
it('writes a contract to remix', async () => { |
|
|
|
it('writes a contract to remix', async () => { |
|
|
|
await driver.executeScript('window.open("https://remix.ethereum.org/")') |
|
|
|
await openNewPage(driver, 'https://remix.ethereum.org/') |
|
|
|
await delay(waitingNewPageDelayMs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [extension, remix] = await driver.getAllWindowHandles() |
|
|
|
const byFilePanel = By.css('#filepanel') |
|
|
|
await driver.switchTo().window(remix) |
|
|
|
await driver.wait(until.elementLocated(byFilePanel)) |
|
|
|
|
|
|
|
|
|
|
|
const newContractButton = await findElement(driver, By.css('.fa-plus-circle')) |
|
|
|
const newContractButton = await findElement(driver, By.css('.fa-plus-circle')) |
|
|
|
await newContractButton.click() |
|
|
|
await newContractButton.click() |
|
|
@ -521,11 +523,9 @@ describe('MetaMask', function () { |
|
|
|
|
|
|
|
|
|
|
|
describe('Add a custom token from TokenFactory', () => { |
|
|
|
describe('Add a custom token from TokenFactory', () => { |
|
|
|
it('creates a new token', async () => { |
|
|
|
it('creates a new token', async () => { |
|
|
|
await driver.executeScript('window.open("https://tokenfactory.surge.sh/#/factory")') |
|
|
|
openNewPage(driver, 'https://tokenfactory.surge.sh/#/factory') |
|
|
|
await delay(waitingNewPageDelayMs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [extension, tokenFactory] = await driver.getAllWindowHandles() |
|
|
|
const [extension, tokenFactory] = await driver.getAllWindowHandles() |
|
|
|
await driver.switchTo().window(tokenFactory) |
|
|
|
|
|
|
|
const [ |
|
|
|
const [ |
|
|
|
totalSupply, |
|
|
|
totalSupply, |
|
|
|
tokenName, |
|
|
|
tokenName, |
|
|
@ -651,11 +651,10 @@ describe('MetaMask', function () { |
|
|
|
describe('Send a custom token from TokenFactory', () => { |
|
|
|
describe('Send a custom token from TokenFactory', () => { |
|
|
|
let gasModal |
|
|
|
let gasModal |
|
|
|
it('sends an already created token', async () => { |
|
|
|
it('sends an already created token', async () => { |
|
|
|
await driver.executeScript(`window.open("https://tokenfactory.surge.sh/#/token/${tokenAddress}")`) |
|
|
|
openNewPage(driver, `https://tokenfactory.surge.sh/#/token/${tokenAddress}`) |
|
|
|
await delay(waitingNewPageDelayMs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [extension, tokenFactory] = await driver.getAllWindowHandles() |
|
|
|
const [extension, tokenFactory] = await driver.getAllWindowHandles() |
|
|
|
await driver.switchTo().window(tokenFactory) |
|
|
|
|
|
|
|
const [ |
|
|
|
const [ |
|
|
|
transferToAddress, |
|
|
|
transferToAddress, |
|
|
|
transferToAmount, |
|
|
|
transferToAmount, |
|
|
|