Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e4ab06a
Add appium installation step
fcvakintos Oct 19, 2021
c57538e
Add node package installation in appium dir
fcvakintos Oct 19, 2021
c6c0e80
add app for testing
acladima Oct 19, 2021
37ae634
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
acladima Oct 19, 2021
25d7f14
Add tests execution step
fcvakintos Oct 19, 2021
08363e6
add node-gyp
fcvakintos Oct 20, 2021
adca921
add node gyp
acladima Oct 20, 2021
309cc17
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
acladima Oct 20, 2021
5f0d7f0
remove node-gyp
fcvakintos Oct 20, 2021
db4989d
check node and npm versions
fcvakintos Oct 20, 2021
e129f71
move appium step
fcvakintos Oct 20, 2021
f522afa
add artifacts
fcvakintos Oct 20, 2021
a14db97
update artifact path
fcvakintos Oct 20, 2021
3208d2f
remove 2 specs
acladima Oct 20, 2021
29c55b4
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
acladima Oct 20, 2021
19a9618
Merge branch 'master' into feature/appium-semaphoreci
acladima Oct 20, 2021
ad4d678
add env file prologue
fcvakintos Oct 20, 2021
fd9b74c
change path to appium directory
fcvakintos Oct 20, 2021
f92c228
update node version
fcvakintos Oct 20, 2021
f63b455
remove app
fcvakintos Oct 20, 2021
06f6e9d
split test steps
fcvakintos Oct 20, 2021
2f7e575
add artifact for app file
fcvakintos Oct 20, 2021
6e345d6
remove artifact
fcvakintos Oct 20, 2021
c08c2db
generate_test_app
fcvakintos Oct 20, 2021
2fe0190
upd for fastlane
fcvakintos Oct 20, 2021
e7acf3b
push artifact for build
fcvakintos Oct 20, 2021
d49f986
rollback
fcvakintos Oct 20, 2021
46a3fe0
tasks cleanup
Oct 20, 2021
a0b421b
add build_e2e
acladima Oct 21, 2021
5621711
add build_e2e fastlane
fcvakintos Oct 21, 2021
e952245
fix build_e2e
acladima Oct 21, 2021
4ab6652
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
acladima Oct 21, 2021
9eedbe6
move app file
fcvakintos Oct 21, 2021
4106c90
fix build_e2e
acladima Oct 21, 2021
4899ce5
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
acladima Oct 21, 2021
1cd4158
fix build_e2e
acladima Oct 21, 2021
9dc6c09
fix build_e2e
fcvakintos Oct 21, 2021
c151f44
fix build_e2e
fcvakintos Oct 21, 2021
c567d14
fix build_e2e
fcvakintos Oct 21, 2021
cc3f21c
test format option
acladima Oct 22, 2021
4eb0851
remove app format
acladima Oct 22, 2021
f0f0b2c
enable unit tests
fcvakintos Oct 22, 2021
db0f9b2
change time, app path, gitignore
acladima Oct 22, 2021
bc026cb
change time
acladima Oct 22, 2021
3fd00d1
change path
fcvakintos Oct 22, 2021
db6da87
change directory for app
fcvakintos Oct 22, 2021
f27ca49
fix
fcvakintos Oct 22, 2021
85a5a58
push app to artifacts
fcvakintos Oct 22, 2021
00a09ab
Merge remote-tracking branch 'origin/feature/appium-semaphoreci' into…
fcvakintos Oct 22, 2021
c29e785
Merge branch 'master' into feature/appium-semaphoreci
fcvakintos Oct 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ appium/node_modules
appium/package-lock.json
appium/tmp
appium/.env
appium/apps
appium/FlowCrypt.app
53 changes: 17 additions & 36 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
version: v1.0
name: FlowCrypt iOS App

agent:
machine:
type: a1-standard-4
os_image: macos-xcode13

execution_time_limit:
minutes: 45

auto_cancel: # cancel running CI for older commits on same branch if new commits are added
minutes: 60
auto_cancel:
running:
when: "branch != 'master'"

when: branch != 'master'
blocks:

- name: Ubuntu iOS tests
execution_time_limit:
minutes: 10
minutes: 5
task:
agent:
machine:
Expand All @@ -33,21 +28,14 @@ blocks:
- checkout
- cd ~/git/flowcrypt-ios/
jobs:

- name: TypeScript - Core standalone tests
commands:
- sem-version node 12
- mkdir .custom-npm
- cd .custom-npm
- npm install npm@7.23.0
- cd ../Core
- ../.custom-npm/node_modules/.bin/npm --version
- sem-version node 12 && mkdir .custom-npm && cd .custom-npm && npm install npm@7.23.0 && cd ../Core
- ../.custom-npm/node_modules/.bin/npm install
- ../.custom-npm/node_modules/.bin/npm test

- name: Mac iOS tests
execution_time_limit:
minutes: 40
minutes: 55
task:
secrets:
- name: flowcrypt-ios-ci-secrets
Expand All @@ -64,24 +52,17 @@ blocks:
- make dependencies
- cache store
- mv ~/test-ci-secrets.json ~/git/flowcrypt-ios/FlowCryptUITests/test-ci-secrets.json
- mv ~/appium-env ~/git/flowcrypt-ios/appium/.env
jobs:

- name: 'Swift - FlowCryptTests'
- name: Swift tests + Appium tests
commands:
- bundle exec fastlane do_everything
# - bundle exec fastlane test_ui

# - name: 'Swift - FlowCryptTests(with email server)'
# commands:
# # telnet is used by check_email_server.sh
# - brew install telnet
# # point domain "mail" to IP of dev IMAP mailserver
# - sudo bash -c 'echo "217.163.30.119 mail" >> /etc/hosts'
# - cat /etc/hosts
# # mailserver runs on ports 10025, 10143
# # ports 10456, 10993 are not enabled yet
# - nc -zv 217.163.30.119 10025
# - nc -zv 217.163.30.119 10143
# - nc -zv mail 10025
# - nc -zv mail 10143
# - cd docker-mailserver/ && ./check_email_server.sh
- bundle exec fastlane build_e2e
- mv /var/tmp/Debug-iphonesimulator/FlowCrypt.app ~/git/flowcrypt-ios/appium
- sem-version node 12 && npm install -g appium@1.22.0 && cd ~/git/flowcrypt-ios/appium && npm i
- npm run ios.smoke
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should run all UI tests here, not just smoke, even if it's slow. At least it will force us to optimize / parallelize, in case. I'll file another issue.

epilogue:
on_fail:
commands:
- artifact push job ~/git/flowcrypt-ios/appium/tmp
- artifact push job ~/git/flowcrypt-ios/appium/FlowCrypt.app
2 changes: 1 addition & 1 deletion appium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Project to run Appium tests together with WebdriverIO for:

- iOS/Android Native Apps

## Before running tests, please create a `./apps` directory, download the app and move the app file into that directory
## Before running tests, please download the app and move the app file into appium directory

##Create .env file in appium root and set next variables in that file:
ACCOUNT_EMAIL=
Expand Down
11 changes: 3 additions & 8 deletions appium/config/wdio.ios.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@ config.suites = {
'./tests/specs/**/*.spec.ts'
],
smoke: [
'./tests/specs/login/GmailLogin.spec.ts',
'./tests/specs/inbox/ReadTextEmail.spec.ts',
'./tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts',
'./tests/specs/inbox/ReadEmailAfterRestartApp.spec.ts',
'./tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts',
'./tests/specs/settings/CheckSettingsForLoggedUser.spec.ts',
'./tests/specs/login/GmailLogin.spec.ts'
]
};

config.capabilities = [
{
platformName: 'iOS',
iosInstallPause: 5000,
deviceName: 'iPhone 11',
deviceName: 'iPhone 13',
platformVersion: '15.0',
automationName: 'XCUITest',
app: join(process.cwd(), './apps/FlowCrypt.app'),
app: join(process.cwd(), './FlowCrypt.app'),
newCommandTimeout: 10000,
wdaLaunchTimeout: 300000,
wdaConnectionTimeout: 600000,
Expand Down
1 change: 1 addition & 0 deletions appium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-wdio": "^6.6.0",
"node-fetch": "^2.6.1",
"node-gyp": "^8.3.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"webdriverio": "6.10.11"
Expand Down
29 changes: 20 additions & 9 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ platform :ios do
end

desc "Cocoapod update"
lane :cocoapod_update do
lane :cocoapod_update do
cocoapods(
try_repo_update_on_error: true
)
Expand All @@ -33,8 +33,8 @@ platform :ios do
workspace: "FlowCrypt.xcworkspace",
scheme: "FlowCryptUITests",
reinstall_app: true,
skip_build: true,
disable_slide_to_type: true,
skip_build: true,
disable_slide_to_type: true,
force_quit_simulator: false,
reset_simulator: true,
prelaunch_simulator: true,
Expand All @@ -51,8 +51,8 @@ platform :ios do
workspace: "FlowCrypt.xcworkspace",
scheme: "FlowCryptUITests",
reinstall_app: true,
skip_build: true,
disable_slide_to_type: true,
skip_build: true,
disable_slide_to_type: true,
force_quit_simulator: false,
reset_simulator: true,
prelaunch_simulator: true,
Expand All @@ -69,7 +69,7 @@ platform :ios do

# UnitTests
desc "Run Tests"
lane :unit_tests do
lane :unit_tests do
scan(
scheme: "FlowCryptAppTests",
skip_build: true
Expand All @@ -90,20 +90,31 @@ platform :ios do

end

desc "Debug Build for e2e testing"
lane :build_e2e do
xcbuild(
workspace: "FlowCrypt.xcworkspace",
scheme: "FlowCrypt",
configuration: "Debug",
xcargs: "-sdk iphonesimulator SYMROOT='/var/tmp/'"
)

end

desc "Record ui tests"
lane :record_tests do
reset_simulator
reset_simulator
sh("./record.sh")
end

desc "Build app, run tests, run UI test"
lane :do_everything do
lane :do_everything do
build
unit_tests
# test_ui_gmail
# test_ui_imap
# record_tests
end
end

end