Swift2 UI Test - Wait for Element to Appear

前端 未结 6 1254
逝去的感伤
逝去的感伤 2021-02-13 15:40

I want to have a test pause and wait for an element to appear on screen before proceeding.

I don\'t see a good way to create an expectation for this and wait using

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 16:33

    It doesn't take an already existing element. You just need to define the following predicate:

    let exists = NSPredicate(format: "exists = 1")

    Then just use this predicate in your expectation. Then of course wait on your expectation.

提交回复
热议问题