There was duplication and a ugly `#if os(macOS)` with some footers
explicitly rendered on macOS with .themeFooter() (now .themeSubtitle()).
Move this logic to the .themeSection() modifiers by adding a
`forcesFooter` parameter. When true, a fake footer is added on macOS as
the last row of a section.
Let the AppCoordinator take care of the connection requirements via
modals:
- onInteractiveLogin() - now presented on AppError
- onProviderEntityRequired()
- onPurchaseRequired()
- Any other connection error
Subviews must not use tunnel.connect(), rather they route connection
requests via the ConnectionFlow callbacks. In particular, migrate to the
AppCoordinator the connection logic from:
- TunnelToggleButton.perform()
- ProviderEntitySelector.onSelect()
onInteractiveLogin() and onPurchaseRequired() are now handled
internally, while onProviderEntityRequired() is kept public because it's
how subviews may present the entity selector.
Extras:
- Avoid modals overlap with a 500ms delay
- Shrink interactive login size on macOS
Some providers require specific credentials for OpenVPN, different from
account credentials. Update the API index with this information to show
an information footer and possibly a link to the OpenVPN credentials.
Also, fix the OTP footer not appearing on macOS.
Especially for flaky tests:
- Do objectWillChange.send() _before_ performing the change
- Send more events to .didChange to be more deterministic about test
expectations
Clarify the use of contexts:
- **Production** (.shared)
- **Previews** (.mock → .forPreviews)
- ONLY use it in UILibrary for, well, previews
- This context has dumb profiles with UUIDs as names
- Registry is fake
- **UI Tests** (.forUITesting)
- Add new context for UI testing
- Selected based on command line arguments
- This context has mock data tuned for decent screenshots
- Registry is real
Share the same InAppProcessor in .shared and .forTesting contexts
because the app behavior was inconsistent regarding e.g. in-app
purchases.
Ready for screenshots generation, except for the tests themselves and
the TV target.
- More customizations while UI testing
- Act as full version user in IAPManager
- Override layout with default to .grid if isBigDevice
- Show module names in profile list/grid
- Improve mock Profile/ProfileManager
- Meaningful profile names
- iCloud/TV icons
- Initial modules
- Improve XCTest extensions
- Screenshot destination (attachment/temporary)
- Screenshot target (window/sheet)
- Print saved temporary URL at the end (may help with CI)
- Append device name to screenshot filename
- Tests
- Refactor actions with the [Page Object
pattern](https://swiftwithmajid.com/2021/03/24/ui-testing-using-page-object-pattern-in-swift/)
- Perform iPad screenshots in landscape
- Split simple flow tests and screenshots
- Add "Connect to" test
Closes#681
Create UITesting target with:
- AppCommandLine/AppEnvironment: strongly typed refactoring of PP_*
environment values
- AccessibilityInfo: identifies and locates elements for UI testing
Make the app behave differently when launched with `.uiTesting`, and
expose the flag to SwiftUI via `.environment(\.isUITesting)` to:
- Use the mock AppContext
- Skip onboarding
Add PassepartoutUITests target with two screenshot tests:
- Connected screen
- Profile modal
Get rid of the messy `bump*.sh` scripts variants with a single one with
positional arguments (all optional):
- -v: the new version number (default: current)
- -b: the new build number (default: current + 1)
- -s: the initial build for the CHANGELOG diff (default: latest tag)
- -na: do not update the API (default: do update it)
- -nl: do not update the CHANGELOG (default: present editor)
- -d: dry run
Fixes#948
- Omit duplicate/delete from current profile
- Replace .infoButton with .installedProfile if current
- Drop dots from direct actions
- Disable trailing dots on iOS/tvOS
- Disable "Connect to" if ineligible (decouple to own view)
CommonLibrary had some undesired knowledge of UI. Split AppPreference
and UIPreference. Then move some more stuff from AppUI* to UILibrary.
WARNING: this forgets existing UI preferences (e.g. favorite servers).
Create profile with a provider module and an on-demand module (disabled)
to speed up initial provider selection and configuration. Supports
OpenVPN for now.
Fixes#899
Verification was only performed for interactive login, not for provider
server selection. Do that before a connection attempt, so that the
paywall always appears first.