Skip to content

Commit

Permalink
Add UI Test for WebView state restoration (#3920)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

Task/Issue URL:
https://app.asana.com/0/1206226850447395/1208991633646642
Tech Design URL:
CC:

**Description**:

Adds UI test for WebView state restoration.

**Steps to test this PR**:
1. Make sure UI test is passing
(`browser_features/state_restoration.yaml`).

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**Definition of Done (Internal Only)**:

* [x] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
  • Loading branch information
dus7 authored Feb 4, 2025
1 parent eca437b commit 71a09c3
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .maestro/browser_features/state_restoration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# state_restoration.yaml
appId: com.duckduckgo.mobile.ios
tags:
- release

---

# Set up
- runFlow:
file: ../shared/setup.yaml

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

# Create navigation stack
- assertVisible: "English"
- tapOn: "English"
- assertVisible: "Welcome to Wikipedia.*"
- tapOn: "Wikipedia"
- assertVisible: "Article"
- scrollUntilVisible:
element: "United States"
# Make sure bottom bar is visible
- tapOn:
point: 80%, 99%
- tapOn: "Browse Back"
- assertVisible: "Welcome to Wikipedia.*"

# Load a new tab
- longPressOn: "Tab Switcher"
- assertVisible:
id: "searchEntry"
- tapOn:
id: "searchEntry"
- inputText: "https://example.com"
- pressKey: Enter

- stopApp
- launchApp

- tapOn: "Tab Switcher"
- tapOn:
point: 20%, 25%

# Check if state from previous session was restored
- assertVisible: "Welcome to Wikipedia.*"
- tapOn: "Browse Forward"
- assertVisible: "United States"

0 comments on commit 71a09c3

Please sign in to comment.