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: Writing new test about metamask section links #22911

Merged
merged 25 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0c41f81
Added links validation
hjetpoluru Feb 8, 2024
0879031
Merge branch 'develop' of github.com:MetaMask/metamask-extension into…
hjetpoluru Feb 8, 2024
f1b0308
Updated the test to validate the link and not to click
hjetpoluru Feb 10, 2024
3c1f4b2
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 13, 2024
91a139a
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 13, 2024
e37ff3e
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 13, 2024
8c6ad4d
Merge branch 'develop' of github.com:MetaMask/metamask-extension into…
hjetpoluru Feb 20, 2024
150fbca
Merge branch 'e2e/settings-about-metamask-links-test' of github.com:M…
hjetpoluru Feb 20, 2024
868bc9e
Added unit test
hjetpoluru Feb 20, 2024
3d4fdd9
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 20, 2024
c755045
Removed console log
hjetpoluru Feb 21, 2024
31f2044
Merge branch 'e2e/settings-about-metamask-links-test' of github.com:M…
hjetpoluru Feb 21, 2024
c54b9fd
Removed e2e validation for links
hjetpoluru Feb 21, 2024
8b3f89a
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 21, 2024
d4019cf
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 21, 2024
baa70cc
Merge branch 'develop' into e2e/settings-about-metamask-links-test
HowardBraham Feb 22, 2024
a3f2f7f
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 22, 2024
e5988dc
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 22, 2024
6077293
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
3adcf96
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
538faa0
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
efa1a8d
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
0a73d83
Fixed my lint and some other files
hjetpoluru Feb 23, 2024
d4f8e52
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
178e84c
Merge branch 'develop' into e2e/settings-about-metamask-links-test
hjetpoluru Feb 23, 2024
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 @@ -24,12 +24,15 @@ const selectors = {
walletOverview: '.wallet-overview__balance',
};

hjetpoluru marked this conversation as resolved.
Show resolved Hide resolved
// This function is to click on the three dots and select the "Settings" option from the dropdown menu.
// Then, click on the "About" section from the left panel.
async function switchToAboutView(driver: Driver) {
await driver.clickElement(selectors.accountOptionsMenuButton);
await driver.clickElement(selectors.settingsDiv);
await driver.clickElement(selectors.aboutDiv);
}

