Skip to content

Instantly share code, notes, and snippets.

@TeresaP
TeresaP / CalabashBackdoor.m
Last active June 24, 2020 06:12
Profdata Code Coverage
// Forward-declare LLVM (profdata) methods for usage below
// For documentation, see: http://clang.llvm.org/docs/SourceBasedCodeCoverage.html
int __llvm_profile_write_file(void);
void __llvm_profile_initialize_file(void);
void __llvm_profile_set_filename(const char *Name);
/**
* Generate profraw (profdata) code coverage
*/
- (BOOL)beginCodeCoverage:(NSString*)fullFilePath
@TeresaP
TeresaP / 01_launch.rb
Last active October 1, 2017 16:47
Code Coverage with Calabash
AfterConfiguration do |config|
CodeCoverage.clean_up_code_coverage_archive_folder
CodeCoverage.generate_lcov_baseline_info_file
end
Before do |scenario|
$calabash_launcher = Calabash::Cucumber::Launcher.launcher
CodeCoverage.clean_up_last_run_files
@TeresaP
TeresaP / merge-xml-coverage.py
Last active March 20, 2020 06:58 — forked from tgsoverly/merge-xml-coverage.py
Merge Cobertura XML's
import logging
import os
import re
import sys
import xml.etree.ElementTree as ET
from optparse import OptionParser
### This file came from the https://github.com/flow123d/flow123d repo they were nice enough to spend time to write this.
### It is copied here for other people to use on its own.
@TeresaP
TeresaP / alert.rb
Last active March 11, 2016 17:13
Allows users to interact with native alerts/dialogs using the Calabash test framework
#From https://github.com/jmoody/briar/blob/develop/lib/briar/alerts_and_sheets/alert_view.rb
#From https://github.com/jmoody/briar/blob/405aacf4e39cecaeca3da31c2503c62d4ef8bc8e/lib/briar/briar_core.rb
# Lets us interact with alerts/dialogs. Even native ones.
class Alert
extend Calabash::Cucumber::Operations
# Check to see if the alert is open
# @param [String] alert_id (Optional) Alert title/text to use in verification
@TeresaP
TeresaP / swipe_screen.rb
Last active August 29, 2015 14:06
swipe_screen
# Swipes on the screen with given direction
# @param [String] query_string (Optional) The custom query for the object to swipe on
# @param [Symbol] direction - direction to swipe :left, :right, :up, :down
def self.swipe_screen(direction, query_string='view')
view = query(query_string).first
centerY = view['rect']['center_y']
centerX = view['rect']['center_x']
height = view['rect']['height']
@TeresaP
TeresaP / CalabashBackdoor.h
Created April 4, 2014 16:49
Example for storing Calabash Backdoor functions outside of the Application Delegate
@interface CalabashBackdoor : NSObject
+(NSString *) backdoorMethodName:(NSString *)string;
@end