Skip to content

Commit

Permalink
Merge branch 'release/5.187.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
daxtheduck committed Feb 6, 2024
2 parents e7eb2fe + aa2d0d7 commit 93a7b0d
Show file tree
Hide file tree
Showing 243 changed files with 7,402 additions and 1,490 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/sync-end-to-end.yml

This file was deleted.

11 changes: 9 additions & 2 deletions .maestro/autofill/0_all.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
appId: com.duckduckgo.mobile.android
name: Autofill - Run all tests
name: "Autofill: Run all tests"
tags:
- autofillNoAuthTests
---
# Pre-requisite: the app is installed on an autofill-eligible device with a special build flag set to bypass device-authentication requirement

- launchApp:
clearState: true
- runFlow: ../shared/onboarding.yaml
Expand All @@ -9,4 +13,7 @@ name: Autofill - Run all tests
# Everything below requires a device has device-level authentication set (e.g., a PIN/Password etc...)
- runFlow: 2_autofill_reach_creds_management.yaml
- runFlow: 3_autofill_manually_add_cred.yaml
- runFlow: 4_search_logins.yaml
- runFlow: 4_search_logins.yaml
- runFlow: 5_autofill_manually_updating_an_existing_credential.yaml
- runFlow: 6_delete_logins.yaml
- runFlow: 7_autofill_prompted_to_save_creds_on_form.yaml
3 changes: 3 additions & 0 deletions .maestro/autofill/1_autofill_shown_in_overflow.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Autofill screen is reachable from overflow menu"
---
# Pre-requisite: the user has cleared onboarding and is on the new tab page

- tapOn:
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
- assertVisible: "Passwords"
Expand Down
3 changes: 3 additions & 0 deletions .maestro/autofill/2_autofill_reach_creds_management.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Password manager screen when no passwords saved"
---
# Pre-requisite: the user is viewing the password manager screen with no saved passwords, on an autofill-eligible device

- assertVisible:
text: "No passwords saved yet"
- assertNotVisible:
Expand Down
3 changes: 3 additions & 0 deletions .maestro/autofill/3_autofill_manually_add_cred.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Manually add credentials"
---
# Pre-requisite: the user is viewing the password manager screen with no saved passwords, on an autofill-eligible device

- runScript: 3_script.js

- repeat:
Expand Down
3 changes: 3 additions & 0 deletions .maestro/autofill/4_search_logins.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Search credentials"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- tapOn:
id: searchLogins

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Manually updating an existing credential"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- tapOn:
id: "item_container"
index: "1"

- tapOn: "More options"
- tapOn: "Edit"

- tapOn:
id: notesEditText

- eraseText

- inputText: "new note"

- tapOn:
id: view_menu_save
retryTapIfNoChange: false

- assertVisible: "new note"
- tapOn: "Navigate up"
30 changes: 30 additions & 0 deletions .maestro/autofill/6_delete_logins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Delete credentials"
---
# Pre-requisite: the user is viewing the password manager screen with some saved passwords added by a previous test step, on an autofill-eligible device

- tapOn:
id: "item_container"
index: 1
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- tapOn:
id: "item_container"
index: 1
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- tapOn:
id: "item_container"
index: 1
- tapOn: "More options"
- tapOn: "Delete"
- tapOn: "Delete"

- assertVisible:
text: "No passwords saved yet"

- tapOn: "Navigate up"
41 changes: 41 additions & 0 deletions .maestro/autofill/7_autofill_prompted_to_save_creds_on_form.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
appId: com.duckduckgo.mobile.android
name: "Autofill: Prompted to save and update credentials on web form"
---
# Pre-requisite: the user is viewing the new tab screen, on an autofill-eligible device

- tapOn:
text: "search or type URL"
- eraseText
- inputText: "fill.dev/form/login-simple"
- pressKey: enter

- tapOn:
text: "Got it"
optional: true

