Skip to content

Commit

Permalink
PIA-809: Update client app
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-laura-sempere committed Nov 6, 2023
2 parents 99e87c7 + e5d18bd commit 2e34107
Show file tree
Hide file tree
Showing 84 changed files with 2,863 additions and 969 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: pia_vpn_ios
on:
pull_request:
workflow_dispatch:
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
jobs:
build:
runs-on: macos-13
env:
TEST_RUNNER_PIA_TEST_USER: ${{ secrets.PIA_ACCOUNT_USERNAME}}
TEST_RUNNER_PIA_TEST_PASSWORD: ${{ secrets.PIA_ACCOUNT_PASSWORD }}

steps:
- name: Setup Git credentials
run: |
git config --global url."https://${{ secrets.ORG_GITHUB_USERNAME }}:${{ secrets.ORG_GITHUB_TOKEN }}@github.com/".insteadOf "[email protected]:"
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2

- name: Install Fastlane
run: gem install fastlane

- name: Set credentials in fastlane env
run: echo "TEST_RUNNER_PIA_TEST_USER=${{ secrets.PIA_ACCOUNT_USERNAME}}"\n"TEST_RUNNER_PIA_TEST_PASSWORD=${{ secrets.PIA_ACCOUNT_PASSWORD }}" > fastlane/.env

- name: Check fastlane env
run: cat fastlane/.env

- name: Select XCode version
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Install dependencies
run: swift package resolve

- name: Run e2e tests with fastlane
run: bundle exec fastlane e2e_tests
continue-on-error: true

- name: Run tests
run: bundle exec fastlane tests


48 changes: 48 additions & 0 deletions .github/workflows/testflight_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: testflight_deploy
on:
push:
branches:
- master

workflow_dispatch:
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
jobs:
build:
runs-on: macos-latest
env:
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
KEYCHAIN_NAME: ${{ secrets.KEYCHAIN_NAME }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}

steps:
- name: Setup Git credentials
run: |
git config --global url."https://${{ secrets.ORG_GITHUB_USERNAME }}:${{ secrets.ORG_GITHUB_TOKEN }}@github.com/".insteadOf "[email protected]:"
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- name: Install Fastlane
run: gem install fastlane

- name: Decode Certificates
run: echo "${{ secrets.IOS_CERTIFICATE }}" | base64 --decode > ./fastlane/Certificate.p12

- name: Run tests
run: bundle exec fastlane tests

- name: Set up certificates and profiles
run: bundle exec fastlane get_profiles > /dev/null 2>&1

- name: Upload version to TestFlight
run: bundle exec fastlane testflight_build

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
409 changes: 281 additions & 128 deletions PIA VPN.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions PIA VPN.xcodeproj/xcshareddata/xcschemes/PIA VPN dev.xcscheme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -54,7 +54,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -64,6 +64,24 @@
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "PIA_TEST_USER"
value = "xxx"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "PIA_TEST_PASSWORD"
value = "xxx"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<TestPlans>
<TestPlanReference
reference = "container:PIA-VPN_E2E_Tests/PIA-VPN-e2e-simulator.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -76,12 +94,13 @@
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7EB8D11227CCF4C20030B060"
BuildableName = "PIA VPN UITests.xctest"
BlueprintName = "PIA VPN UITests"
BlueprintIdentifier = "69B70AAF2ACBF51C0072A09D"
BuildableName = "PIA-VPN_E2E_Tests.xctest"
BlueprintName = "PIA-VPN_E2E_Tests"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</TestableReference>
Expand Down
24 changes: 14 additions & 10 deletions PIA VPN.xcodeproj/xcshareddata/xcschemes/PIA VPN.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7EB8D11227CCF4C20030B060"
BuildableName = "PIA VPN UITests.xctest"
BlueprintName = "PIA VPN UITests"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand Down Expand Up @@ -75,16 +89,6 @@
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7EB8D11227CCF4C20030B060"
BuildableName = "PIA VPN UITests.xctest"
BlueprintName = "PIA VPN UITests"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
100 changes: 100 additions & 0 deletions PIA VPN.xcodeproj/xcshareddata/xcschemes/PIA-VPN_E2E_Tests.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "2.2">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<AutocreatedTestPlanReference>
</AutocreatedTestPlanReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:PIA-VPN_E2E_Tests/PIA-VPN-e2e-simulator.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "69B70AAF2ACBF51C0072A09D"
BuildableName = "PIA-VPN_E2E_Tests.xctest"
BlueprintName = "PIA-VPN_E2E_Tests"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "PIA_TEST_USER"
value = "xxx"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "PIA_TEST_PASSWORD"
value = "xxx"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
48 changes: 48 additions & 0 deletions PIA VPN/AccessibilityId.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

import Foundation

public struct AccessibilityId {
public struct VPNPermission {
public static let screen = "id.vpnPermission.screen"
public static let submit = "id.vpnPermission.ok.button"
}

public struct Dashboard {
public static let connectionButton = "id.dashboard.connection.button"
}

}


/// This is the same struct `Accessibility` from `PIALibrary`
/// It has been copied over to the VPN ios client app to
/// facilitate e2e testing.
/// In the future, we will move the Welcome and Login ViewControllers and storyboards from `PIALibrary` into vpn ios
/// And this duplication will not be necessary
public struct PIALibraryAccessibility {
public struct Id {
public struct Welcome {
public static let environment = "id.welcome.environment"
}
public struct Login {
public static let submit = "id.login.submit"
public static let submitNew = "id.login.submit.new"
public static let username = "id.login.username"
public static let password = "id.login.submit"
public struct Error {
public static let banner = "id.login.error.banner"
}
}

public struct Dashboard {
public static let menu = "id.dashboard.menu"
}
public struct Menu {
public static let logout = "id.menu.logout"
}
public struct Dialog {
public static let destructive = "id.dialog.destructive.button"
}
}
}

Loading

0 comments on commit 2e34107

Please sign in to comment.