From 4d357f1dc78e68d9d9a091f72d1c015bdc4ba6d7 Mon Sep 17 00:00:00 2001 From: YuJungin Date: Sun, 25 Mar 2018 16:01:00 +0900 Subject: [PATCH 1/2] add appium --- .../AppIcon.appiconset/Contents.json | 5 +++++ Undang/Base.lproj/Main.storyboard | 10 +++++----- Undang/MainVC.swift | 4 ++-- test_appium.py | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 test_appium.py diff --git a/Undang/Assets.xcassets/AppIcon.appiconset/Contents.json b/Undang/Assets.xcassets/AppIcon.appiconset/Contents.json index 1d060ed..d8db8d6 100644 --- a/Undang/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Undang/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -84,6 +84,11 @@ "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Undang/Base.lproj/Main.storyboard b/Undang/Base.lproj/Main.storyboard index 77912c0..64ea635 100644 --- a/Undang/Base.lproj/Main.storyboard +++ b/Undang/Base.lproj/Main.storyboard @@ -1,19 +1,19 @@ - + - + - + - + @@ -33,7 +33,7 @@ - + diff --git a/Undang/MainVC.swift b/Undang/MainVC.swift index f94906e..1646acb 100644 --- a/Undang/MainVC.swift +++ b/Undang/MainVC.swift @@ -19,8 +19,8 @@ class MainVC: UIViewController,UIWebViewDelegate { } func loadHTML(){ - let url = URL(string : "http://undang.twpower.me:6231/") - + let url = URL(string : "http://undang.twpower.me:6231/") + myWebView.addJavascriptInterface(JSInterface(viewController : self), forKey: "JSInterface"); myWebView.loadRequest(URLRequest(url: url!)) diff --git a/test_appium.py b/test_appium.py new file mode 100644 index 0000000..1da6203 --- /dev/null +++ b/test_appium.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +#iOS environment +import unittest +from appium import webdriver + +desired_caps = { + "platformName" : "iOS", + "platformVersion" : "11.2", + "deviceName" : "iPhone SE", + "app" : "/Users/Jungin/Library/Developer/Xcode/DerivedData/Undang-eyvfnkzjzmxlqebazqxtenjcakpn" +} + +def test_undang(): + driver = webdriver.Remote('http://0.0.0.0:4723/wd/hub',desired_caps) + driver.switch_to.context('WEBVIEW') + + assert '지금 한강은' in driver.page_source + driver.quit() From 7ccd5ddbae9744381516c0db07e3044621db9dbf Mon Sep 17 00:00:00 2001 From: YuJungin Date: Sun, 25 Mar 2018 16:03:27 +0900 Subject: [PATCH 2/2] excecute test func --- test_appium.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_appium.py b/test_appium.py index 1da6203..4b93517 100644 --- a/test_appium.py +++ b/test_appium.py @@ -16,3 +16,5 @@ def test_undang(): assert '지금 한강은' in driver.page_source driver.quit() + +test_undang()