Question

I'm testing iOS application by using the automation framework named "Frank"

And there were some alert popped up in my application I need to cover.

I've wrote my feature file as below:

Scenario:
    I input wrong username and password, I should see the log failed alert.
...

    When I wait to see "Log failed"
    Then I touch the button marked "OK"

Unfortunately, this code won't work, although frank(cucumber) will mark the test step of touch "OK" button as Pass, but actually, the button won't be touched.

I have to do it like this:

Scenario:
    I input wrong username and password, I should see the log failed alert.
...

    When I wait to see "Log failed"
    #Wait for 1 sec in order to touch the button.
    And I wait for 1 second

    Then I touch the button marked "OK"
Was it helpful?

Solution

The comment above is probably correct - as for a different (better?) solution - depending on how comfortable you are with ruby, you could write your own step definition? Frank provides you the

Frank::Cucumber::WaitHelper.wait_until

method, which you could wrap around your touch the button code, to give you a longer implicit wait on the element. See here for some documentation: https://github.com/moredip/Frank/blob/master/gem/lib/frank-cucumber/wait_helper.rb

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top