1 Reply
      Latest reply on Aug 16, 2019 3:00 PM by wx2ios
      alinef Level 1 Level 1 (0 points)

        Hi all,

        I am new in XCUITest, and I am searching the best pattern to organize my test.

        I already read about Page Object and work with enumeration. But what is the best way?

        Are there examples?

         

        Many thanks!

        • Re: What is the best design pattern for XCUITest?
          wx2ios Level 1 Level 1 (0 points)

          First, understand the testing pyramid.

          in order of speed: unit tests, non ui integration tests, ui integration tests (XCUITest)

           

          Second,

          I would argue that using the PageObject design pattern is obsolete as far as XCUITest is concerned. Your xcuitest should probably just be doing a short tour of a feature's happy path, and not verifying button presence. You should only ever verify something if your test requires it to appear.

           

          Third,

          If you are concerned with validating that your buttons and views appear and work correctly you should be using Apple's new Swift Previews to ensure your application works: https://developer.apple.com/videos/play/wwdc2019/233/

          I strongly recommend watching this video as an Apple dev builds up an awesome UI validation tool for a view.