From a3678973a643eb69f8121a62b88714cc0dc13aed Mon Sep 17 00:00:00 2001 From: Hassaan El-Garem Date: Wed, 13 Dec 2023 05:56:42 +0200 Subject: [PATCH 1/4] Update: rename google domains feature flag --- .../Classes/Utility/BuildInformation/FeatureFlag.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 2ed10bd739bf..381131610ade 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -11,7 +11,7 @@ enum FeatureFlag: Int, CaseIterable { case personalizeHomeTab case commentModerationUpdate case compliancePopover - case domainFocus + case googleDomainsCard /// Returns a boolean indicating if the feature is enabled var enabled: Bool { @@ -38,7 +38,7 @@ enum FeatureFlag: Int, CaseIterable { return false case .compliancePopover: return true - case .domainFocus: + case .googleDomainsCard: return true } } @@ -80,8 +80,8 @@ extension FeatureFlag { return "Comments Moderation Update" case .compliancePopover: return "Compliance Popover" - case .domainFocus: - return "Domain Focus" + case .googleDomainsCard: + return "Google Domains Promotional Card" } } } From 7cd86a409212e0343d39f51e9f454f97118b2d16 Mon Sep 17 00:00:00 2001 From: Hassaan El-Garem Date: Wed, 13 Dec 2023 05:57:28 +0200 Subject: [PATCH 2/4] Update: disable google domains feature flag --- WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 381131610ade..41848500b11e 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -39,7 +39,7 @@ enum FeatureFlag: Int, CaseIterable { case .compliancePopover: return true case .googleDomainsCard: - return true + return false } } From 5332615ad17f2444e75671d1286402d1fed27b3b Mon Sep 17 00:00:00 2001 From: Hassaan El-Garem Date: Wed, 13 Dec 2023 06:03:53 +0200 Subject: [PATCH 3/4] Update: fix build errors --- .../ViewRelated/Blog/Blog Dashboard/DashboardCard.swift | 2 +- .../WordPressTest/Dashboard/BlogDashboardServiceTests.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/DashboardCard.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/DashboardCard.swift index ad9773523ca8..63d44ffbb81c 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/DashboardCard.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/DashboardCard.swift @@ -149,7 +149,7 @@ enum DashboardCard: String, CaseIterable { case .jetpackSocial: return DashboardJetpackSocialCardCell.shouldShowCard(for: blog) case .googleDomains: - return FeatureFlag.domainFocus.enabled && isJetpack + return FeatureFlag.googleDomainsCard.enabled && isJetpack } } diff --git a/WordPress/WordPressTest/Dashboard/BlogDashboardServiceTests.swift b/WordPress/WordPressTest/Dashboard/BlogDashboardServiceTests.swift index 77ef566d31a3..0acadff25c8e 100644 --- a/WordPress/WordPressTest/Dashboard/BlogDashboardServiceTests.swift +++ b/WordPress/WordPressTest/Dashboard/BlogDashboardServiceTests.swift @@ -55,7 +55,7 @@ class BlogDashboardServiceTests: CoreDataTestCase { try? featureFlags.override(FeatureFlag.personalizeHomeTab, withValue: true) try? featureFlags.override(RemoteFeatureFlag.activityLogDashboardCard, withValue: true) try? featureFlags.override(RemoteFeatureFlag.pagesDashboardCard, withValue: true) - try? featureFlags.override(FeatureFlag.domainFocus, withValue: false) + try? featureFlags.override(FeatureFlag.googleDomainsCard, withValue: false) } override func tearDown() { @@ -65,7 +65,7 @@ class BlogDashboardServiceTests: CoreDataTestCase { try? featureFlags.override(FeatureFlag.personalizeHomeTab, withValue: FeatureFlag.personalizeHomeTab.originalValue) try? featureFlags.override(RemoteFeatureFlag.activityLogDashboardCard, withValue: RemoteFeatureFlag.activityLogDashboardCard.originalValue) try? featureFlags.override(RemoteFeatureFlag.pagesDashboardCard, withValue: RemoteFeatureFlag.pagesDashboardCard.originalValue) - try? featureFlags.override(FeatureFlag.domainFocus, withValue: FeatureFlag.domainFocus.originalValue) + try? featureFlags.override(FeatureFlag.googleDomainsCard, withValue: FeatureFlag.googleDomainsCard.originalValue) } func testCallServiceWithCorrectIDAndCards() { From 860bda0c27a5aca174c213082209b42ec5aefffe Mon Sep 17 00:00:00 2001 From: Tiago Marques Date: Sat, 16 Dec 2023 02:36:28 -0300 Subject: [PATCH 4/4] Make XCUIElement.isWithinVisibleArea handle Navigation bar not being displayed --- WordPress/UITestsFoundation/XCUIElement+Utils.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/WordPress/UITestsFoundation/XCUIElement+Utils.swift b/WordPress/UITestsFoundation/XCUIElement+Utils.swift index 6cf8f0ae2829..985b2bb48c10 100644 --- a/WordPress/UITestsFoundation/XCUIElement+Utils.swift +++ b/WordPress/UITestsFoundation/XCUIElement+Utils.swift @@ -20,7 +20,14 @@ public extension XCUIElement { let deviceScreenFrame = app.windows.element(boundBy: 0).frame let deviceScreenWidth = deviceScreenFrame.size.width - let visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height + let visibleAreaTop: CGFloat + + if topElement.exists { + visibleAreaTop = topElement.frame.origin.y + topElement.frame.size.height + } else { + visibleAreaTop = deviceScreenFrame.origin.y + } + let visibleAreaHeight = bottomElement.frame.origin.y - visibleAreaTop let visibleAreaFrame = CGRect(x: 0, y: visibleAreaTop, width: deviceScreenWidth, height: visibleAreaHeight)