Skip to content

Instantly share code, notes, and snippets.

View pilot34's full-sized avatar

Gleb pilot34

  • Booking.com
  • Amsterdam
View GitHub Profile
Mighty Rhymes Privacy Policy
We take privacy seriously. Please read our policy below and let us know if you have any questions or feedback.
What this privacy policy covers
This Privacy Policy concerns the apps developed by Raketamedia.
Политика конфиденциальности для "Читалок"
Мы относимся к частной жизни серьезно. Пожалуйста, прочитайте нашу политику ниже и дайте нам знать, если у вас есть какие-либо вопросы или пожелания.
Что это приватность политика охватывает
Эта политика конфиденциальности касается приложений, разработанных Raketamedia.
Политика конфиденциальности для "Читалок"
Мы относимся к частной жизни серьезно. Пожалуйста, прочитайте нашу политику ниже и дайте нам знать, если у вас есть какие-либо вопросы или пожелания.
Что это приватность политика охватывает
Эта политика конфиденциальности касается приложений, разработанных Raketamedia.
@pilot34
pilot34 / RMStore.podspec
Last active December 28, 2017 16:51
RMStore.podspec
Pod::Spec.new do |s|
s.name = 'RMStore'
s.version = '0.7.3'
s.license = 'Apache 2.0'
s.summary = 'A lightweight iOS library for In-App Purchases that adds blocks and notifications to StoreKit, plus verification, persistence and downloads.'
s.homepage = 'https://github.com/robotmedia/RMStore'
s.author = 'Hermes Pique'
s.social_media_url = 'https://twitter.com/hpique'
s.source = { :git => 'https://github.com/Wattpad/RMStore.git' }
s.platform = :ios, '7.0'
@pilot34
pilot34 / Fastfile.rb
Last active January 29, 2020 17:37
CircleCI 2.0 iOS Signing without Match
private_lane :prepare_certificates do |options|
sh("base64 -D -o Certificates.p12 <<< \"#{ENV['APPLE_CERTIFICATE']}\"", log: false)
create_keychain(
name: "default_keychain",
default_keychain: true,
unlock: true,
password: "default"
)
import_certificate(
certificate_path: "fastlane/Certificates.p12",
func wait(forWebViewElement element: XCUIElementTypeQueryProvider, timeout: TimeInterval = 20) {
// xcode has bug, so we cannot directly access webViews XCUIElements
// as a workaround we can check debugDesciption and parse it, that works
let predicate = NSPredicate { obj, _ in
guard let el = obj as? XCUIElement else {
return false
}
// If element has firstMatch, than there will be description of that at the end
// If no match - it will be ended with "FirstMatch\n"
return !el.firstMatch.debugDescription.hasSuffix("First Match\n")
private func coordinate(forWebViewElement element: XCUIElement) -> XCUICoordinate? {
// wait for element to appear before searching
wait(forWebViewElement: element)
// parse description to find its frame
let descr = element.firstMatch.debugDescription
guard let rangeOpen = descr.range(of: "{{", options: [.backwards]),
let rangeClose = descr.range(of: "}}", options: [.backwards]) else {
return nil
}
func typeText(_ text: String, toWebViewField element: XCUIElement) {
// xcode has bug, so we cannot directly access webViews XCUIElements
// as workaround we can check debugDesciption, find frame, tap by coordinate,
// and then paste text there
guard let coordBeforeTap = coordinate(forWebViewElement: element) else {
XCTFail("no element \(element)")
return
}
// "typeText" doesn't work, so we paste text
// first tap to activate field
//
// UITestCase.swift
//
// Created by Gleb Tarasov on 23/04/2018.
//
import Foundation
import XCTest
import UIKit