// Test case to validate the view in the "About" - MetaMask.
describe('Setting - About MetaMask : @no-mmi', function (this: Suite) {
it('validate the view', async function () {
await withFixtures(
Expand All @@ -44,7 +47,7 @@ describe('Setting - About MetaMask : @no-mmi', function (this: Suite) {
// navigate to settings and click on about view
await switchToAboutView(driver);

// Validating the heading text
// Validating the title
const isTitlePresent = await driver.isElementPresent(
selectors.titleText,
);
Expand All @@ -64,7 +67,7 @@ describe('Setting - About MetaMask : @no-mmi', function (this: Suite) {
'Meta Mask label is not present in the about view section',
);

// verify the version number in the about view section to the fixture builder version as 11.7.3
// verify the version number of the MetaMask
const metaMaskVersion = await driver.findElement(
selectors.metaMaskVersion,
);
Expand Down
1 change: 1 addition & 0 deletions test/env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
process.env.METAMASK_ENVIRONMENT = 'test';
process.env.SUPPORT_LINK = 'https://support.metamask.io';
process.env.SUPPORT_REQUEST_LINK = 'https://metamask.zendesk.com/hc/en-us';
hjetpoluru marked this conversation as resolved.
Show resolved Hide resolved
process.env.IFRAME_EXECUTION_ENVIRONMENT_URL =
'https://execution.metamask.io/0.36.1-flask.1/index.html';
10 changes: 8 additions & 2 deletions test/scenarios/17. settings/about-metamask/ui-validation.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Validate UI components of the About - MetaMask,,,,
Critical Test - Validate UI components of the About - MetaMask,,,,
Step,Test Steps,Test Data,Expected Result,Notes
1,Open the extension.,,The Welcome Back screen is shown,
2,Proceed to Unlock the wallet.,password (8 characters min),,
Expand All @@ -7,4 +7,10 @@ Step,Test Steps,Test Data,Expected Result,Notes
5,Validate the heading in the section,,'About' text needs to appear.,
6,Validate the version in the section,,'MetaMask Version' label should appear with the appriorate version,
7,Validate the tag line in the section,,'MetaMask is designed and built around the world.' tagline should appear,
8,Click on the close button,,Validate the wallet overview page appears.,
8,Click on the close button,,Validate the wallet overview page appears.,
9,Click on the link for the 'Privacy policy',,Privacy policy 'https://consensys.io/privacy-policy' page is loaded,Critical because it's the only way to access privacy policy
10,Click on the link for the 'Terms of use',,Terms of use page 'https://consensys.io/terms-of-use' is loaded,
11,Click on the link for the 'Visit our support center',,Support page 'https://support.metamask.io/hc/en-us' is loaded,
12,Click on the link for the 'Attributions',,Attributions 'https://metamask.io/attributions/' page is loaded,
13,Click on the link for the 'Visit our website',,Visit our website 'https://metamask.io/' page is loaded,
14,Click on the link for the 'Contact us',,Contact us 'https://support.metamask.io/hc/en-us' code page is loaded,
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React from 'react';
import configureMockStore from 'redux-mock-store';
import mockStore from '../../../../../test/data/mock-state.json';

import {
renderWithProvider,
} from '../../../../../test/jest';
import { renderWithProvider } from '../../../../../test/jest';
import TransactionAlreadyConfirmed from '.';

const getStoreWithModalData = () => {
Expand All @@ -26,7 +24,7 @@ const getStoreWithModalData = () => {
describe('Transaction Already Confirmed modal', () => {
it('should match snapshot', async () => {
const { baseElement } = renderWithProvider(
<TransactionAlreadyConfirmed />,
<TransactionAlreadyConfirmed />,
getStoreWithModalData(),
);
expect(baseElement).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion ui/hooks/useModalProps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ describe('useModalProps', () => {
expect(props).toStrictEqual(MOCK_PROPS);
expect(hideModal).toStrictEqual(expect.any(Function));
});
});
});
59 changes: 59 additions & 0 deletions ui/pages/settings/info-tab/info-tab.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react';
import { renderWithProvider } from '../../../../test/jest/rendering';
import InfoTab from '.';

describe('InfoTab', () => {
describe('validate links', () => {
let getByText: (text: string) => HTMLElement;

beforeEach(() => {
const renderResult = renderWithProvider(<InfoTab />);
getByText = renderResult.getByText;
});

it('should have correct href for "Privacy Policy" link', () => {
const privacyPolicyLink = getByText('Privacy policy');
expect(privacyPolicyLink).toHaveAttribute(
'href',
'https://metamask.io/privacy.html',
);
});

it('should have correct href for "Terms of Use" link', () => {
const termsOfUseLink = getByText('Terms of use');
expect(termsOfUseLink).toHaveAttribute(
'href',
'https://metamask.io/terms.html',
);
});

it('should have correct href for "Attributions" link', () => {
const attributionsLink = getByText('Attributions');
expect(attributionsLink).toHaveAttribute(
'href',
'https://metamask.io/attributions.html',
);
});

it('should have correct href for "Support" link', () => {
const supportLink = getByText('Visit our support center');
expect(supportLink).toHaveAttribute(
'href',
'https://support.metamask.io',
);
});

it('should have correct href for "Visit our website" link', () => {
const websiteLink = getByText('Visit our website');
expect(websiteLink).toHaveAttribute('href', 'https://metamask.io/');
});

it('should have correct href for "Contact us" link', () => {
const contactUsLink = getByText('Contact us');
expect(contactUsLink).toHaveAttribute(
'href',
'https://metamask.zendesk.com/hc/en-us',
);
});
});
});
Loading