Generic approach to iOS UI Tests in Swift
Krzysztof Kempa
101

Hi @Krzysztof Kempa!

Thanks for sharing your experience with Swift / KIF and IOS automation tests.

I have a doubt about your tests. I think it's simple, but I don't know how to deal with that.

I'm trying to implement this model in my own project (it's a simple app for study swift and mobile test automation).

This is my Page.swift


protocol Page {
var test: BaseTest! {get set}
var pageIdentifier: String {get}
init()
init(test: BaseTest)
}
extension Page {
init(test: BaseTest) {
self.init()
self.test = test
waitForView()
}
func waitForView() {
tester.waitForView(withAccessibilityLabel: pageIdentifier)
}
var tester: KIFUITestActor {
return test.tester
}
}

When I try to run the tests, shows these errors:

  • "use of undeclared type BaseTest"
  • "use of undeclared type KIFUITestActor"

I'm very glad if you can help me with this.

Regards,

Jess

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.