Skip to content

Commit

Permalink
Attempt to fix settings not clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDDanica committed Feb 5, 2025
1 parent e003d9b commit 3570861
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
6 changes: 5 additions & 1 deletion test/e2e/page-objects/pages/header-navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class HeaderNavbar {

private readonly switchNetworkDropDown = '[data-testid="network-display"]';

private readonly notificationsMenuItem =
'[data-testid="notifications-menu-item"]';

private readonly networkPicker = '.mm-picker-network';

constructor(driver: Driver) {
Expand Down Expand Up @@ -63,6 +66,7 @@ class HeaderNavbar {
async openThreeDotMenu(): Promise<void> {
console.log('Open account options menu');
await this.driver.clickElement(this.threeDotMenuButton);
await this.driver.waitForSelector(this.notificationsMenuItem);
}

async openPermissionsPage(): Promise<void> {
Expand All @@ -80,7 +84,7 @@ class HeaderNavbar {
async openSettingsPage(): Promise<void> {
console.log('Open settings page');
await this.openThreeDotMenu();
await this.driver.clickElement(this.settingsButton);
await this.driver.clickElementAndWaitToDisappear(this.settingsButton);
}

async clickSwitchNetworkDropDown(): Promise<void> {
Expand Down
39 changes: 32 additions & 7 deletions test/e2e/tests/metrics/segment-user-traits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,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 @@ -181,19 +181,44 @@ describe('Segment User Traits', function () {
let events = [];
await completeCreateNewWalletOnboardingFlow({
driver,
participateInMetaMetrics: true,
dataCollectionForMarketing: true,
participateInMetaMetrics: false,
});
events = await getEventPayloads(driver, mockedEndpoints);
assert.equal(events.length, 1);
assert.equal(events.length, 0);
const securityAndPrivacySettings = new SecurityAndPrivacySettings(
driver,
);
await securityAndPrivacySettings.navigateToPage();
await securityAndPrivacySettings.toggleParticipateInMetaMetrics();
events = await getEventPayloads(driver, mockedEndpoints);
assert.equal(events.length, 1);
},
);
// await withFixtures(
// {
// fixtures: new FixtureBuilder({ onboarding: true })
// .withMetaMetricsController({
// metaMetricsId: MOCK_META_METRICS_ID,
// participateInMetaMetrics: false,
// })
// .build(),
// title: this.test?.fullTitle(),
// testSpecificMock: mockSegment,
// },
// async ({ driver, mockedEndpoint: mockedEndpoints }) => {
// let events = [];
// await completeCreateNewWalletOnboardingFlow({
// driver,
// participateInMetaMetrics: false,
// dataCollectionForMarketing: true,
// });
// events = await getEventPayloads(driver, mockedEndpoints);
// assert.equal(events.length, 1);
// const securityAndPrivacySettings = new SecurityAndPrivacySettings(
// driver,
// );
// await securityAndPrivacySettings.navigateToPage();
// await securityAndPrivacySettings.toggleParticipateInMetaMetrics();
// events = await getEventPayloads(driver, mockedEndpoints);
// assert.equal(events.length, 1);
// },
// );
});
});

0 comments on commit 3570861

Please sign in to comment.