Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/remix-ide-e2e/src/commands/createContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function createContract (browser: NightwatchBrowser, inputParams: string, callba
if (inputParams) {
browser.setValue('.udapp_contractActionsContainerSingle > input', inputParams, function () {
browser
.pause(1000) // wait to get the button enabled
.waitForElementVisible('.udapp_contractActionsContainerSingle > div')
.click('.udapp_contractActionsContainerSingle > div').pause(500).perform(function () { callback() })
})
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/commands/verifyLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import EventEmitter from 'events'

class VerifyLoad extends EventEmitter {
command(this: NightwatchBrowser) {
browser.waitForElementPresent({
browser.saveScreenshot('./reports/screenshots/verifyLoad.png').waitForElementPresent({
selector: "//span[@data-id='typesloaded']",
locateStrategy: 'xpath',
timeout: 60000
Expand Down
4 changes: 1 addition & 3 deletions apps/remix-ide-e2e/src/tests/ballot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ module.exports = {
.connectToExternalHttpProvider('http://localhost:8545', 'Custom')
.clickLaunchIcon('solidity')
.clickLaunchIcon('udapp')
.clearValue('input[placeholder="bytes32[] proposalNames"]')
.setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.createContract('["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
.clickInstance(0)
.click('*[data-id="terminalClearConsole"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })
Expand Down
4 changes: 1 addition & 3 deletions apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ module.exports = {
.connectToExternalHttpProvider('http://localhost:8545', 'Custom')
.clickLaunchIcon('solidity')
.clickLaunchIcon('udapp')
.clearValue('input[placeholder="uint8 _numProposals"]')
.setValue('input[placeholder="uint8 _numProposals"]', '2')
.click('*[data-id="Deploy - transact (not payable)"]')
.createContract('2')
.clickInstance(0)
.click('*[data-id="terminalClearConsole"]')
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })
Expand Down
10 changes: 7 additions & 3 deletions apps/remix-ide-e2e/src/tests/dgit_local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,19 @@ module.exports = {
.click('*[data-id="commitButton"]')
},
'push the commit #group1': function (browser: NightwatchBrowser) {
const tag = browser.options.desiredCapabilities?.browserName === 'firefox' ? 'ahead' : ''
browser
.waitForElementVisible('*[data-id="commands-panel"]', 60000)
.click('*[data-id="commands-panel"]')
.waitForElementVisible('*[data-id="sourcecontrol-push"]')
.waitForElementVisible('*[data-id="sourcecontrol-push"]', 60000)
.click('*[data-id="sourcecontrol-push"]')
.pause(2000)
.waitForElementVisible('*[data-id="commits-panel"]', 60000)
.click('*[data-id="commits-panel"]')
.waitForElementPresent({
selector: '//*[@data-id="commit-summary-testcommit2-"]',
locateStrategy: 'xpath'
selector: `//*[@data-id="commit-summary-testcommit2-${tag}"]`,
locateStrategy: 'xpath',
timeout: 60000
}).pause(2000)
},
'check the log for testcommit2 #group1': async function (browser: NightwatchBrowser) {
Expand Down
37 changes: 8 additions & 29 deletions apps/remix-ide-e2e/src/tests/sol2uml.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
.rightClick('*[data-id="treeViewLitreeViewItemsecondContract.sol"]')
.click('*[id="menuitemgeneratecustomaction"')
.waitForElementVisible('*[id="sol-uml-gen"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsecondContract_flattened.sol"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsecondContract_flattened.sol"]', 60000)
},
'Zoom into uml diagram #group1': function (browser: NightwatchBrowser) {
browser
Expand Down Expand Up @@ -177,38 +177,17 @@ contract Ballot {
{
'secondContract.sol': {
content: `
// SPDX-License-Identifier: GPL-3.0
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

pragma solidity ^0.5.9;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";

import "@0x/contracts-erc20/contracts/src/ERC20Token.sol";

/**
* @title SampleERC20
* @dev Create a sample ERC20 standard token
*/
contract SampleERC20 is ERC20Token {

string public name;
string public symbol;
uint256 public decimals;

constructor (
string memory _name,
string memory _symbol,
uint256 _decimals,
uint256 _totalSupply
)
public
{
name = _name;
symbol = _symbol;
decimals = _decimals;
_totalSupply = _totalSupply;
balances[msg.sender] = _totalSupply;
}
contract MyToken is ERC20, ERC20Permit {
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {}
}


`}
}
]
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/tests/vyper_api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare global {
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, 'http://localhost:8080')
init(browser, done)
},

'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) {
Expand Down
25 changes: 20 additions & 5 deletions apps/remix-ide/src/assets/js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ const domains = {
'remix.ethereum.org': 23,
'localhost': 35 // remix desktop
}
const domainsOnPrem = {
'remix-alpha.ethereum.org': 1
}

let domainToTrack = domains[window.location.hostname]
let domainOnPremToTrack = domainsOnPrem[window.location.hostname]


function trackDomain(domainToTrack) {
var _paq = window._paq = window._paq || []
function trackDomain(domainToTrack, u, paqName) {
var _paq = window[paqName] = window[paqName] || []

/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setExcludedQueryParams", ["code", "gist"]]);
Expand All @@ -22,11 +26,10 @@ function trackDomain(domainToTrack) {
_paq.push(['requireCookieConsent']);
_paq.push(['trackEvent', 'loader', 'load']);
(function () {
var u = "https://ethereumfoundation.matomo.cloud/";
_paq.push(['setTrackerUrl', u + 'matomo.php?debug=1']);
_paq.push(['setSiteId', domainToTrack]);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true; g.src = 'https://cdn.matomo.cloud/ethereumfoundation.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g, s);
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
})();
}

Expand All @@ -51,7 +54,19 @@ if (window.electronAPI) {
})
} else {
if (domainToTrack) {
trackDomain(domainToTrack)
trackDomain(domainToTrack, 'https://ethereumfoundation.matomo.cloud/', '_paq')
// Override push method
window._paq.push = function (...args) {
// Push to the original _paq
const result = originalPush.apply(this, args)

// Also replicate to other trackers
if (window._paq2) window._paq2.push(...args)
return result;
}
}
if (domainOnPremToTrack) {
trackDomain(domainOnPremToTrack, 'http://178.156.150.253/matomo/', '_paq2')
}
}
function isElectron() {
Expand Down