Skip to content

Instantly share code, notes, and snippets.

View testableapple's full-sized avatar

Alexey Alter-Pesotskiy testableapple

View GitHub Profile
Command Description
ios cookies get Show app's cookies
ios keychain dump Show app's keychain
ios nsurlcredentialstorage dump Show nsurlcredentialstorage data
ios ui dump Show current app's screen hierarchy
ios bundles list_frameworks Show app's frameworks list
ios plist cat Show content of chosen plist file
sqlite connect Show content of chosen DB file
name: Sample
on: [pull_request]
jobs:
sample:
name: Tests
runs-on: [macos-latest]
steps:
- uses: actions/checkout@v2
require 'json'
impact_map = JSON.parse(File.read('impact_map.json'))
response = JSON.parse(`curl -s -H "authorization: Bearer #{ENV['GITHUB_TOKEN']}" -X GET -G #{ENV['PULL_REQUEST']}/files`)
impacted_files = response.map { |file| file['filename'] }
impact_map.select! do |test, related_source_files|
related_source_files.any? { |file| impacted_files.include?(file) }
end
{
"SampleSuite/SampleClass/testMethod_1": [
"path/to/a.swift",
"path/to/b.swift",
"path/to/c.swift"
],
"SampleSuite/SampleClass/testMethod_2": [
"path/to/c.swift",
"path/to/d.swift",
"path/to/e.swift"
name: Sample
on: [pull_request]
jobs:
first_project:
name: FirstProjectTests
runs-on: [macos-latest]
steps:
- uses: actions/checkout@v2
require 'json'
required_keys = ENV['TRIGGER'].split(',').map { |key| key.strip }
ignored_keys = ENV['IGNORE'].nil? ? [] : ENV['IGNORE'].split(',').map { |key| key.strip }
response = JSON.parse(`curl -s -H "authorization: Bearer #{ENV['GITHUB_TOKEN']}" -X GET -G #{ENV['PULL_REQUEST']}/files`)
impacted_files = response.map { |file| file['filename'] }
impacted_files.select! do |path|
required_keys.any? do |required_key|
should_key_be_considered = ignored_keys.none? { |key| path.include?(key) }
should_key_be_considered && path.include?(required_key)
@Test
fun whenViewWillAppear() {
val viewMatcher = ViewMatchers.withId(R.id.sample_view_id)
Espresso.onView(viewMatcher)
.waitForAppear()
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
}
@Test
fun whenViewWillDisappear() {
fun ViewInteraction.isDisplayed(): Boolean {
try {
this.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
} catch (ignored: NoMatchingViewException) {
return false
}
return true
}
fun ViewInteraction.doesNotExist(): Boolean {
@Test
fun sample() {
recyclerViewCounter(R.id.recyclerViewId) {
val fab = withId(R.id.fab)
val firstFabPosition = getFirstMatchingPosition(fab)
onView(getView(firstFabPosition)).perform(click())
val lastFabPosition = getLastMatchingPosition(fab)
onView(getView(lastFabPosition)).perform(click())
@Test
fun sample() {
val fab = withId(R.id.fab)
onView(ViewCounter.first(fab)).perform(click())
onView(ViewCounter.last(fab)).perform(click())
onView(isRoot()).check(matches(ViewCounter.withViewCount(fab, 3))
}