Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Reorganize test/e2e repo to improve navigation part 1 #23398

Merged
merged 3 commits into from
Mar 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const {
unlockWallet,
WALLET_PASSWORD,
waitForAccountRendered,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { emptyHtmlPage } = require('../mock-e2e');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { emptyHtmlPage } = require('../../mock-e2e');

const ganacheOptions = {
accounts: [
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('Import flow @no-mmi', function () {
const fileInput = await driver.findElement('input[type="file"]');
const importJsonFile = path.join(
__dirname,
'..',
'../..',
'import-utc-json',
'test-json-import-account-file.json',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const {
defaultGanacheOptions,
withFixtures,
unlockWallet,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const { SMART_CONTRACTS } = require('../../seeder/smart-contracts');
const FixtureBuilder = require('../../fixture-builder');

describe('Block Explorer', function () {
it('links to the users account on the explorer, ', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const {
unlockWallet,
WINDOW_TITLES,
generateGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Dapp interactions', function () {
it('should trigger the add chain confirmation despite MetaMask being locked', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const { SMART_CONTRACTS } = require('../../seeder/smart-contracts');
const FixtureBuilder = require('../../fixture-builder');

describe('Editing confirmations of dapp initiated contract interactions', function () {
const smartContract = SMART_CONTRACTS.PIGGYBANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Permissions', function () {
it('sets permissions and connect to Dapp', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const {
openDapp,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Wallet Revoke Permissions', function () {
it('should revoke eth_accounts permissions via test dapp', async function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const { toHex } = require('@metamask/controller-utils');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
defaultGanacheOptions,
withFixtures,
openDapp,
regularDelayMs,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
} = require('../../helpers');

const TEST_CHAIN_ID = toHex(100);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
openDapp,
unlockWallet,
WINDOW_TITLES,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('Chain Interactions', function () {
const port = 8546;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
withFixtures,
unlockWallet,
openDapp,
WINDOW_TITLES,
} = require('../helpers');
const { CHAIN_IDS } = require('../../../shared/constants/network');
} = require('../../helpers');
const { CHAIN_IDS } = require('../../../../shared/constants/network');

describe('Deprecated networks', function () {
it('User should not find goerli network when clicking on the network selector', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const {
logInWithBalanceValidation,
openActionMenuAndStartSendFlow,
generateGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { GAS_API_BASE_URL } = require('../../../shared/constants/swaps');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { GAS_API_BASE_URL } = require('../../../../shared/constants/swaps');

describe('Gas API fallback', function () {
async function mockGasApiDown(mockServer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
withFixtures,
openDapp,
unlockWallet,
WINDOW_TITLES,
generateGanacheOptions,
} = require('../helpers');
} = require('../../helpers');

describe('Switch ethereum chain', function () {
it('should successfully change the network in response to wallet_switchEthereumChain', async function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const {
locateAccountBalanceDOM,
defaultGanacheOptions,
WALLET_PASSWORD,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('MetaMask onboarding @no-mmi', function () {
const wrongSeedPhrase =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const {
withFixtures,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { TEST_SNAPS_WEBSITE_URL } = require('../snaps/enums');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { TEST_SNAPS_WEBSITE_URL } = require('../../snaps/enums');
const {
expectName,
focusTestDapp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
unlockWallet,
defaultGanacheOptions,
openActionMenuAndStartSendFlow,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const {
expectName,
focusTestDapp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const {
withFixtures,
unlockWallet,
defaultGanacheOptions,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
const { emptyHtmlPage } = require('../mock-e2e');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');
const { emptyHtmlPage } = require('../../mock-e2e');

describe('Portfolio site', function () {
async function mockPortfolioSite(mockServer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');
const {
WINDOW_TITLES,
defaultGanacheOptions,
Expand All @@ -9,7 +9,7 @@ const {
withFixtures,
getEventPayloads,
switchToNotificationWindow,
} = require('../helpers');
} = require('../../helpers');

const selectedAddress = '0x5cfe73b6021e818b776b421b1c4db2474086a7e1';
const selectedAddressWithoutPrefix = '5cfe73b6021e818b776b421b1c4db2474086a7e1';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');
const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

async function mockInfura(mockServer) {
await mockServerJsonRpc(mockServer, [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
defaultGanacheOptions,
withFixtures,
sendScreenToConfirmScreen,
unlockWallet,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';
const mockMaliciousAddress = '0x5fbdb2315678afecb367f032d93f642f64180aa3';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
Expand All @@ -9,7 +9,7 @@ const {
unlockWallet,
withFixtures,
switchToNotificationWindow,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';
const selectedAddress = '0x5cfe73b6021e818b776b421b1c4db2474086a7e1';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const { mockServerJsonRpc } = require('../mock-server-json-rpc');
const FixtureBuilder = require('../../fixture-builder');
const { mockServerJsonRpc } = require('../../mock-server-json-rpc');

const {
WINDOW_TITLES,
defaultGanacheOptions,
openDapp,
unlockWallet,
withFixtures,
} = require('../helpers');
} = require('../../helpers');

const bannerAlertSelector = '[data-testid="security-provider-banner-alert"]';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');

const {
defaultGanacheOptions,
unlockWallet,
withFixtures,
getEventPayloads,
} = require('../helpers');
} = require('../../helpers');

async function mockServerCalls(mockServer) {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const {
openDapp,
defaultGanacheOptions,
getWindowHandles,
} = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
} = require('../../helpers');
const FixtureBuilder = require('../../fixture-builder');

describe('PPOM Settings @no-mmi', function () {
// eslint-disable-next-line mocha/no-skipped-tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const { strict: assert } = require('assert');
const FixtureBuilder = require('../fixture-builder');
const FixtureBuilder = require('../../fixture-builder');
const {
withFixtures,
openDapp,
unlockWallet,
largeDelayMs,
veryLargeDelayMs,
WINDOW_TITLES,
} = require('../helpers');
const { SMART_CONTRACTS } = require('../seeder/smart-contracts');
} = require('../../helpers');
const { SMART_CONTRACTS } = require('../../seeder/smart-contracts');

describe('4byte setting', function () {
it('makes a call to 4byte when the setting is on', async function () {
Expand Down
Loading
Loading