//
// KIFTestStep.h
// KIF
//
// Created by Michael Thole on 5/20/11.
// Licensed to Square, Inc. under one or more contributor license agreements.
// See the LICENSE file distributed with this work for the terms under
// which Square, Inc. licenses this file to you.
#import <UIKit/UIKit.h>
/*!
@define KIFTestCondition
@abstract Tests a condition and returns a failure result if the condition isn't true.
@discussion This is a useful macro for quickly evaluating conditions in a test step. If the condition is false then the current test step will be aborted with a failure result.
@param condition The condition to test.
@param error The NSError object to put the error string into. May be nil, but should usually be the error parameter from the test step execution block.
@param ... A string describing what the failure was that occurred. This may be a format string with additional arguments.
*/
#define KIFTestCondition(condition, error, ...) ({ \
if (!(condition)) { \
if (error) { \
*error = [NSError errorWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:__VA_ARGS__], NSLocalizedDescriptionKey, nil]]; \
} \
[KIFTestStep stepFailed]; \
return KIFTestStepResultFailure; \
} \
})
/*!
@define KIFTestWaitCondition
@abstract Tests a condition and returns a wait result if the condition isn't true.
@discussion This is a useful macro for quickly evaluating conditions in a test step. If the condition is false then the current test step will be aborted with a wait result, indicating that it should be called again in the near future.
@param condition The condition to test.
@param error The NSError object to put the error string into. May be nil, but should usually be the error parameter from the test step execution block.
@param ... A string describing why the step needs to wait. This is important since this reason will be considered the cause of a timeout error if the step requires waiting for too long. This may be a format string with additional arguments.
*/
#define KIFTestWaitCondition(condition, error, ...) ({ \
if (!(condition)) { \
if (error) { \
*error = [[[NSError alloc] initWithDomain:@"KIFTest" code:KIFTestStepResultWait userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:__VA_ARGS__], NSLocalizedDescriptionKey, nil]] autorelease]; \
} \
return KIFTestStepResultWait; \
} \
})
/*!
@enum KIFTestStepResult
@abstract Result codes from a test step.
@constant KIFTestStepResultFailure The step failed and the test controller should move to the next scenario.
@constant KIFTestStepResultSuccess The step succeeded and the test controller should move to the next step in the current scenario.
@constant KIFTestStepResultWait The test isn't ready yet and should be tried again after a short delay.
*/
enum {
KIFTestStepResultFailure = 0,
KIFTestStepResultSuccess,
KIFTestStepResultWait,
};
typedef NSInteger KIFTestStepResult;
@class KIFTestStep;
/*!
@typedef KIFTestStepExecutionBlock
@param step The step object itself. This is passed back to the block to ensure that there is a pointer to the fully initialized step at the time of execution.
@param error An error to fill out in the case of a failure or wait condition. Filling out this error is mandatory in these cases to ensure that testing output is useful.
@result A test result code. Returning KIFTestStepResultWait will cause the step to be tried again on the next iteration.
*/
typedef KIFTestStepResult (^KIFTestStepExecutionBlock)(KIFTestStep *step, NSError **error);
/*!
@class KIFTestStep
@abstract A step in a testing sequence.
@discussion Steps are the most basic element of a test, and are added together to create the scenarios to be tested.
Steps are the building blocks of scenarios, and should be very simple. A number of useful factory steps are provided for mimicking basic user interaction. These steps leverage the built in accessibility of iOS to find and interact with views. As such, the accessibility inspector needs to be enabled under Settings in the simulator for them to work.
*/
@interface KIFTestStep : NSObject {
KIFTestStepExecutionBlock executionBlock;
NSString *description;
NSString *notificationName;
id notificationObject;
BOOL notificationOccurred;
BOOL observingForNotification;
NSTimeInterval timeout;
}
/*!
@property timeout
@abstract The amount of time to try the step before assuming that it failed.
@discussion The timeout comes into play if a step returns the KIFTestStepResultWait result. If the step returns this result such that the step has been called repeatedly for a time greater than the timeout, then the step is considered to have failed. Steps are assumed to be well-behaved, and the timeout will not interrupt a step if it is running synchronously for an extended period of time.
*/
@property (nonatomic) NSTimeInterval timeout;
/*!
@property description
@abstract A description of what the step does.
@discussion This is used to help describe what the test script is doing and where it may have failed.
*/
@property (nonatomic, retain) NSString *description;
/*!
@method defaultTimeout
@abstract The default amount of time to assign to new steps before assuming they failed.
@discussion To change the default value of the timeout property, either subclass KIFTestStep and override this method or call +setDefaultTimeout: with a different value.
*/
+ (NSTimeInterval)defaultTimeout;
/*!
@method setDefaultTimeout:
@abstract Sets the default amount of time to assign to new steps before assuming they failed.
@discussion To change the default value of the timeout property, either subclass KIFTestStep and override +defaultTimeout or call this method with a different value.
*/
+ (void)setDefaultTimeout:(NSTimeInterval)newDefaultTimeout;
/*!
@method stepWithDescription:executionBlock:
@abstract Convenience initializer to create a new custom step.
@param description A description of the what the step does. Required.
@param executionBlock A block to execute which performs the step. Required.
*/
+ (id)stepWithDescription:(NSString *)description executionBlock:(KIFTestStepExecutionBlock)executionBlock;
/*!
@method executeAndReturnError:
@abstract Run the execution block for the receiver.
@discussion This method should not usually be invoked directly. The test controller will handle invoking steps as needed.
@param error An error that can be returned if the step fails or needs to wait.
@result The result code for the result of executing the step.
*/
- (KIFTestStepResult)executeAndReturnError:(NSError **)error;
/*!
@method cleanUp:
@abstract Clean up any state and listeners once the step has completed.
@discussion For anything that needs to be removed at completion rather than dealloc
*/
- (void)cleanUp;
#pragma mark Factory Steps
/*!
@method stepThatFails
@abstract A step that always fails.
@discussion Mostly useful for test debugging or as a placeholder when building new tests.
@result A configured test step.
*/
+ (id)stepThatFails;
/*!
@method stepThatSucceeds
@abstract A step that always succeeds.
@discussion Mostly useful for test debugging or as a placeholder when building new tests.
@result A configured test step.
*/
+ (id)stepThatSucceeds;
/*!
@method stepToWaitForViewWithAccessibilityLabel:
@abstract A step that waits until a view or accessibility element is present.
@discussion The view or accessibility element with the given label is found in the view hierarchy. If the element isn't found, then the step will attempt to wait until it is. Note that the view does not necessarily have to be visible on the screen, and may be behind another view or offscreen. Views with their hidden property set to YES are ignored.
If the view you want to wait for is tappable, use the -stepToWaitForTappableViewWithAccessibilityLabel: methods in
没有合适的资源?快使用搜索试试~ 我知道了~
iOS游戏应用源代码——orta-WibbleQuest-95ebf9f.zip
共136个文件
h:60个
m:56个
xib:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 105 浏览量
2023-07-05
23:22:12
上传
评论
收藏 376KB ZIP 举报
温馨提示
iOS游戏应用源代码——orta-WibbleQuest-95ebf9f.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS游戏应用源代码——orta-WibbleQuest-95ebf9f.zip (136个子文件)
libKIF.a 556KB
style.css 591B
.gitattributes 29B
.gitignore 314B
.gitmodules 89B
KIFTestStep.h 24KB
KIFTestController.h 5KB
KIFTestScenario.h 5KB
Room.h 2KB
WibbleQuest.h 2KB
Player.h 2KB
Creature.h 1KB
WibbleObject.h 1KB
Inventory.h 943B
Item.h 927B
SettingsViewController.h 834B
WibbleQuestPrintingCategory.h 708B
WQ.h 651B
Person.h 644B
KIFTestScenario-NiceThings.h 577B
PlayerInventory.h 538B
LibWibble.h 534B
WibbleQuestAppDelegate.h 510B
Store.h 503B
GameViewController.h 497B
WibbleQuestViewHandlingCategory.h 462B
Game.h 454B
WQIOSAppDelegate.h 415B
CommandInterpreter.h 373B
KIFTestScenario-RoomCommands.h 340B
NSArray-Contains.h 318B
NSArray-named-captures.h 309B
MyGame.h 307B
KIFTestScenario-RunCommand.h 306B
KidA.h 298B
GameSelector.h 294B
Sound.h 291B
Snake.h 288B
KIFScenario-Helpers.h 286B
WibbleQuestSwipeHandlers.h 281B
WBTestController.h 280B
InventoryTests.h 268B
GoatBoy.h 256B
ShopTests.h 250B
RoomAPI.h 248B
BTPGame.h 247B
CreatureTests.h 247B
Walkthrough.h 229B
MegatronGame.h 221B
BodyGuard.h 218B
FloatstarPX.h 217B
RockShop.h 217B
StartingRoom.h 216B
libWibble.h 215B
FinaleRoom.h 212B
Microphone.h 212B
OpeningRoom.h 211B
SnakesRoom.h 209B
FoamSword.h 207B
KidB.h 205B
Keytar.h 204B
Bubba.h 198B
Flag.h 197B
OrtasRoom.h 191B
ExitRoom.h 189B
index.html 5KB
jquery.js 185KB
Wibble.license 1KB
CommandInterpreter.m 9KB
WibbleQuestViewHandlingCategory.m 6KB
WibbleQuest.m 5KB
Creature.m 4KB
BTPGame.m 4KB
MyGame.m 4KB
MegatronGame.m 4KB
Room.m 4KB
KidB.m 4KB
WQIOSAppDelegate.m 3KB
RoomAPI.m 3KB
GameViewController.m 3KB
SettingsViewController.m 3KB
InventoryTests.m 3KB
WibbleQuestPrintingCategory.m 2KB
BodyGuard.m 2KB
Player.m 2KB
KIFTestScenario-NiceThings.m 2KB
GoatBoy.m 2KB
FloatstarPX.m 2KB
KidA.m 2KB
Store.m 2KB
WibbleObject.m 2KB
Snake.m 2KB
ShopTests.m 2KB
Walkthrough.m 2KB
PlayerInventory.m 2KB
WQ.m 1KB
WibbleQuestSwipeHandlers.m 1KB
NSArray-Contains.m 1KB
Keytar.m 1020B
CreatureTests.m 1002B
共 136 条
- 1
- 2
资源评论
快乐无限出发
- 粉丝: 1135
- 资源: 7274
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 本科毕业设计基于C# wpf人脸识别的考勤系统的设计与实现源码.zip
- 基于Ruoyi+uniapp实现学生考勤系统 学生考勤源码+项目说明.zip
- feae6bc968ca68a099455d8b8a8dea35
- 基于Pytorch训练CIRAR10上分类算法.zip
- Pytorch-pytorch深度学习教程之Tensorboard.zip
- 基于C++和Python开发yolov8-face作为人脸检测器dlib作为人脸识别器的人脸考勤系统源码+项目说明.zip
- Pytorch-pytorch深度学习教程之变分自动编码器.zip
- Pytorch-pytorch深度学习教程之神经风格迁移.zip
- Pytorch-pytorch深度学习教程之深度残差网络.zip
- Pytorch-pytorch深度学习教程之循环神经网络.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功