0

I'm using Codeception to create api tests for some REST API's. I'm finding that the Page Objects are really helpful in writing my tests but should I be using another Codeception object?

For example, I'm putting User information (first name, last name, user ID ...) into a UsersPage Page Object class but it is bothering me that it is named Users Page when it is not representing a page. Is there another Codeception Object I should be using to represent reusable information I'm using in the tests?

Clutch
  • 7,404
  • 11
  • 45
  • 56

1 Answers1

1

I think your concern is reasonable, it's not good to use page object in your case here;

From your description, you want to pass information (namely data/fixture) to your test cases, so I would choose to use fixtures, namely test data, which goes into the _data folder in codeception, load them before tests run.

Jojodmo
  • 23,357
  • 13
  • 65
  • 107