- tapOn:
id: "username"
- inputText: "user"
- tapOn:
id: "password"
- inputText: "password1"
- tapOn:
text: "Login"
- assertVisible: "Save Password"
- tapOn: "Save Password"
- pressKey: back
- tapOn: "Close Autofill Dialog"
- tapOn:
id: "password"
- inputText: "password2"
- tapOn:
text: "Login"
- assertVisible: "Update Password"
- tapOn: "Update Password"
- tapOn:
id: "browserMenu"
- tapOn: "Passwords"
- tapOn: "user"
- tapOn:
id: "internal_password_icon"
- assertVisible: "password2"
4 changes: 2 additions & 2 deletions .maestro/sync_flows/create_account.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Test Definition: https://app.asana.com/0/1205017362573508/1205017364481021
appId: com.duckduckgo.mobile.android
name: "ReleaseTest: Users can create an account"
name: "ReleaseTest: Users can create a sync account"
tags:
- syncTest
- syncCriticalPathTest
---
- launchApp:
clearState: true
Expand Down
4 changes: 2 additions & 2 deletions .maestro/sync_flows/delete_server_data.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Test Definition: https://app.asana.com/0/1205017362573508/1206195332210606
appId: com.duckduckgo.mobile.android
name: "ReleaseTest: Users can remove all data"
name: "Sync Critical Path test: Users can remove all data"
tags:
- syncTest
- syncCriticalPathTest
---
- launchApp:
clearState: true
Expand Down
5 changes: 3 additions & 2 deletions .maestro/sync_flows/recover_account.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Test Definition: https://app.asana.com/0/1205017362573508/1205044961533553/f
# Test Definition: https://app.asana.com/0/1205017362573508/1205044961533551/f
# This test also runs the create account test, so we don't need to run both
appId: com.duckduckgo.mobile.android
name: "ReleaseTest: Users can recover an account / Device can be added to an account"
name: "Sync Critical Path test: Users can recover an account / Device can be added to an account"
tags:
- syncTest
- syncCriticalPathTest
---
- launchApp:
clearState: true
Expand Down
2 changes: 1 addition & 1 deletion .maestro/sync_flows/sync_data.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test Definition: https://app.asana.com/0/1205017362573508/1205044961533557
appId: com.duckduckgo.mobile.android
name: "ReleaseTest: Data can be synced"
name: "Sync Critical Path test: Data can be synced"
tags:
- syncCriticalPathTest
---
Expand Down
1 change: 1 addition & 0 deletions anvil/anvil-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ kotlin {
}

dependencies {
implementation Google.dagger
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 DuckDuckGo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.duckduckgo.anvil.annotations

import dagger.MapKey

/**
* Use [PriorityKey] in combination with @ContributesMultibinding when contributing a plugin and want
* to assign a priority to the instance.
* Lower priority values mean the associated plugin comes first in the list of plugins.
* When two plugins have the same priority the priority is resolved sorting by class instance fully qualified name
*
* Note: Plugins that are not annotated with [PriorityKey] will always come last in the list of plugins and order
* by class instance fully qualified name
*/
@MapKey
annotation class PriorityKey(val priority: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ class ContributesPluginPointCodeGenerator : CodeGenerator {
.primaryConstructor(
PropertySpec
.builder(
"plugins",
"setPlugins",
ClassName("com.duckduckgo.di", "DaggerSet").parameterizedBy(pluginClassName),
)
.addModifiers(KModifier.PRIVATE)
.build(),
PropertySpec
.builder(
"mapPlugins",
ClassName("com.duckduckgo.di", "DaggerMap").parameterizedBy(Int::class.asClassName(), pluginClassName),
)
.addModifiers(KModifier.PRIVATE)
.build(),
)
.addProperty(
PropertySpec
Expand All @@ -93,7 +100,17 @@ class ContributesPluginPointCodeGenerator : CodeGenerator {
.delegate(
CodeBlock.builder()
.beginControlFlow("lazy")
.add("plugins.toList().sortedBy { it.javaClass.name }")
.add(
"""
mapPlugins.entries
.sortedWith(compareBy({ it.key }, { it.value.javaClass.name }))
.map { it.value }
.toMutableList()
.apply {
addAll(setPlugins.toList().sortedBy { it.javaClass.name })
}
""".trimIndent(),
)
.endControlFlow()
.build(),
)
Expand Down Expand Up @@ -135,12 +152,19 @@ class ContributesPluginPointCodeGenerator : CodeGenerator {
)
.addModifiers(KModifier.ABSTRACT)
.addFunction(
FunSpec.builder("bindEmpty${vmClass.shortName}_PluginPoint")
FunSpec.builder("bindSetEmpty${vmClass.shortName}_PluginPoint")
.addAnnotation(AnnotationSpec.builder(Multibinds::class).build())
.addModifiers(KModifier.ABSTRACT)
.returns(daggerSetFqName.asClassName(module).parameterizedBy(pluginClassName))
.build(),
)
.addFunction(
FunSpec.builder("bindMapEmpty${vmClass.shortName}_PluginPoint")
.addAnnotation(AnnotationSpec.builder(Multibinds::class).build())
.addModifiers(KModifier.ABSTRACT)
.returns(daggerMapFqName.asClassName(module).parameterizedBy(Int::class.asClassName(), pluginClassName))
.build(),
)
.addFunction(
FunSpec.builder("bind${vmClass.shortName}_PluginPoint")
.addParameter(
Expand All @@ -163,6 +187,7 @@ class ContributesPluginPointCodeGenerator : CodeGenerator {
private val pluginPointFqName = FqName("com.duckduckgo.common.utils.plugins.PluginPoint")
private val kotlinCollectionFqName = FqName("kotlin.collections.Collection")
private val daggerSetFqName = FqName("com.duckduckgo.di.DaggerSet")
private val daggerMapFqName = FqName("com.duckduckgo.di.DaggerMap")
}

private fun TypeSpec.Builder.primaryConstructor(vararg properties: PropertySpec): TypeSpec.Builder {
Expand Down
Loading

0 comments on commit 93a7b0d

Please sign in to comment.