Skip to content

Commit

Permalink
Merge branch 'release/7.32.0' into chore/7.32.0-bump-to-1442
Browse files Browse the repository at this point in the history
  • Loading branch information
Cal-L authored Oct 1, 2024
2 parents 9f27a1f + 7788094 commit ea67fed
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 37 deletions.
7 changes: 5 additions & 2 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ import handleWebViewFocus from '../../../util/browser/webViewFocus';
import { isTest } from '../../../util/test/utils.js';
import { EXTERNAL_LINK_TYPE } from '../../../constants/browser';

const { HOMEPAGE_URL, NOTIFICATION_NAMES } = AppConstants;
const { HOMEPAGE_URL, NOTIFICATION_NAMES, OLD_HOMEPAGE_URL_HOST } =
AppConstants;
const HOMEPAGE_HOST = new URL(HOMEPAGE_URL)?.hostname;
const MM_MIXPANEL_TOKEN = process.env.MM_MIXPANEL_TOKEN;

Expand Down Expand Up @@ -363,7 +364,9 @@ export const BrowserTab = (props) => {
const currentPage = checkUrl || url.current;
const prefixedUrl = prefixUrlWithProtocol(currentPage);
const { host: currentHost } = getUrlObj(prefixedUrl);
return currentHost === HOMEPAGE_HOST;
return (
currentHost === HOMEPAGE_HOST || currentHost === OLD_HOMEPAGE_URL_HOST
);
}, []);

