Skip to content

Commit a5f11c4

Browse files
committed
Use test seeder to enable webContentDebugging
1 parent 2cf3872 commit a5f11c4

11 files changed

Lines changed: 59 additions & 8 deletions

File tree

.github/workflows/e2e-duckplayer.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
release_properties: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
3636
release_key: ${{ secrets.FAKE_RELEASE_KEY }}
3737
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
38-
gradle_flags: '-Pconfig_patches=.maestro/shared/remote_config_patches/enable_web_content_debugging.json'
3938
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
4039
ducksans_package_auth_user: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION_USER }}
4140
ducksans_package_auth_token: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION }}

.github/workflows/e2e-maestro.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
release_properties: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
7474
release_key: ${{ secrets.FAKE_RELEASE_KEY }}
7575
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
76-
gradle_flags: '-Pconfig_patches=.maestro/shared/remote_config_patches/enable_web_content_debugging.json'
7776
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
7877
ducksans_package_auth_user: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION_USER }}
7978
ducksans_package_auth_token: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION }}

.github/workflows/e2e-nightly-full-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
release_properties: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
7070
release_key: ${{ secrets.FAKE_RELEASE_KEY }}
7171
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
72-
gradle_flags: '-Pddg.di=${{ env.DDG_DI }} -Pconfig_patches=.maestro/shared/remote_config_patches/enable_web_content_debugging.json'
72+
gradle_flags: '-Pddg.di=${{ env.DDG_DI }}'
7373
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
7474
ducksans_package_auth_user: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION_USER }}
7575
ducksans_package_auth_token: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION }}

.github/workflows/e2e-nightly-non-blockers-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3232
# Disable the 50/50 onboardingQuickSetupExperimentJun3 A/B experiment so the
3333
# preonboarding tests don't randomly fail when enrolled in the TREATMENT cohort
34-
gradle_flags: '-Pconfig_patches=.maestro/onboarding/remote_config_patches/disable_onboarding_quick_setup_experiment.json,.maestro/shared/remote_config_patches/enable_web_content_debugging.json'
34+
gradle_flags: '-Pconfig_patches=.maestro/onboarding/remote_config_patches/disable_onboarding_quick_setup_experiment.json'
3535
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3636
ducksans_package_auth_user: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION_USER }}
3737
ducksans_package_auth_token: ${{ secrets.DAXMOBILE_GITHUB_PACKAGES_AUTOMATION }}

.maestro/custom_tabs/custom_tabs_navigation.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ name: "Custom Tabs navigation"
88
- launchApp:
99
clearState: true
1010
stopApp: true
11+
arguments:
12+
isMaestro: "true"
13+
webContentDebugging: "true"
1114

1215
- runFlow:
1316
file: ../shared/pre_onboarding.yaml

.maestro/custom_tabs/custom_tabs_navigation_new_tab.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ tags:
1010
- launchApp:
1111
clearState: true
1212
stopApp: true
13+
arguments:
14+
isMaestro: "true"
15+
webContentDebugging: "true"
1316

1417
- runFlow:
1518
file: ../shared/pre_onboarding.yaml

.maestro/privacy_tests_internal/1_-_Api_manipulation.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ tags:
88
commands:
99
- launchApp:
1010
clearState: true
11+
arguments:
12+
isMaestro: "true"
13+
webContentDebugging: "true"
1114
- runFlow: ../shared/skip_all_onboarding.yaml
1215
- runFlow: ../shared/browser_screen/click_on_menu_button.yaml
1316
- tapOn:

.maestro/shared/remote_config_patches/enable_web_content_debugging.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/src/internal/java/com/duckduckgo/app/browser/webview/InternalWebContentDebugging.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package com.duckduckgo.app.browser.webview
1818

1919
import com.duckduckgo.anvil.annotations.ContributesRemoteFeature
2020
import com.duckduckgo.di.scopes.ActivityScope
21+
import com.duckduckgo.di.scopes.AppScope
2122
import com.duckduckgo.feature.toggles.api.Toggle
2223
import com.duckduckgo.feature.toggles.api.Toggle.DefaultFeatureValue
2324
import com.squareup.anvil.annotations.ContributesBinding
@@ -36,7 +37,7 @@ class InternalWebContentDebugging @Inject constructor(
3637
}
3738

3839
@ContributesRemoteFeature(
39-
scope = ActivityScope::class,
40+
scope = AppScope::class,
4041
featureName = "InternalWebContentDebuggingFlag",
4142
)
4243
interface WebContentDebuggingFeature {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2026 DuckDuckGo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.duckduckgo.app.browser.webview
18+
19+
import com.duckduckgo.di.scopes.AppScope
20+
import com.duckduckgo.feature.toggles.api.Toggle
21+
import com.duckduckgo.testseeder.api.TestSeederKey
22+
import com.duckduckgo.testseeder.api.TestSeederPlugin
23+
import com.squareup.anvil.annotations.ContributesMultibinding
24+
import javax.inject.Inject
25+
26+
// Enables WebView remote debugging at launch (before any WebView is created) when a Maestro flow
27+
// passes `webContentDebugging: "true"`. This is what makes `androidWebViewHierarchy: devtools` able
28+
// to read WebView DOM content on pages whose accessibility tree isn't exposed on the CI WebView image.
29+
// Writing the stored state directly (like Dev Settings does) is deterministic — no remote-config
30+
// fetch/timing dependency.
31+
@ContributesMultibinding(AppScope::class)
32+
class WebContentDebuggingSeederPlugin @Inject constructor(
33+
private val webContentDebuggingFeature: WebContentDebuggingFeature,
34+
) : TestSeederPlugin {
35+
36+
override val handledKeys = setOf(TestSeederKey.WEB_CONTENT_DEBUGGING.key)
37+
38+
override suspend fun apply(key: String, value: String) {
39+
webContentDebuggingFeature.webContentDebugging().setRawStoredState(Toggle.State(enable = value == "true"))
40+
}
41+
}

0 commit comments

Comments
 (0)