Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Praxistaugliches UI Testing

Praxistaugliches UI Testing

Peter Steinberger

October 03, 2016
Tweet

More Decks by Peter Steinberger

Other Decks in Technology

Transcript

  1. KIF

  2. - (void)tearDown { [super tearDown]; // Cancel all running render

    requests let renderQueue = PSPDFKit.renderManager.renderQueue; [renderQueue cancelAllJobs]; PSPDFTestWaitTrue(renderQueue.numberOfQueuedJobs == 0 &&
 renderQueue.numberOfRunningJobs == 0); } Aufräumen
  3. CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(NULL, kCFRunLoopBeforeWaiting, true, 0, beforeWaiting);
 CFRunLoopAddObserver(CFRunLoopGetCurrent(), observer,

    kCFRunLoopDefaultMode); CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, false); CFRunLoopRemoveObserver(CFRunLoopGetCurrent(), observer, kCFRunLoopDefaultMode); CFRelease(observer); Lauf-Schleife !
  4. void *handle = dlopen(@“/usr/lib/libAccessibility.dylib”, RTLD_LOCAL); 
 void (*_AXSSetAutomationEnabled)(int) = dlsym(handle,

    "_AXSSetAutomationEnabled"); 
 _AXSSetAutomationEnabled(YES); Zugänglichkeits Inspektor
  5. - (id)initAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window { if (self = [super init])

    { [self setTapCount:1]; [self setIsTap:YES]; [self setPhase:UITouchPhaseBegan]; [self setWindow:window]; [self _setLocationInWindow:point resetPrevious:YES]; [self setView:[window hitTest:point withEvent:nil]]; [self _setIsFirstTouchForView:YES]; [self setTimestamp:[[NSProcessInfo processInfo] systemUptime]]; } return self; } Druckpunkte bauen
  6. IOHIDEventRef IOHIDEventCreateDigitizerFingerEvent(CFAllocatorRef allocator, AbsoluteTime timeStamp, uint32_t index, uint32_t identity, IOHIDDigitizerEventMask

    eventMask, IOHIDFloat x, IOHIDFloat y, IOHIDFloat z, IOHIDFloat tipPressure, IOHIDFloat twist, Boolean range, Boolean touch, IOOptionBits options); Eingabegeräte Ereignisse
  7. struct rebinding rebindings[] = { {"dispatch_after", grey_dispatch_after, NULL}, {"dispatch_async", grey_dispatch_async,

    NULL}, {"dispatch_sync", grey_dispatch_sync, NULL}, {"dispatch_after_f", grey_dispatch_after_f, NULL}, {"dispatch_async_f", grey_dispatch_async_f, NULL}, {"dispatch_sync_f", grey_dispatch_sync_f, NULL}, }; rebind_symbols(rebindings, sizeof(rebindings) / sizeof(rebindings[0])); Angelhaken
  8. CI!