mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
Page:
How to run Unit Test
Pages
API with only HTTP scheme into callback URL
App Transport Security
Authenticate with Native Applications
Custom authentication headers
Demo application
How to run Unit Test
Instagram
Interpreting Error Codes
Logout
OAuth 2.0 Token Expiration
OAuth 2.0 Token Revocation
Objective C
Roadmap
Store credential
Uber
Work with application extension
No results
1
How to run Unit Test
You shall not pass edited this page 2015-12-31 11:06:56 +01:00
Table of Contents
The tests use third party framework.
Cocoapod must be installed to download the dependencies.
sudo gem install cocoapods
(close any xcode OAuthSwift project if opened) in OAuthSwift directory
pod install
open workspace OAuthSwift.xcworkspace (not project OAuthSwift.xcodeproj)
To launch test, choose scheme OAuthSwiftTests and do Menu:Product then Test (Command U)
Configure for ServicesTests (Work in progress)
Like Demo-application you must have configured your key and secret
To add a new service test
You must complete the configuration file ServicesTest.plist by
- adding a section, with all needed parameters and url if not already done
<key>Fitbit</key>
<dict>
<key>version</key>
<string>1</string>
<key>requestTokenUrl</key>
<string>https://api.fitbit.com/oauth/request_token</string>
<key>authorizeUrl</key>
<string>https://www.fitbit.com/oauth/authorize?display=touch</string>
<key>accessTokenUrl</key>
<string>https://api.fitbit.com/oauth/access_token</string>
<key>callbackURL</key>
<string>oauth-swift://oauth-callback/fitbit</string>
- adding into plist the javascript selector to find form element to login and then to authorise api
# for dropbox
<key>form_selector</key>
<string>form[id="login-form"]</string>
<key>form_button_selector</key>
<string>button[name="submit"]</string>
<key>form_username_selector</key>
<string>input[id="id_username"]</string>
<key>form_password_selector</key>
<string>input[id="id_password"]</string>
- adding into ServicesTests the test method
func testServiceName() {
testService("ServiceName")
}
PS: testBitBucket failed