Skip to content

Commit

Permalink
attempt to fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDDanica committed Feb 3, 2025
1 parent 89cbc67 commit c30995d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class SecurityAndPrivacySettings {
const settingsPage = new SettingsPage(this.driver);
await settingsPage.check_pageIsLoaded();
await settingsPage.goToPrivacySettings();
await this.check_pageIsLoaded();
}

async toggleParticipateInMetaMetrics(): Promise<void> {
Expand Down
18 changes: 6 additions & 12 deletions test/e2e/page-objects/pages/settings/settings-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ class SettingsPage {
private readonly closeSettingsPageButton =
'.settings-page__header__title-container__close-button';

private readonly developerOptionsButton = {
text: 'Developer Options',
css: '.tab-bar__tab__content__title',
};
private readonly developerOptionsButton =
'[data-testid="tab-content-Developer Options"]';

private readonly experimentalSettingsButton = {
text: 'Experimental',
css: '.tab-bar__tab__content__title',
};
private readonly experimentalSettingsButton =
'[data-testid="tab-content-Experimental"]';

private readonly privacySettingsButton = {
text: 'Security & privacy',
css: '.tab-bar__tab__content__title',
};
private readonly privacySettingsButton =
'[data-testid="tab-content-Security & privacy"]';

private readonly settingsPageTitle = {
text: 'Settings',
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/tests/metrics/segment-user-traits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ describe('Segment User Traits', function () {
driver,
);
await securityAndPrivacySettings.navigateToPage();
await securityAndPrivacySettings.check_pageIsLoaded();
await securityAndPrivacySettings.toggleParticipateInMetaMetrics();
events = await getEventPayloads(driver, mockedEndpoints);
assert.equal(events.length, 1);
Expand Down Expand Up @@ -156,6 +157,7 @@ describe('Segment User Traits', function () {
driver,
);
await securityAndPrivacySettings.navigateToPage();
await securityAndPrivacySettings.check_pageIsLoaded();
await securityAndPrivacySettings.toggleParticipateInMetaMetrics();
await securityAndPrivacySettings.toggleDataCollectionForMarketing();
events = await getEventPayloads(driver, mockedEndpoints);
Expand All @@ -166,7 +168,7 @@ describe('Segment User Traits', function () {
);
});

it('should stop sending identify events when user disables metrics in privacy settings after opting in during onboarding', async function () {
it.only('should stop sending identify events when user disables metrics in privacy settings after opting in during onboarding', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder({ onboarding: true })
Expand All @@ -184,12 +186,14 @@ describe('Segment User Traits', function () {
participateInMetaMetrics: true,
dataCollectionForMarketing: true,
});
await driver.wait(30000)

Check failure on line 189 in test/e2e/tests/metrics/segment-user-traits.spec.ts

View workflow job for this annotation

GitHub Actions / Test lint / Test lint

Insert `;`
events = await getEventPayloads(driver, mockedEndpoints);
assert.equal(events.length, 1);
const securityAndPrivacySettings = new SecurityAndPrivacySettings(
driver,
);
await securityAndPrivacySettings.navigateToPage();
await securityAndPrivacySettings.check_pageIsLoaded();
await securityAndPrivacySettings.toggleParticipateInMetaMetrics();
events = await getEventPayloads(driver, mockedEndpoints);
assert.equal(events.length, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ exports[`SnapUIAddress renders Ethereum address 1`] = `
<rect
fill="#F29602"
height="32"
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -476,7 +476,7 @@ exports[`SnapUIAddress renders legacy Ethereum address 1`] = `
<rect
fill="#F29602"
height="32"
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
width="32"
x="0"
y="0"
Expand Down
7 changes: 6 additions & 1 deletion ui/components/app/tab-bar/tab-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ const TabBar = (props) => {
)}
<div className="tab-bar__tab__content">
<div className="tab-bar__tab__content__icon">{icon}</div>
<div className="tab-bar__tab__content__title">{content}</div>
<div
className="tab-bar__tab__content__title"
data-testid={`tab-content-${content}`}
>
{content}
</div>
</div>
<Icon
name={IconName.ArrowRight}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -218,7 +218,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down

0 comments on commit c30995d

Please sign in to comment.