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

add autoclear tests #3056

Merged
merged 8 commits into from
Jul 12, 2024
Merged

add autoclear tests #3056

merged 8 commits into from
Jul 12, 2024

Conversation

brindy
Copy link
Contributor

@brindy brindy commented Jul 8, 2024

Task/Issue URL: https://app.asana.com/0/392891325557410/1207203028528350/f
Tech Design URL:
CC: @loremattei

Description:
Adds UI tests for autoclearing.

Tweaked storyboard to give the toggle an accessibility ID.

Steps to test this PR:

  1. Check End to End tests have passed: https://github.com/duckduckgo/iOS/actions/runs/9842231721
  2. cd into .maestro in the project
  3. Run ./setup_ui_tests.sh
  4. Run run_ui_tests.sh release_tests/autoclear.yaml
  5. Run run_ui_tests.sh release_tests/backgrounding.yaml

@@ -40,6 +40,7 @@ run_flow() {

echo "⏲️ Starting flow $( basename $flow)"

export MAESTRO_DRIVER_STARTUP_TIMEOUT=60000
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This prevents occasional timeouts as maestro does an xcodebuild under the covers in order to build the runner and it can sometimes just crap out.

Comment on lines +82 to +83
--rebuild)
rebuild=1 ;;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support --rebuild arg so that you can make local changes while running the tests quicker.

Comment on lines +76 to +79
if ProcessInfo.processInfo.arguments.contains("autoclear-ui-test") {
return elapsedTime > 5
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When maestro launches with this argument then all expiries are now 5 seconds. Unit tests and backgrounding UI tests validate that this does not affect production.

@@ -205,6 +205,7 @@
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cdQ-74-TuJ">
<rect key="frame" x="305" y="6.6666666666666679" width="51" height="31.000000000000004"/>
<accessibility key="accessibilityConfiguration" identifier="AutoclearEnabledToggle"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accessibility ID to make it more sensible in the UI test.

echo "‼️ Unable to set region"
exit 1
fi

Copy link
Collaborator

Choose a reason for hiding this comment

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

@brindy I took the liberty to push this change - apparently freshly made simulator defaults to my system locale, failing all tests as a result :)

Copy link
Collaborator

@bwaresiak bwaresiak left a comment

Choose a reason for hiding this comment

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

LGTM!

@brindy brindy merged commit c09558c into main Jul 12, 2024
14 checks passed
@brindy brindy deleted the brindy/add-autoclear-tests branch July 12, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants