Created
June 7, 2017 08:54
-
-
Save fuxx/f963455d3c1c9ec0d9597511e7ba3a5f to your computer and use it in GitHub Desktop.
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
// | |
// AppLinkDeviceOutputTests.swift | |
// C24Core | |
// | |
// Created by Stefan Mayer-Popp on 24.05.16. | |
// Copyright © 2016 CocoaPods. All rights reserved. | |
// | |
import XCTest | |
class AppLinkDeviceOutputTests: SafariAppLinkTests { | |
var deviceOutputTestpageURL: String = "http://xxx.check24.de/uitesting/deviceoutputtests.php" | |
override func setUp() { | |
super.setUp() | |
// Put setup code here. This method is called before the invocation of each test method in the class. | |
// In UI tests it is usually best to stop immediately when a failure occurs. | |
continueAfterFailure = false | |
} | |
override func tearDown() { | |
// Put teardown code here. This method is called after the invocation of each test method in the class. | |
super.tearDown() | |
} | |
func testDeviceOutputUnspecifiedAndDestinationPlugin() { | |
/* | |
* MARK: Test case - Test unspecified device output which opens the app | |
* and displays the given site in the correct plugin | |
* | |
* Test ensures that app does open the correct plugin | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
//Add demo plugin app link description | |
registerDemoPluginAppLinkDescription() | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=unspecified") | |
// Check that success page is shown | |
expect(.Exists, object: app.cells.containingType(.StaticText, identifier: "deviceOutput").staticTexts["Unspecified"], timeout: 2) | |
} | |
func testDeviceOutputPhoneAndDestinationPlugin() { | |
/* | |
* MARK: Test case - Test device output "app" which opens the app | |
* and displays the given site in the correct plugin | |
* | |
* Test ensures that app does open the correct plugin | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
//Add demo plugin app link description | |
registerDemoPluginAppLinkDescription() | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=app") | |
// Check that success page is shown | |
expect(.Exists, object: app.cells.containingType(.StaticText, identifier: "deviceOutput").staticTexts["Phone"], timeout: 2) | |
} | |
func testDeviceOutputPadAndDestinationPlugin() { | |
/* | |
* MARK: Test case - Test device output "tabletapp" which opens the app | |
* and displays the given site in the correct plugin | |
* | |
* Test ensures that app does open the correct plugin | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
//Add demo plugin app link description | |
registerDemoPluginAppLinkDescription() | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=tabletapp") | |
// Check that success page is shown | |
expect(.Exists, object: app.cells.containingType(.StaticText, identifier: "deviceOutput").staticTexts["Pad"], timeout: 2) | |
} | |
func testDeviceOutputUnspecifiedAndDestionationWebview() { | |
/* | |
* MARK: Test case - Test unspecified device output which opens the app | |
* and displays the given site in the main webview of the app | |
* | |
* Test ensures that app does open the app-test page in the main webview | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=unspecified") | |
// Check that success page is shown | |
XCTAssertNotNil(app.webViews.staticTexts["deviceoutput=unspecified"], "Wrong deviceoutput detected") | |
} | |
func testDeviceOutputPhoneAndDestionationWebview() { | |
/* | |
* MARK: Test case - Test device output "app" which opens the app | |
* and displays the given site in the main webview of the app | |
* | |
* Test ensures that app does open the app-test page in the main webview | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=app") | |
// Check that success page is shown | |
XCTAssertNotNil(app.webViews.staticTexts["deviceoutput=app"], "Wrong deviceoutput detected") | |
} | |
func testDeviceOutputPadAndDestionationWebview() { | |
/* | |
* MARK: Test case - Test device output "tabletapp" which opens the app | |
* and displays the given site in the main webview of the app | |
* | |
* Test ensures that app does open the app-test page in the main webview | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=tabletapp") | |
// Check that success page is shown | |
XCTAssertNotNil(app.webViews.staticTexts["deviceoutput=tabletapp"], "Wrong deviceoutput detected") | |
} | |
func testDeviceOutputDesktopAndDestinationSafari() { | |
/* | |
* MARK: Test case - Test device output "desktop" which opens the app | |
* and displays the given site in Safari | |
* | |
* Test ensures that app does open the app-test page in Safari | |
*/ | |
// Start app | |
launchApp([LaunchOptionArgument.Onboarding.NoOnboardingDialog]) | |
// Open safari and open the app-test web page | |
openCustomAppLink(forURLString: "\(deviceOutputTestpageURL)?deviceoutput=desktop") | |
// Check that success page is shown | |
XCTAssertNotNil(safariApp.staticTexts["deviceoutput=desktop"], "Wrong deviceoutput detected") | |
} | |
func registerDemoPluginAppLinkDescription() { | |
openDebugMenu() | |
let demoPluginAppLinkDescriptionCell = app.tables.cells.staticTexts["Add Demo Plugin AppLinkDescription"] | |
expect(.Exists, object: demoPluginAppLinkDescriptionCell, timeout: 5).tap() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment