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

scripts for running UI tests #3000

Merged
merged 9 commits into from
Jul 3, 2024
Merged

Conversation

brindy
Copy link
Contributor

@brindy brindy commented Jun 26, 2024

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

Description:
Adds scripts for running the UI tests locally in a way that's similar to how they run on CI.

Setting up UI tests:

  1. Run .maestro/setup_ui_tests.sh from the .maestro folder. It should tell you to run it from the root. If there are other errors with your environment (such as missing commands) it will also fail.
  2. Run .maestro/setup_ui_tests.sh from the root. It'll build the app to a local DerivedData folder, create a simulator and install the app
  3. Run .maestro/setup_ui_tests.sh --skip-build. It'll skip the build, but create a simulator and install the app if one is available in the right location

Running UI tests:

  1. Run .maestro/run_ui_tests.sh. It'll fail because you need to specific a location for the flow files to run.
  2. Run .maestro/run_ui_tests.sh --flow-location .maestro\x which will fail because the location is wrong.
  3. Run .maestro/run_ui_tests.sh --flow-location .maestro\release_tests\ it will run the tests and create a file called run_log.txt in DerivedData. Once it finishes it'll dump that file to the console. If they all passed it will show a success message.
  4. Run .maestro/run_ui_tests.sh --run-flow it'll fail because you need to specify a flow file
  5. Run .maestro/run_ui_tests.sh --run-flow .maestro/release_tests/bookmarks.yaml it'll run just that test
  6. Run .maestro/run_ui_tests.sh --flow-location .maestro\release_tests\ and hit Ctrl-C. This will make it appear like the test has failed. Do this for a few test and allow others to pass. The final message should indicate that some failures occurred.

Cleaning up:

  1. Run .maestro/clean_simulators.sh and it'll kill the simulators and then remove the ones that have 'maestro' in the name. Some errors might get printed for where they don't need to be shutdown but this can be ignored.

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project label Jun 26, 2024
@github-actions github-actions bot removed the bot: not in app board Added by automation for pull requests with tasks not added to iOS App Board Asana project label Jun 26, 2024
@brindy brindy requested a review from loremattei June 26, 2024 20:20
.maestro/setup_ui_tests.sh Show resolved Hide resolved
.maestro/setup_ui_tests.sh Show resolved Hide resolved
.maestro/setup_ui_tests.sh Outdated Show resolved Hide resolved
.maestro/setup_ui_tests.sh Outdated Show resolved Hide resolved
.maestro/setup_ui_tests.sh Show resolved Hide resolved
.maestro/setup_ui_tests.sh Show resolved Hide resolved
@brindy brindy requested a review from loremattei June 27, 2024 17:57
@brindy
Copy link
Contributor Author

brindy commented Jun 27, 2024

@loremattei addressed your comments - ready for another look, thanks.

.maestro/setup_ui_tests.sh Outdated Show resolved Hide resolved
.maestro/run_ui_tests.sh Outdated Show resolved Hide resolved
.maestro/run_ui_tests.sh Outdated Show resolved Hide resolved
.maestro/run_ui_tests.sh Show resolved Hide resolved
@brindy
Copy link
Contributor Author

brindy commented Jun 28, 2024

@loremattei

Just pushed a few changes

  • You can now run the scripts from anywhere
  • Removed the parameters from the run_ui_tests script, it now takes a single parameter
    • if it's a file it runs a single flow
    • if it's a folder it iterates over all the items in the folder. It'll give some weird output if you choose a folder with no flows, but should be obvious enough why

@brindy brindy requested a review from loremattei June 28, 2024 14:52
@brindy brindy mentioned this pull request Jun 29, 2024
Copy link
Contributor

@loremattei loremattei left a comment

Choose a reason for hiding this comment

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

@brindy this looks great!
Thanks for all the updates!
:shipit:

@brindy brindy merged commit b337829 into main Jul 3, 2024
14 checks passed
@brindy brindy deleted the brindy/scripts-for-running-ui-tests branch July 3, 2024 10:15
brindy added a commit that referenced this pull request Jul 3, 2024
Task/Issue URL: https://app.asana.com/0/392891325557410/1207203028528351/f
Tech Design URL:
CC: @loremattei @bwaresiak

Description:

Tests Autofill scenarios:

Password management (add, edit, delete, search, etc)
Password autofill (standard login, multi-step login)
Password authentication (ensure device auth is shown in various scenarios)
Notes:

The scripts are being reviewed in scripts for running UI tests #3000 so you can largely ignore them.
You should be able to run the scripts from anywhere, just adjust the paths below accordingly
Steps to test this PR:

Confirm End to End tests have passed: https://github.com/duckduckgo/iOS/actions/runs/9726361554/job/26844719247
In terminal cd into .maestro
Run setup_ui_tests.sh
Optional: run all the release tests in one go using: run_tests_tests.sh release_tests
Run run_ui_tests.sh release_tests/password-autofill.yaml
Run run_ui_tests.sh release_tests/password-authentication.yaml
Run run_ui_tests.sh release_tests/password-management.yaml
brindy added a commit that referenced this pull request Jul 3, 2024
Task/Issue URL: https://app.asana.com/0/392891325557410/1207195241923822/f
Tech Design URL:
CC: @bwaresiak

Description:
Fleshed out and tweaked bookmarks and favorites UI tests

Notes:

The scripts are being reviewed in scripts for running UI tests #3000 so you can largely ignore them.
You should be able to run the scripts from anywhere, just adjust the paths below accordingly
Fixes a bug found during testing in the bookmarks swift code
Steps to test this PR:

Confirm End to End tests have passed: https://github.com/duckduckgo/iOS/actions/runs/9750711656
In terminal cd into .maestro
Run setup_ui_tests.sh
Optional: run all the release tests in one go using: run_tests_tests.sh release_tests
Run run_ui_tests.sh release_tests/bookmarks.yaml
Run run_ui_tests.sh release_tests/bookmarks-multi.yaml
Run run_ui_tests.sh release_tests/favorites.yaml
samsymons added a commit that referenced this pull request Jul 4, 2024
* main: (24 commits)
  Add pixels to measure baseline for New Tab Page sections (#3024)
  backgrounding UI tests (#3021)
  improve bookmarks and favorites UI tests (#3019)
  [DuckPlayer] - 4. Remote Config (#3018)
  Updates BSK
  Fix issue when cancelling a download (#3030)
  Tentative fix for a crash and connectivity issues (#3027)
  autofill UI tests (#3012)
  scripts for running UI tests (#3000)
  Integrate RemoteMessaging with NewTabPage (#3017)
  Update to iOS 15 deployment target (#3001)
  Fire a pixel when removing the VPN configuration (#3014)
  Release 7.127.0-0 (#3020)
  point to BSK branch (#3016)
  [DuckPlayer] - 3. URL management & FE comms (#3007)
  Bump BSK version (#3011)
  New Tab Page layout and base elements (#3008)
  Remove Privacy Pro from device once expired account is deleted (#3009)
  Improvements to subscription settings (#2959)
  Toggle reports limiter (#3005)
  ...
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