Skip to content

Commit

Permalink
Update sync e2e tests to new setup flow (#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
loremattei authored Nov 14, 2023
1 parent 60f8601 commit 9c4124e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 49 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,23 @@ jobs:
env: |
CODE=${{ steps.sync-recovery-code.outputs.recovery-code }}
- name: Create Asana task when workflow failed
if: ${{ failure() }}
run: |
curl -s "https://app.asana.com/api/1.0/tasks" \
--header "Accept: application/json" \
--header "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \
--header "Content-Type: application/json" \
--data ' { "data": { "name": "GH Workflow Failure - Sync 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
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7


16 changes: 7 additions & 9 deletions .maestro/shared/sync_create.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
appId: com.duckduckgo.mobile.ios
---

- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Turn on Sync
- tapOn: Sync Another Device
- tapOn: Show QR Code
- assertVisible: "Go to Settings > Sync in the DuckDuckGo App on a different device and scan this QR code to sync."
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back Up
- tapOn: Start Sync & Back Up
- assertVisible: All Set!
- tapOn: Next
- assertVisible: Save Recovery Code?
2 changes: 1 addition & 1 deletion .maestro/shared/sync_delete.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appId: com.duckduckgo.mobile.ios
---

- assertVisible: Sync
- assertVisible: Sync & Back Up
- scroll
- tapOn:
point: 50%,91% # TODO: Revisit after new setup flow has been implemented.
Expand Down
6 changes: 2 additions & 4 deletions .maestro/sync_tests/01_create_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ tags:


# Clean up
- tapOn: Back
- tapOn: Cancel
- tapOn: Not Now
- assertVisible: Sync
- assertVisible: Sync & Back Up
- runFlow:
file: ../shared/sync_delete.yaml
file: ../shared/sync_delete.yaml
17 changes: 7 additions & 10 deletions .maestro/sync_tests/02_login_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,22 @@ tags:
file: ../shared/sync_create.yaml

# Copy Sync Code and Log Out
- tapOn: Back
- tapOn: Cancel
- assertVisible: Save Recovery Key
- tapOn: Copy Key
- tapOn: Copy Code
- tapOn: Not Now
- tapOn: "1"
- assertVisible: Sync & Back Up
- tapOn: Turn Off Sync & Back Up
- assertVisible: Turn Off Sync?
- tapOn: Remove

# Login
- tapOn: "0"
- tapOn: Recover Your Synced Data
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
- tapOn: Not Now

# Clean up
- assertVisible: Sync
- assertVisible: Sync & Back Up
- runFlow:
file: ../shared/sync_delete.yaml
file: ../shared/sync_delete.yaml
21 changes: 11 additions & 10 deletions .maestro/sync_tests/03_recover_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ tags:
- tapOn:
id: searchEntry
- inputText: ${CODE}
- longPressOn:
id: searchEntry
- repeat:
while:
notVisible: "Select All"
commands:
- tapOn:
id: searchEntry
- tapOn: Select All
- tapOn: Cut
- tapOn:
Expand All @@ -35,14 +39,11 @@ tags:
- tapOn: Settings
- runFlow:
file: ../shared/set_internal_user.yaml
- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Recover Your Synced Data
- assertVisible: Scan QR Code
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back up
- tapOn: Recover Your Data
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
Expand Down
25 changes: 10 additions & 15 deletions .maestro/sync_tests/04_sync_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ tags:
- tapOn:
id: searchEntry
- inputText: ${CODE}
- longPressOn:
id: searchEntry
- runFlow:
when:
visible:
text: searchEntry
- repeat:
while:
notVisible: "Select All"
commands:
- tapOn: searchEntry
- tapOn:
id: searchEntry
- tapOn: Select All
- tapOn: Cut
- tapOn:
Expand All @@ -86,14 +84,11 @@ tags:
- tapOn: Settings
- runFlow:
file: ../shared/set_internal_user.yaml
- assertVisible: Sync
- tapOn: Sync
- assertVisible: Sync
- tapOn: "0"
- assertVisible: Turn on Sync?
- tapOn: Recover Your Synced Data
- assertVisible: Scan QR Code
- tapOn: Manually Enter Code
- assertVisible: Sync & Back Up
- tapOn: Sync & Back Up
- assertVisible: Sync & Back up
- tapOn: Recover Your Data
- tapOn: Enter Text Code
- tapOn: Paste
- assertVisible: Device Synced!
- tapOn: Next
Expand Down

0 comments on commit 9c4124e

Please sign in to comment.