Skip to content

Commit

Permalink
Update Maestro e2e tests (#1991)
Browse files Browse the repository at this point in the history
Co-authored-by: Lorenzo Mattei <[email protected]>
  • Loading branch information
loremattei and Lorenzo Mattei authored Oct 10, 2023
1 parent 893804a commit 75022c9
Show file tree
Hide file tree
Showing 30 changed files with 182 additions and 298 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,38 @@ jobs:
-derivedDataPath "DerivedData" \
| tee xcodebuild.log
- name: Setup tests
run: bundle install && bundle exec fastlane setup_e2e_tests

- name: Release tests
uses: mobile-dev-inc/action-maestro-cloud@v1.2.3
uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
workspace: .maestro/release_tests
workspace: .maestro
include-tags: release

- name: Privacy tests
uses: mobile-dev-inc/action-maestro-cloud@v1.2.3
uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
workspace: .maestro/privacy_tests
workspace: .maestro
include-tags: privacy

- name: Ad Click Detection Flow tests
uses: mobile-dev-inc/action-maestro-cloud@v1.2.3
uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
workspace: .maestro/privacy_tests
workspace: .maestro
include-tags: adClick

- name: Create Asana task when workflow failed
if: ${{ failure() }}
run: |
curl -s "https://app.asana.com/api/1.0/tasks" \
-H "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--data ' \
{ \
data: " \
"name": "GH Workflow Failure - End to end tests", \
"workspace": ${{ vars.GH_ASANA_WORKSPACE_ID }}, \
"projects": [ \
${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }} \
], \
"notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}", \
" \
}'
--header "Accept: application/json" \
--header "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--data ' { "data": { "name": "GH Workflow Failure - End to end tests", "workspace": "${{ vars.GH_ASANA_WORKSPACE_ID }}", "projects": [ "${{ vars.GH_ASANA_IOS_APP_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}" } }'
- name: Upload logs when workflow failed
uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yjs_heuristic_no_ad_domain_param_u3_param_included.yaml

appId: com.duckduckgo.mobile.ios
tags:
- adClick

---

# Set up
Expand All @@ -11,14 +12,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-1"
- pressKey: Enter

# Manage onboarding
Expand All @@ -27,9 +28,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"
file: ../shared/onboarding_browsing.yaml

# Test Ad1
- assertVisible:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mjs_heuristic_no_ad_domain_param_dsl_param_included.yaml

appId: com.duckduckgo.mobile.ios
tags:
- adClick

---

# Set up
Expand All @@ -11,14 +12,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-2"
- pressKey: Enter

# Manage onboarding
Expand All @@ -27,9 +28,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"
file: ../shared/onboarding_browsing.yaml

# Test Ad2
- assertVisible:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yjs_heuristic_no_ad_domain_param_but_missing_u3_param.yaml

appId: com.duckduckgo.mobile.ios
tags:
- adClick

---

# Set up
Expand All @@ -11,14 +12,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-3"
- pressKey: Enter

# Manage onboarding
Expand All @@ -27,9 +28,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"
file: ../shared/onboarding_browsing.yaml

# Test Ad3
- assertVisible:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# _mjs_heuristic_no_ad_domain_param_but_missing_dsl_param.yaml

appId: com.duckduckgo.mobile.ios
tags:
- adClick

---

# Set up
Expand All @@ -11,14 +12,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-4"
- pressKey: Enter

# Manage onboarding
Expand All @@ -27,15 +28,8 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"
file: ../shared/onboarding_browsing.yaml

# Test Ad4
- swipe:
start: 400, 200
end: 400, 0
duration: 200
- assertVisible:
text: "[Ad 4] Shopping Tab Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yjs_heuristic_ad_domain_provided_but_empty_u3_not_needed.yaml

appId: com.duckduckgo.mobile.ios
tags:
- adClick

---

# Set up
Expand All @@ -11,14 +12,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-5"
- pressKey: Enter

# Manage onboarding
Expand All @@ -27,15 +28,8 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"
file: ../shared/onboarding_browsing.yaml

# Test Ad5
- swipe:
start: 400, 200
end: 400, 0
duration: 200
- assertVisible:
text: "[Ad 5] SERP Ad (heuristic)"
- tapOn:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- adClick

---
- clearState
- launchApp
Expand All @@ -7,14 +10,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-6"
- pressKey: Enter

# Manage onboarding
Expand All @@ -23,15 +26,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"

# Test Ad6
- swipe:
start: 200, 200
end: 200, 0
duration: 200
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 6] Shopping Tab Ad (heuristic)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- adClick

---
- clearState
- launchApp
Expand All @@ -7,14 +10,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-7"
- pressKey: Enter

# Manage onboarding
Expand All @@ -23,15 +26,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"

# Test Ad7
- swipe:
start: 200, 250
end: 200, 0
duration: 200
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 7] SERP Ad (SERP-provided)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
appId: com.duckduckgo.mobile.ios
tags:
- adClick

---
- clearState
- launchApp
Expand All @@ -7,14 +10,14 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Let’s Do It!"
index: 0
file: ./shared/onboarding.yaml
file: ../shared/onboarding.yaml

# Load Site
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://www.search-company.site/"
- inputText: "https://www.search-company.site/#ad-id-8"
- pressKey: Enter

# Manage onboarding
Expand All @@ -23,19 +26,7 @@ appId: com.duckduckgo.mobile.ios
visible:
text: "Got It"
index: 0
file: ./shared/onboarding_browsing.yaml

- assertVisible: "Search engine"

# Test Ad8
- swipe:
start: 200, 200
end: 200, 0
duration: 200
- swipe:
start: 200, 200
end: 200, 0
duration: 200
file: ../shared/onboarding_browsing.yaml

- assertVisible:
text: "[Ad 8] Shopping Tab Ad (SERP-provided)"
Expand Down
Loading

0 comments on commit 75022c9

Please sign in to comment.