const notifyAllConnections = useCallback((payload, restricted = true) => {
Expand Down
5 changes: 4 additions & 1 deletion app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default {
MM_UNIVERSAL_LINK_HOST: 'metamask.app.link',
MM_DEEP_ITMS_APP_LINK: 'https://metamask.app.link/skAH3BaF99',
SAI_ADDRESS: '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359',
HOMEPAGE_URL: process.env.MM_HOMEPAGE || 'https://home.metamask.io/',
HOMEPAGE_URL:
process.env.MM_HOMEPAGE ||
'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/',
OLD_HOMEPAGE_URL_HOST: 'home.metamask.io',
SHORT_HOMEPAGE_URL: 'MetaMask.io',
ZERO_ADDRESS: '0x0000000000000000000000000000000000000000',
USER_AGENT: Device.isAndroid()
Expand Down
12 changes: 6 additions & 6 deletions app/util/browser/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('Browser utils :: trustedProtocolToDeeplink', () => {
expect(trustedProtocolToDeeplink.includes(protocol)).toBeTruthy();
});
it('should match metamask: protocol', () => {
const { protocol } = new URL('metamask://dapp/home.metamask.io');
const { protocol } = new URL('metamask://dapp/portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeTruthy();
});
Expand All @@ -217,27 +217,27 @@ describe('Browser utils :: trustedProtocolToDeeplink', () => {
expect(trustedProtocolToDeeplink.includes(protocol)).toBeTruthy();
});
it('should match dapp: protocol', () => {
const { protocol } = new URL('dapp://home.metamask.io');
const { protocol } = new URL('dapp://portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeTruthy();
});
it('should not match eth: protocol', () => {
const { protocol } = new URL('eth://home.metamask.io');
const { protocol } = new URL('eth://portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeFalsy();
});
it('should not match tel: protocol', () => {
const { protocol } = new URL('tel://home.metamask.io');
const { protocol } = new URL('tel://portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeFalsy();
});
it('should not match mailto: protocol', () => {
const { protocol } = new URL('mailto://home.metamask.io');
const { protocol } = new URL('mailto://portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeFalsy();
});
it('should not match ldap: protocol', () => {
const { protocol } = new URL('ldap://home.metamask.io');
const { protocol } = new URL('ldap://portfolio.metamask.io');

expect(trustedProtocolToDeeplink.includes(protocol)).toBeFalsy();
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class FixtureBuilder {
whitelist: [],
tabs: [
{
url: 'https://home.metamask.io/',
url: 'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/',
id: 1692550481062,
},
],
Expand Down
34 changes: 17 additions & 17 deletions e2e/specs/browser/browser-tests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,27 @@ describe(SmokeCore('Browser Tests'), () => {
await Browser.waitForBrowserPageToLoad();
});

it('should add the test dapp to favorites', async () => {
// Check that we are still on the browser screen
// it('should add the test dapp to favorites', async () => {
// // Check that we are still on the browser screen

// Tap on options
await Browser.tapOptionsButton();
await Browser.tapAddToFavoritesButton();
// // Tap on options
// await Browser.tapOptionsButton();
// await Browser.tapAddToFavoritesButton();

await Assertions.checkIfVisible(AddBookmarkView.container);
// await Assertions.checkIfVisible(AddBookmarkView.container);

await AddBookmarkView.tapAddBookmarksButton();
await Assertions.checkIfNotVisible(AddBookmarkView.container);
});
// await AddBookmarkView.tapAddBookmarksButton();
// await Assertions.checkIfNotVisible(AddBookmarkView.container);
// });

it('should tap on the test dapp in favorites on the home page', async () => {
await Browser.tapHomeButton();
// Wait for page to load
await TestHelpers.delay(3000);
await Browser.tapDappInFavorites();
await Assertions.checkIfTextIsDisplayed('metamask.github.io');
// }
});
// it('should tap on the test dapp in favorites on the home page', async () => {
// await Browser.tapHomeButton();
// // Wait for page to load
// await TestHelpers.delay(3000);
// await Browser.tapDappInFavorites();
// await Assertions.checkIfTextIsDisplayed('metamask.github.io');
// // }
// });

it('should test invalid URL', async () => {
await TestHelpers.delay(2000);
Expand Down
4 changes: 2 additions & 2 deletions wdio/features/BrowserFlow/AddFavorite.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Feature: Browser Add Favorite

Scenario: Adding browser Favorites
Add, click and delete favorites. Display favorites in the Favorites tab of home.metamask.io
Add, click and delete favorites. Display favorites in the Favorites tab of portfolio.metamask.io

Given the app displayed the splash animation
And I have imported my wallet
Expand All @@ -22,7 +22,7 @@ Feature: Browser Add Favorite
And Url field is pre populated with "https://app.uniswap.org/"
When I tap on "Cancel" on the Add Favorite Screen
Then the "https://app.uniswap.org/" is displayed in the browser tab
And the favorite is not added on the home "https://home.metamask.io" page
And the favorite is not added on the home "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile" page
When I navigate to "https://uniswap.exchange"
And I tap on browser control menu icon on the bottom right of the browser view
And I tap the "Add to Favorites" option on the Option Menu
Expand Down
4 changes: 2 additions & 2 deletions wdio/features/BrowserFlow/AddressBar.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Feature: Browser Address Bar
And I have 1 browser tab displayed
When I tap on address bar
Then browser address view is displayed
And the "https://home.metamask.io/" url is displayed in address field
And the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" url is displayed in address field
When I tap on "clear icon" in address field
Then address field is cleared
When I tap on "Cancel button" in address field
Then browser address bar input view is no longer displayed
And the browser view is on the "https://home.metamask.io/" website
And the browser view is on the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" website
When I tap on address bar
And I navigate to "reddit.com"
Then the browser view is on the "https://www.reddit.com/" website
2 changes: 1 addition & 1 deletion wdio/features/BrowserFlow/InvalidURL.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Feature: Browser Invalid URL
Then I should see "Something went wrong" error title
And I should see "We couldn't load that page" error message
When I tap on the Return button from the error page
Then the browser view is on the "https://home.metamask.io/" website
Then the browser view is on the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" website
2 changes: 1 addition & 1 deletion wdio/features/BrowserFlow/NavigationControls.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Browser Control Options
When I navigate to "reddit.com"
Then the browser view is on the "https://www.reddit.com/" website
And I tap on the back arrow control button
Then the browser view is on the "https://home.metamask.io/" website
Then the browser view is on the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" website
When I tap on browser tab button with count 1
Then multi browser tab view is displayed
When I tap on "Add" button on multi browser tab view
Expand Down
2 changes: 1 addition & 1 deletion wdio/features/BrowserFlow/OptionMenu.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Feature: Browser Options Menu
And "New tab" option item is displayed in browser options menu
When I tap the "New Tab" option on the Option Menu
Then new browser tab is added
#And the browser view is on the "https://home.metamask.io/" website
#And the browser view is on the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" website
2 changes: 1 addition & 1 deletion wdio/features/BrowserFlow/PhishingDetection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Feature: Browser Phishing Detection
When I navigate to "http://www.empowr.com/FanFeed/Home.aspx"
Then I should see a warning screen with Ethereum Phishing Detection title
When I tap the Back button on Phishing Detection page
And the browser view is on the "https://home.metamask.io/" website
And the browser view is on the "https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/" website
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const CANCEL_BUTTON_ON_BROWSER_ID = 'cancel-url-button';

export const UNISWAP_SUGGESTION = 'https://uniswap.exchange/';

export const HOME_SUGGESTION = 'https://home.metamask.io/';
export const HOME_SUGGESTION = 'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/';

export const URL_CLEAR_ICON = 'url-clear-icon';
2 changes: 1 addition & 1 deletion wdio/step-definitions/browser-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const TEST_DAPP = 'https://metamask.github.io/test-dapp/';
Given(/^I am on Home MetaMask website$/, async () => {
await ExternalWebsitesScreen.isHomeFavoriteButtonDisplayed();
await BrowserScreen.tapUrlBar();
await AddressBarScreen.isUrlValueContains('https://home.metamask.io/');
await AddressBarScreen.isUrlValueContains('https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/');
await AddressBarScreen.tapUrlCancelButton();
});

Expand Down

0 comments on commit ea67fed

Please sign in to comment.