Skip to content

Instantly share code, notes, and snippets.

View thecb4's full-sized avatar
🏳️‍🌈
All the things

thecb4 thecb4

🏳️‍🌈
All the things
View GitHub Profile
@thecb4
thecb4 / docker-compose.yml
Last active February 13, 2021 13:27
Swift for Vault
version: '3.8'
services:
vault:
image: vault
container_name: vault
environment:
VAULT_API_ADDR: 'http://0.0.0.0:8302'
ports:
- "8302:8302"
restart: always
@thecb4
thecb4 / ApplicationState.swift
Created January 2, 2019 21:15
ApplicationState protocol for XCUITest
typealias ApplicationState = XCTNSPredicateExpectation
protocol UIElement {
var existance: ApplicationState { get }
}
extension XCUIElement: UIElement {
var existance: ApplicationState {
let state = NSPredicate(format: "exists == true")
return ApplicationState(predicate: state, object: self)
}
}
@thecb4
thecb4 / extensionXCUIApplicationApplication.swift
Created January 2, 2019 21:13
Extend XCUIApplication with Application protocol
extension XCUIApplication: Application {
static var app: Application {
return XCUIApplication()
}
var movieTable: UIElement {
return self.tables.staticTexts["New Releases"]
}
@thecb4
thecb4 / protocolUIElementApplication.swift
Last active January 2, 2019 21:13
UIElement protocol to abstract away XCUIElement to align with app behavior
protocol UIElement {
var existance: ApplicationState { get }
}
protocol Application {
static var app: Application { get }
var searchBar: UIElement { get }
var movieTable: UIElement { get }
func movie(titled: String) -> UIElement
@thecb4
thecb4 / extension XCUIApplicationUserBehavior.swift
Created January 2, 2019 21:11
Extend XCUIApplication with UserBehavior protocol
extension XCUIApplication: UserBehavior {
static var user: UserBehavior {
return XCUIApplication()
}
func wait(_ timeout: TimeInterval, for states: [ApplicationState]) {
let state = XCTWaiter.wait(for: states, timeout: timeout)
switch state {
case .completed:
@thecb4
thecb4 / protocolUserBehavior.swift
Created January 2, 2019 21:09
Protocol for User Behavior in UITest
protocol UserBehavior: class {
static var user: UserBehavior { get }
func launch()
func login()
func swipeToShowSearch()
func search(for text: String)
func select(_ text: String)
func wait(_ timeout: TimeInterval, for states: ApplicationState…)
@thecb4
thecb4 / testSelectThor.swift
Created January 2, 2019 21:07
testSelectThor
func testSelectThor() {
let movieTitle = "Thor"
let user = Scenario.user
let app = Scenario.app
user.login()
@thecb4
thecb4 / beak.swift
Created May 20, 2018 04:42
Beak File for managing DevOps process ... brittle replacement for Fastlane
// beak: JohnSundell/ShellOut @ 2.1.0
/*
Copyright 2018 The CB4 (Cavelle Benjamin)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@thecb4
thecb4 / get-latest-tag-on-git.sh
Created March 8, 2018 21:04 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
---
folder:
name: "Project"
folderItems:
- folder:
name: "Framework"
folderItems:
- folder:
name: "Sources"
folderItems: