FMCPlanner2/FMC Planner 2UITests/FMC_Planner_2UITests.m
2016-04-17 21:46:21 +02:00

174 lines
4.5 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// FMC_Planner_2UITests.m
// FMC Planner 2UITests
//
// Created by Kilian Hofmann on 19.03.16.
// Copyright © 2016 Kilian Hofmann. All rights reserved.
//
#import <XCTest/XCTest.h>
@interface FMC_Planner_2UITests : XCTestCase
@end
@implementation FMC_Planner_2UITests
- (void)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.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup
// will make sure it happens for each test method.
[[[XCUIApplication alloc] init] launch];
// In UI tests its important to set the initial state - such as interface
// orientation - required for your tests before they run. The setUp method
// is a good place to do this.
}
- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of
// each test method in the class.
[super tearDown];
}
- (void)test
{
XCUIApplication *app = [[XCUIApplication alloc] init];
XCUIElement *tButton = app.buttons[@"T"];
[tButton tap];
XCUIElement *eButton = app.buttons[@"E"];
[eButton tap];
[app.buttons[@"S"] tap];
[tButton tap];
XCUIElement *element =
[[[[[[app childrenMatchingType:XCUIElementTypeWindow]
elementBoundByIndex:0]
childrenMatchingType:XCUIElementTypeOther]
.element childrenMatchingType:XCUIElementTypeOther]
elementBoundByIndex:1] childrenMatchingType:XCUIElementTypeOther]
.element;
XCUIElement *staticText = [[element
childrenMatchingType:XCUIElementTypeStaticText] elementBoundByIndex:4];
[staticText tap];
[app.sheets[@"Load or replace?"].collectionViews.buttons[@"Replace"] tap];
[eButton tap];
XCUIElement *dButton = app.buttons[@"D"];
[dButton tap];
[dButton tap];
[app.buttons[@"F"] tap];
XCUIElement *staticText2 = [[element
childrenMatchingType:XCUIElementTypeStaticText] elementBoundByIndex:3];
[staticText2 tap];
[eButton tap];
[dButton tap];
[dButton tap];
XCUIElement *mButton = app.buttons[@"M"];
[mButton tap];
XCUIElement *staticText3 = [[element
childrenMatchingType:XCUIElementTypeStaticText] elementBoundByIndex:7];
[staticText3 tap];
XCUIElement *rTEButton = app.buttons[@"R T E"];
[rTEButton tap];
[dButton tap];
[app.buttons[@"K"] tap];
XCUIElement *bButton = app.buttons[@"B"];
[bButton tap];
[staticText tap];
[tButton tap];
XCUIElement *numButton = app.buttons[@"NUM"];
[numButton tap];
XCUIElement *button = app.buttons[@"1"];
[button tap];
XCUIElement *button2 = app.buttons[@"0"];
[button2 tap];
XCUIElement *button3 = app.buttons[@"4"];
[button3 tap];
[staticText3 tap];
[app.buttons[@"LET"] tap];
[bButton tap];
[app.buttons[@"U"] tap];
[app.buttons[@"R"] tap];
[app.buttons[@"A"] tap];
[mButton tap];
XCUIElement *staticText4 = [[element
childrenMatchingType:XCUIElementTypeStaticText] elementBoundByIndex:8];
[staticText4 tap];
XCUIElement *pERFButton = app.buttons[@"P E R F"];
[pERFButton tap];
[numButton tap];
XCUIElement *button4 = app.buttons[@"5"];
[button4 tap];
XCUIElement *button5 = app.buttons[@"."];
[button5 tap];
[button2 tap];
[staticText2 tap];
[button3 tap];
XCUIElement *button6 = app.buttons[@"6"];
[button6 tap];
[button5 tap];
XCUIElement *button7 = app.buttons[@"2"];
[button7 tap];
[staticText3 tap];
[button4 tap];
[button5 tap];
[button2 tap];
[[[element childrenMatchingType:XCUIElementTypeStaticText]
elementBoundByIndex:11] tap];
[button4 tap];
[button tap];
[button5 tap];
[button7 tap];
[app.staticTexts[@"46.2"] tap];
[button4 tap];
[button6 tap];
[button5 tap];
[button7 tap];
[[[element childrenMatchingType:XCUIElementTypeStaticText]
elementBoundByIndex:15] tap];
[app.buttons[@"8"] tap];
[button4 tap];
[app.staticTexts[@"COST INDEX"] tap];
[app.staticTexts[@"FLIGHT LVL"] tap];
[staticText tap];
[button7 tap];
[button4 tap];
[button2 tap];
[staticText4 tap];
[button4 tap];
[[[element childrenMatchingType:XCUIElementTypeStaticText]
elementBoundByIndex:12] tap];
XCUIElement *mENUButton = app.buttons[@"M E N U"];
[mENUButton tap];
}
@end