Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix End to End tests #3224

Merged
merged 19 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9263197
Make complete contextual onboarding when tests run if necessary
alessandroboron Aug 7, 2024
85b652d
Add delays to fix flaky test
amddg44 Aug 7, 2024
20ed363
Updated spacing
amddg44 Aug 7, 2024
84eac77
Fix Settings test
alessandroboron Aug 8, 2024
b2ac81a
Inject variable to decide if Dax Dialogs should be shown during UITests
alessandroboron Aug 12, 2024
62434fa
Remove Dax onboarding handling from privacy tests
alessandroboron Aug 12, 2024
e25c2dc
Remove Dax onboarding handling from ad_click tests
alessandroboron Aug 12, 2024
090837b
Remove Dax onboarding handling from secuirty tests
alessandroboron Aug 12, 2024
2d93bb7
Remove Dax onboarding handling from release tests
alessandroboron Aug 12, 2024
1d92a7c
Remove Dax onboarding handling from browser feature tests
alessandroboron Aug 12, 2024
d7bc466
Remove manual dax dialog handling
alessandroboron Aug 12, 2024
e81d04f
Delete Onboarding browsing workflow
alessandroboron Aug 12, 2024
5dadb1f
Pass Onboarding completed flag true to CI tests that don't require on…
alessandroboron Aug 12, 2024
be65869
Fix autoclear test
alessandroboron Aug 12, 2024
26a1f3d
Updated documentation
alessandroboron Aug 12, 2024
2f38f75
Move LaunchOptionsHandler and add tests
alessandroboron Aug 13, 2024
4543469
Refactor logic to support defining App variants in tests and add onbo…
alessandroboron Aug 13, 2024
bf2ebd7
Fix lint warning
alessandroboron Aug 13, 2024
8bc9a05
Semplify app variant to use only one value instead of multiple
alessandroboron Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ jobs:

- name: Release tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=release DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} -e ONBOARDING_COMPLETED=true --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=release DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained in the PR description I inject the ENV variable ONBOARDING_COMPLETED via command to execute the tests


- name: Privacy tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=privacy DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} -e ONBOARDING_COMPLETED=true --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=privacy DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/

- name: Security tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=securityTest DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} -e ONBOARDING_COMPLETED=true --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=securityTest DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/

- name: Ad Click Detection Flow tests
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=adClick DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.MAESTRO_CLOUD_API_KEY }} -e ONBOARDING_COMPLETED=true --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=adClick DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/

- name: Create Asana task when workflow failed
if: ${{ failure() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-1"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

# Test Ad1
- assertVisible:
text: "[Ad 1] SERP Ad (heuristic)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-2"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

# Test Ad2
- assertVisible:
text: "[Ad 2] Shopping Tab Ad (heuristic)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-3"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

# Test Ad3
- assertVisible:
text: "[Ad 3] SERP Ad (heuristic)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-4"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 4] Shopping Tab Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-5"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 5] SERP Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-6"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 6] Shopping Tab Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-7"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 7] SERP Ad (SERP-provided)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-8"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 8] Shopping Tab Ad (SERP-provided)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-9"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

# Test Ad9
- assertVisible:
text: "[Ad 9] SERP Ad (SERP-provided)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-10"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 10] Shopping Tab Ad (SERP-provided)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-11"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 11] SERP Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-12"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 12] Shopping Tab Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-13"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 13] SERP Ad (SERP-provided)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ tags:
- inputText: "https://www.search-company.site/#ad-id-14"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 14] Shopping Tab Ad (SERP-provided)"
- tapOn:
Expand Down
8 changes: 0 additions & 8 deletions .maestro/browser_features/opening_tabs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ tags:
- inputText: "https://privacy-test-pages.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible: ".*Privacy Test Pages.*"
- tapOn: "Links Open in New Window"

Expand Down
8 changes: 0 additions & 8 deletions .maestro/browser_features/search_bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ tags:
- inputText: "https://privacy-test-pages.site/features/auto-refresh.html"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible: "Website that refreshes every 3 seconds."

# Start typing
Expand Down
8 changes: 0 additions & 8 deletions .maestro/browser_features/swipe_tabs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ tags:
- inputText: "https://www.search-company.site"
- pressKey: Enter

# Manage onboarding
- runFlow:
when:
visible:
text: "Got It"
index: 0
file: ../shared/onboarding_browsing.yaml

- assertVisible: "Search engine"

# Open New Tab
Expand Down
11 changes: 2 additions & 9 deletions .maestro/data_clearing_tests/02_duckduckgo_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@ tags:
- inputText: "privacy blogs"
- pressKey: Enter

# Dismiss Dax Dialogs if visible
- runFlow:
when:
visible: "Phew!"
commands:
- tapOn: "Phew!"

# Change settings
- tapOn: "Safe search: moderate"
- tapOn: "Safe search: moderate"
- tapOn: "Off"

# Fire Button - twice, just to be sure
Expand All @@ -47,4 +40,4 @@ tags:
id: "searchEntry"
- inputText: "creepy trackers"
- pressKey: Enter
- assertVisible: "Safe search: off"
- assertVisible: "Safe search: off"
29 changes: 29 additions & 0 deletions .maestro/onboarding_tests/01_control_group_onboarding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
appId: com.duckduckgo.mobile.ios
tags:
- onboarding

---

# Set up
- runFlow:
file: ../shared/setup.yaml
env:
ONBOARDING_COMPLETED: "false"
APP_VARIANT: "ma"

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.duckduckgo.com"
- pressKey: Enter

# Handle Onboarding
- assertVisible: "Got It"
- assertVisible: "Hide"
- tapOn: "Got It"
- assertVisible: "Close Tabs and Clear Data"
- tapOn: "Close Tabs and Clear Data"
- tapOn: "Close Tabs and Clear Data"
- assertVisible: "You’ve got this!\n\nRemember: Every time you browse with me, a creepy ad loses its wings. 👍"
33 changes: 33 additions & 0 deletions .maestro/onboarding_tests/02_control_group_hide_onboarding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
appId: com.duckduckgo.mobile.ios
tags:
- onboarding

---

# Set up
- runFlow:
file: ../shared/setup.yaml
env:
ONBOARDING_COMPLETED: "false"
APP_VARIANT: "ma"

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.duckduckgo.com"
- pressKey: Enter

# Handle Onboarding
- assertVisible: "Got It"
- assertVisible: "Hide"
- tapOn: "Hide"
- assertVisible: "Hide Tips Forever"
- tapOn: "Hide Tips Forever"

# Handle Fire Button
- assertVisible: "Close Tabs and Clear Data"
- tapOn: "Close Tabs and Clear Data"
- tapOn: "Close Tabs and Clear Data"
- assertNotVisible: "You’ve got this!\n\nRemember: Every time you browse with me, a creepy ad loses its wings. 👍"
Loading
Loading