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

Update sync e2e tests to new setup flow #2151

Merged
merged 9 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
24 changes: 22 additions & 2 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Sync-End-to-End tests

on:
schedule:
- cron: '0 5 * * *' # run at 5 AM UTC
push
#schedule:
# - cron: '0 5 * * *' # run at 5 AM UTC

jobs:
sync-end-to-end-tests:
Expand Down Expand Up @@ -60,4 +61,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
4 changes: 1 addition & 3 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
15 changes: 6 additions & 9 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
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