Skip to content

Commit 51d9f0d

Browse files
authored
Merge pull request #6189 from ethereum/on_prem_matomo
use onprem matomo
2 parents 40d9bf1 + 78af0c2 commit 51d9f0d

File tree

8 files changed

+40
-45
lines changed

8 files changed

+40
-45
lines changed

apps/remix-ide-e2e/src/commands/createContract.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function createContract (browser: NightwatchBrowser, inputParams: string, callba
1717
if (inputParams) {
1818
browser.setValue('.udapp_contractActionsContainerSingle > input', inputParams, function () {
1919
browser
20+
.pause(1000) // wait to get the button enabled
2021
.waitForElementVisible('.udapp_contractActionsContainerSingle > div')
2122
.click('.udapp_contractActionsContainerSingle > div').pause(500).perform(function () { callback() })
2223
})

apps/remix-ide-e2e/src/commands/verifyLoad.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import EventEmitter from 'events'
33

44
class VerifyLoad extends EventEmitter {
55
command(this: NightwatchBrowser) {
6-
browser.waitForElementPresent({
6+
browser.saveScreenshot('./reports/screenshots/verifyLoad.png').waitForElementPresent({
77
selector: "//span[@data-id='typesloaded']",
88
locateStrategy: 'xpath',
99
timeout: 60000

apps/remix-ide-e2e/src/tests/ballot.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ module.exports = {
120120
.connectToExternalHttpProvider('http://localhost:8545', 'Custom')
121121
.clickLaunchIcon('solidity')
122122
.clickLaunchIcon('udapp')
123-
.clearValue('input[placeholder="bytes32[] proposalNames"]')
124-
.setValue('input[placeholder="bytes32[] proposalNames"]', '["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
125-
.click('*[data-id="Deploy - transact (not payable)"]')
123+
.createContract('["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]')
126124
.clickInstance(0)
127125
.click('*[data-id="terminalClearConsole"]')
128126
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })

apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ module.exports = {
9494
.connectToExternalHttpProvider('http://localhost:8545', 'Custom')
9595
.clickLaunchIcon('solidity')
9696
.clickLaunchIcon('udapp')
97-
.clearValue('input[placeholder="uint8 _numProposals"]')
98-
.setValue('input[placeholder="uint8 _numProposals"]', '2')
99-
.click('*[data-id="Deploy - transact (not payable)"]')
97+
.createContract('2')
10098
.clickInstance(0)
10199
.click('*[data-id="terminalClearConsole"]')
102100
.clickFunction('delegate - transact (not payable)', { types: 'address to', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' })

apps/remix-ide-e2e/src/tests/dgit_local.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,19 @@ module.exports = {
132132
.click('*[data-id="commitButton"]')
133133
},
134134
'push the commit #group1': function (browser: NightwatchBrowser) {
135+
const tag = browser.options.desiredCapabilities?.browserName === 'firefox' ? 'ahead' : ''
135136
browser
137+
.waitForElementVisible('*[data-id="commands-panel"]', 60000)
136138
.click('*[data-id="commands-panel"]')
137-
.waitForElementVisible('*[data-id="sourcecontrol-push"]')
139+
.waitForElementVisible('*[data-id="sourcecontrol-push"]', 60000)
138140
.click('*[data-id="sourcecontrol-push"]')
139141
.pause(2000)
142+
.waitForElementVisible('*[data-id="commits-panel"]', 60000)
140143
.click('*[data-id="commits-panel"]')
141144
.waitForElementPresent({
142-
selector: '//*[@data-id="commit-summary-testcommit2-"]',
143-
locateStrategy: 'xpath'
145+
selector: `//*[@data-id="commit-summary-testcommit2-${tag}"]`,
146+
locateStrategy: 'xpath',
147+
timeout: 60000
144148
}).pause(2000)
145149
},
146150
'check the log for testcommit2 #group1': async function (browser: NightwatchBrowser) {

apps/remix-ide-e2e/src/tests/sol2uml.test.ts

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
.rightClick('*[data-id="treeViewLitreeViewItemsecondContract.sol"]')
2323
.click('*[id="menuitemgeneratecustomaction"')
2424
.waitForElementVisible('*[id="sol-uml-gen"]')
25-
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsecondContract_flattened.sol"]')
25+
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsecondContract_flattened.sol"]', 60000)
2626
},
2727
'Zoom into uml diagram #group1': function (browser: NightwatchBrowser) {
2828
browser
@@ -177,38 +177,17 @@ contract Ballot {
177177
{
178178
'secondContract.sol': {
179179
content: `
180-
// SPDX-License-Identifier: GPL-3.0
180+
// SPDX-License-Identifier: MIT
181+
pragma solidity ^0.8.20;
181182
182-
pragma solidity ^0.5.9;
183+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
184+
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
183185
184-
import "@0x/contracts-erc20/contracts/src/ERC20Token.sol";
185-
186-
/**
187-
* @title SampleERC20
188-
* @dev Create a sample ERC20 standard token
189-
*/
190-
contract SampleERC20 is ERC20Token {
191-
192-
string public name;
193-
string public symbol;
194-
uint256 public decimals;
195-
196-
constructor (
197-
string memory _name,
198-
string memory _symbol,
199-
uint256 _decimals,
200-
uint256 _totalSupply
201-
)
202-
public
203-
{
204-
name = _name;
205-
symbol = _symbol;
206-
decimals = _decimals;
207-
_totalSupply = _totalSupply;
208-
balances[msg.sender] = _totalSupply;
209-
}
186+
contract MyToken is ERC20, ERC20Permit {
187+
constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {}
210188
}
211189
190+
212191
`}
213192
}
214193
]

apps/remix-ide-e2e/src/tests/vyper_api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare global {
1010
module.exports = {
1111
'@disabled': true,
1212
before: function (browser: NightwatchBrowser, done: VoidFunction) {
13-
init(browser, done, 'http://localhost:8080')
13+
init(browser, done)
1414
},
1515

1616
'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) {

apps/remix-ide/src/assets/js/loader.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ const domains = {
44
'remix.ethereum.org': 23,
55
'localhost': 35 // remix desktop
66
}
7+
const domainsOnPrem = {
8+
'remix-alpha.ethereum.org': 1
9+
}
710

811
let domainToTrack = domains[window.location.hostname]
12+
let domainOnPremToTrack = domainsOnPrem[window.location.hostname]
913

1014

11-
function trackDomain(domainToTrack) {
12-
var _paq = window._paq = window._paq || []
15+
function trackDomain(domainToTrack, u, paqName) {
16+
var _paq = window[paqName] = window[paqName] || []
1317

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

@@ -51,7 +54,19 @@ if (window.electronAPI) {
5154
})
5255
} else {
5356
if (domainToTrack) {
54-
trackDomain(domainToTrack)
57+
trackDomain(domainToTrack, 'https://ethereumfoundation.matomo.cloud/', '_paq')
58+
// Override push method
59+
window._paq.push = function (...args) {
60+
// Push to the original _paq
61+
const result = originalPush.apply(this, args)
62+
63+
// Also replicate to other trackers
64+
if (window._paq2) window._paq2.push(...args)
65+
return result;
66+
}
67+
}
68+
if (domainOnPremToTrack) {
69+
trackDomain(domainOnPremToTrack, 'http://178.156.150.253/matomo/', '_paq2')
5570
}
5671
}
5772
function isElectron() {

0 commit comments

Comments
 (0)