Skip to content

Instantly share code, notes, and snippets.

@wf-adamhei
Created February 6, 2021 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wf-adamhei/662d212d6bf0f52a0c62915e98db8a4d to your computer and use it in GitHub Desktop.
Save wf-adamhei/662d212d6bf0f52a0c62915e98db8a4d to your computer and use it in GitHub Desktop.
def getAllUITestClassNames() {
def allSwiftFiles = sh(
script: “find WealthfrontUITests -name ‘*.swift’”,
returnStdout: true
).trim().split(‘\n’) as String[]
def directory = pwd()
def allClassNames = []
allSwiftFiles.each {
def file = readFile “${directory}/${it}”
def matcher = (file =~ /(?<=class ).*?(?=:)/)
if (matcher.count > 0) {
allClassNames += matcher[0]
}
}
def testClassNames = allClassNames.findResults {
it.endsWith(“UITest”) || it.endsWith(“IntegrationTest”) ? it : null
}
return testClassNames
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment