Skip to content

Commit 0cc1a57

Browse files
committed
Merge branch 'develop' into move-unit-tests-to-github-actions
2 parents c082f24 + c641981 commit 0cc1a57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+956
-256
lines changed

.circleci/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ develop_master_rc_only: &develop_master_rc_only
5353
- master
5454
- /^Version-v(\d+)[.](\d+)[.](\d+)/
5555

56+
exclude_develop_master_rc: &exclude_develop_master_rc
57+
filters:
58+
branches:
59+
ignore:
60+
- develop
61+
- master
62+
- /^Version-v(\d+)[.](\d+)[.](\d+)/
5663
aliases:
5764
# Shallow Git Clone
5865
- &shallow-git-clone
@@ -106,6 +113,7 @@ workflows:
106113
- check-pr-tag
107114
- prep-deps
108115
- get-changed-files-with-git-diff:
116+
<<: *exclude_develop_master_rc
109117
requires:
110118
- prep-deps
111119
- test-deps-audit:
@@ -203,7 +211,6 @@ workflows:
203211
<<: *develop_master_rc_only
204212
requires:
205213
- prep-build-confirmation-redesign-test-mv2
206-
- get-changed-files-with-git-diff
207214
- test-e2e-chrome-rpc:
208215
requires:
209216
- prep-build-test
@@ -223,7 +230,6 @@ workflows:
223230
<<: *develop_master_rc_only
224231
requires:
225232
- prep-build-test-flask-mv2
226-
- get-changed-files-with-git-diff
227233
- test-e2e-chrome-mmi:
228234
requires:
229235
- prep-build-test-mmi
@@ -475,6 +481,7 @@ jobs:
475481

476482
# This job is used for the e2e quality gate.
477483
# It must be run before any job which uses the run-all.js script.
484+
# The job is skipped in develop, master or RC branches.
478485
get-changed-files-with-git-diff:
479486
executor: node-browsers-small
480487
steps:

development/generate-rc-commits.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,31 @@ const authorTeams = {
4949
'Niranjana Binoy',
5050
'Victor Thomas',
5151
'vthomas13',
52+
'seaona',
53+
'Norbert Elter',
5254
],
53-
DappAPI: ['tmashuang', 'jiexi', 'BelfordZ', 'Shane'],
54-
'Confirmation UX': [
55+
'Wallet API': ['tmashuang', 'jiexi', 'BelfordZ', 'Shane'],
56+
Confirmations: [
5557
'Pedro Figueiredo',
5658
'Sylva Elendu',
5759
'Olusegun Akintayo',
5860
'Jyoti Puri',
5961
'Ariella Vu',
60-
'seaona',
61-
],
62-
'Confirmation Systems': [
6362
'OGPoyraz',
6463
'vinistevam',
6564
'Matthew Walsh',
6665
'cryptotavares',
6766
'Vinicius Stevam',
6867
'Derek Brans',
6968
'sleepytanya',
69+
'Priya',
70+
],
71+
'Design Systems': [
72+
'georgewrmarshall',
73+
'Garrett Bear',
74+
'George Marshall',
75+
'Devin',
7076
],
71-
'Design Systems': ['georgewrmarshall', 'Garrett Bear', 'George Marshall'],
7277
Snaps: [
7378
'David Drazic',
7479
'hmalik88',
@@ -84,7 +89,7 @@ const authorTeams = {
8489
Assets: ['salimtb', 'sahar-fehri', 'Brian Bergeron'],
8590
Linea: ['VGau', 'Victorien Gauch'],
8691
lavamoat: ['weizman', 'legobeat', 'kumavis', 'LeoTM'],
87-
'Shared Libraries': [
92+
'Wallet Framework': [
8893
'Michele Esposito',
8994
'Elliot Winkler',
9095
'Gudahtt',
@@ -98,10 +103,11 @@ const authorTeams = {
98103
'Shane T',
99104
'Bernardo Garces Chapero',
100105
],
101-
Swaps: ['Daniel', 'Davide Brocchetto', 'Nicolas Ferro'],
106+
Swaps: ['Daniel', 'Davide Brocchetto', 'Nicolas Ferro', 'infiniteflower'],
102107
Devex: ['Thomas Huang', 'Alex Donesky', 'jiexi', 'Zachary Belford'],
103108
Notifications: ['Prithpal-Sooriya', 'Matteo Scurati', 'Prithpal Sooriya'],
104-
Bridging: ['Bilal', 'micaelae'],
109+
Bridging: ['Bilal', 'micaelae', 'Ethan Wessel'],
110+
Ramps: ['George Weiler'],
105111
};
106112

107113
// Function to get PR labels
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { withFixtures, defaultGanacheOptions, WINDOW_TITLES } from '../helpers';
2+
import { Driver } from '../webdriver/driver';
3+
import FixtureBuilder from '../fixture-builder';
4+
import {
5+
buildQuote,
6+
reviewQuote,
7+
waitForTransactionToComplete,
8+
checkActivityTransaction,
9+
} from '../tests/swaps/shared';
10+
import { installSnapSimpleKeyring } from './common';
11+
12+
const DAI = 'DAI';
13+
const TEST_ETH = 'TESTETH';
14+
15+
describe('Snap Account - Swap', function () {
16+
it('swaps ETH for DAI using a snap account', async function () {
17+
await withFixtures(
18+
{
19+
fixtures: new FixtureBuilder().build(),
20+
ganacheOptions: defaultGanacheOptions,
21+
title: this.test?.fullTitle(),
22+
},
23+
async ({ driver }: { driver: Driver }) => {
24+
await installSnapSimpleKeyring(driver, false);
25+
await driver.switchToWindowWithTitle(
26+
WINDOW_TITLES.ExtensionInFullScreenView,
27+
);
28+
await buildQuote(driver, {
29+
amount: 0.001,
30+
swapTo: DAI,
31+
});
32+
await reviewQuote(driver, {
33+
amount: 0.001,
34+
swapFrom: TEST_ETH,
35+
swapTo: DAI,
36+
});
37+
await driver.clickElement({ text: 'Swap', tag: 'button' });
38+
await waitForTransactionToComplete(driver, { tokenName: 'DAI' });
39+
await checkActivityTransaction(driver, {
40+
index: 0,
41+
amount: '0.001',
42+
swapFrom: TEST_ETH,
43+
swapTo: DAI,
44+
});
45+
},
46+
);
47+
});
48+
});

test/e2e/changedFilesUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function readChangedFiles() {
2020
return changedFiles;
2121
} catch (error) {
2222
console.error('Error reading from file:', error);
23-
return '';
23+
return [];
2424
}
2525
}
2626

test/e2e/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ export const TEST_SNAPS_SIMPLE_KEYRING_WEBSITE_URL =
3535

3636
/* Address of the VerifyingPaymaster smart contract deployed to Ganache. */
3737
export const VERIFYING_PAYMASTER = '0xbdbDEc38ed168331b1F7004cc9e5392A2272C1D7';
38+
39+
/* Default ganache ETH balance in decimal when first login */
40+
export const DEFAULT_GANACHE_ETH_BALANCE_DEC = '25';

test/e2e/helpers.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const { PAGES } = require('./webdriver/driver');
1616
const GanacheSeeder = require('./seeder/ganache-seeder');
1717
const { Bundler } = require('./bundler');
1818
const { SMART_CONTRACTS } = require('./seeder/smart-contracts');
19-
const { ERC_4337_ACCOUNT } = require('./constants');
19+
const {
20+
ERC_4337_ACCOUNT,
21+
DEFAULT_GANACHE_ETH_BALANCE_DEC,
22+
} = require('./constants');
2023

2124
const tinyDelayMs = 200;
2225
const regularDelayMs = tinyDelayMs * 2;
@@ -672,6 +675,14 @@ const openDapp = async (driver, contract = null, dappURL = DAPP_URL) => {
672675
: await driver.openNewPage(dappURL);
673676
};
674677

678+
const openDappConnectionsPage = async (driver) => {
679+
await driver.openNewPage(
680+
`${driver.extensionUrl}/home.html#connections/${encodeURIComponent(
681+
DAPP_URL,
682+
)}`,
683+
);
684+
};
685+
675686
const createDappTransaction = async (driver, transaction) => {
676687
await openDapp(
677688
driver,
@@ -730,25 +741,30 @@ const ACCOUNT_1 = '0x5cfe73b6021e818b776b421b1c4db2474086a7e1';
730741
const ACCOUNT_2 = '0x09781764c08de8ca82e156bbf156a3ca217c7950';
731742

732743
const defaultGanacheOptions = {
733-
accounts: [{ secretKey: PRIVATE_KEY, balance: convertETHToHexGwei(25) }],
744+
accounts: [
745+
{
746+
secretKey: PRIVATE_KEY,
747+
balance: convertETHToHexGwei(DEFAULT_GANACHE_ETH_BALANCE_DEC),
748+
},
749+
],
734750
};
735751

736752
const multipleGanacheOptions = {
737753
accounts: [
738754
{
739755
secretKey: PRIVATE_KEY,
740-
balance: convertETHToHexGwei(25),
756+
balance: convertETHToHexGwei(DEFAULT_GANACHE_ETH_BALANCE_DEC),
741757
},
742758
{
743759
secretKey: PRIVATE_KEY_TWO,
744-
balance: convertETHToHexGwei(25),
760+
balance: convertETHToHexGwei(DEFAULT_GANACHE_ETH_BALANCE_DEC),
745761
},
746762
],
747763
};
748764

749765
const generateGanacheOptions = ({
750766
secretKey = PRIVATE_KEY,
751-
balance = convertETHToHexGwei(25),
767+
balance = convertETHToHexGwei(DEFAULT_GANACHE_ETH_BALANCE_DEC),
752768
...otherProps
753769
}) => {
754770
const accounts = [
@@ -1150,6 +1166,7 @@ module.exports = {
11501166
importWrongSRPOnboardingFlow,
11511167
testSRPDropdownIterations,
11521168
openDapp,
1169+
openDappConnectionsPage,
11531170
createDappTransaction,
11541171
switchToOrOpenDapp,
11551172
connectToDapp,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Driver } from '../../webdriver/driver';
2+
3+
class HeaderNavbar {
4+
private driver: Driver;
5+
6+
private accountMenuButton: string;
7+
8+
constructor(driver: Driver) {
9+
this.driver = driver;
10+
this.accountMenuButton = '[data-testid="account-menu-icon"]';
11+
}
12+
13+
async openAccountMenu(): Promise<void> {
14+
await this.driver.clickElement(this.accountMenuButton);
15+
}
16+
}
17+
18+
export default HeaderNavbar;

0 commit comments

Comments
 (0)