Is it possible to call a testfunction from another Testcase with working XCTest Assertions ?
-(void)testExample {
XCUIApplication *app = [[XCUIApplication alloc] init];
TestLoginMethod *loginModule = [[TestLoginMethod alloc] init:app];
[loginModule testExampleLogin];
}
I want to write test modules for easy reuse or to call them in different order. But my XCTAssert in the called function is not aborting the test if it is false.
- (void)testExampleLogin
{
XCUIElement *passwordSecureTextField = app.secureTextFields[@"Passwordaadsfs"];
XCTAssertTrue([passwordSecureTextField exists]);
XCTAssertTrue([passwordSecureTextField isHittable]);
In the called function, the XCTAssertTrue is just skipped although this textfield doesn't exist.