This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
merge ios automation to develop #171
Open
flaneuring
wants to merge
8
commits into
develop
Choose a base branch
from
ios_automation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
df06b62
Update automation scripts to reflect fix for bug #165199796
9cd49da
add appium installation to config.yml
9d03762
add appium install to package.json
32c76ed
modify config.yml
744ca58
modify config.yml
ea28829
move automation scripts to package.json
1e5df0f
modify test.py - ignore permissions pop-up
5261adc
fix test failure
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,12 @@ jobs: | |
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf | ||
- attach_workspace: | ||
at: ~/uport-mobile | ||
- run: | ||
name: Install appium server | ||
command: | | ||
npm install -g appium | ||
npm install wd | ||
pip install Appium-Python-Client | ||
- restore_cache: | ||
keys: | ||
- bundle-{{ arch }}-v4-ios-{{ checksum "Gemfile.lock" }} | ||
|
@@ -198,6 +204,17 @@ jobs: | |
- run: | ||
name: Fastlane | ||
command: cd ~/uport-mobile/ios && bundle exec fastlane buildTheApp | ||
- run: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. |
||
name: Build debug version of app | ||
command: | | ||
yarn global add react-native-cli | ||
yarn | ||
react-native run-ios | ||
- run: | ||
command: | | ||
./testsuites/terminal.scpt | ||
sleep 5 | ||
python testsuites/test.py | ||
- persist_to_workspace: | ||
root: ~/uport-mobile | ||
paths: | ||
|
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from os import getcwd, chdir | ||
import glob | ||
import os | ||
|
||
def select_element(driverinfo, elem): | ||
|
||
return driverinfo.find_element_by_id(elem) | ||
|
||
|
||
|
||
def find_uportapp(): | ||
folder = 'Debug-*' | ||
current_dir = os.path.abspath(os.path.dirname(__file__)) | ||
direct = os.path.join(os.path.abspath(current_dir + "/../../"),"ios", "build", "Build", "Products") | ||
saved = getcwd() | ||
chdir(direct) | ||
it = glob.glob(folder) | ||
chdir(saved) | ||
return (" ".join(it)) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
osascript -e 'tell app "Terminal" | ||
do script "appium" | ||
end tell' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from appium import webdriver | ||
from appium.webdriver.common.touch_action import TouchAction | ||
from support.common_methods import select_element, find_uportapp | ||
from os.path import expanduser | ||
|
||
import unittest | ||
import os | ||
import glob | ||
import shutil | ||
|
||
|
||
class identityTests(unittest.TestCase): | ||
|
||
def test_createIdentity(self): | ||
this_dir = os.path.abspath(os.path.dirname(__file__)) | ||
print this_dir + " **file directory" | ||
#uportapp = find_uportapp() | ||
desired_caps = {} | ||
desired_caps['platformName'] = 'iOS' | ||
desired_caps['platformVersion'] = '12.1' | ||
desired_caps['deviceName'] = 'iPhone XR' # Run on simulator | ||
cwd = os.getcwd() | ||
print cwd + " **current directory" | ||
current_dir = os.path.abspath(os.path.dirname(__file__)) | ||
desired_caps['app'] = os.path.join(os.path.abspath(current_dir + "/../"),"ios", "build", "uPortMobile", "Build", "Products", "Debug-iphonesimulator", "uPort.app") | ||
|
||
#desired_caps['fullReset'] = 'true' | ||
desired_caps['automationName'] = "XCUITest" | ||
self.wd = webdriver.Remote('http://0.0.0.0:4723/wd/hub', desired_caps) | ||
|
||
self.wd.implicitly_wait(10) | ||
#screenshot | ||
directory = '%s/' % os.getcwd() | ||
file_name = 'screenshot.png' | ||
self.wd.save_screenshot(directory + file_name) | ||
|
||
self.assertTrue(select_element(self.wd, "Dismiss All").is_displayed()) #dismiss | ||
select_element(self.wd, "Dismiss All").click() | ||
|
||
self.assertTrue(select_element(self.wd, "ONBOARDING_GET_STARTED").is_displayed()) #select onboarding | ||
select_element(self.wd, "ONBOARDING_GET_STARTED").click() | ||
|
||
self.assertTrue(select_element(self.wd, "ONBOARDING_LEARN_CONTINUE").is_displayed()) #select onboarding | ||
select_element(self.wd, "ONBOARDING_LEARN_CONTINUE").click() | ||
|
||
#type in uport user and press enter ("\n") | ||
self.wd.find_element_by_id("Enter name or username").send_keys('Sanaa'+"\n") | ||
|
||
self.wd.implicitly_wait(5) | ||
|
||
self.assertTrue(select_element(self.wd, "ONBOARDING_TERMS_RADIO").is_displayed()) #terms | ||
select_element(self.wd, "ONBOARDING_TERMS_RADIO").click() | ||
|
||
|
||
self.assertTrue(select_element(self.wd, "ONBOARDING_PRIVACY_RADIO").is_displayed()) #terms | ||
select_element(self.wd, "ONBOARDING_PRIVACY_RADIO").click() | ||
|
||
self.assertTrue(select_element(self.wd, "ONBOARDING_CREATE_IDENTITY").is_displayed()) #create identity | ||
select_element(self.wd, "ONBOARDING_CREATE_IDENTITY").click() | ||
|
||
|
||
# notifications permissions | ||
self.assertTrue(select_element(self.wd, "Allow").is_displayed()) | ||
select_element(self.wd, "Allow").click() | ||
|
||
#verify did is created | ||
#self.assertTrue(select_element(self.wd, "uPort ID ").is_displayed()) | ||
#select_element(self.wd, "uPort ID ").click() | ||
|
||
#self.assertTrue(select_element(self.wd, "DID did:ethr:0x6...").is_displayed()) | ||
#select_element(self.wd, "DID did:ethr:0x6...").click() | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a global package or local? If local, why isn't it in
package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m going to check if I can add installation of appium server to package.json
As for running tests locally, you have to install appium:
npm install -g appium
npm install wd
pip install Appium-Python-Client
Then launch appium in terminal by running “appium”
And in a separate terminal run the tests from repo “python testsuites/test.py”