I have a system that displays data it gets from API calls. There are multiple objects and every object has 7-8 properties. User is not allowed to change values and the system has a simple UI. I want to test that the correct data is represented in the UI. What should be the test strategy for this? I'm thinking of using Playwright framework.

What I have thought so far:

  1. For every test case

    • making api request
    • asserting response
    • checking the values in UI

    It doesn't seem ideal.

    • separating API tests
    • mocking API calls in UI testing

I don't know if it would give the confidence of real user experience.


  • separating API test
  • UI only test (without validating data)
  • applying no 1 for most important test cases

What is your suggestion?

  • I don't have much qa exp and company has limited resources so we want to focus on what could we do best. Sorry if i misuse terms.
    – archbtw
    Commented May 11, 2022 at 13:08

1 Answer 1


Testing mission:

I want to test the correct data is represented on UI

The target system is the UI, so, you have to explore two aspects:

1 - Does my UI integrate correctly with the service(s)? 2 - Given that (1) holds, is the UI displaying the data correctly?

(1) can be tackled with Contract Testing. In (2), you should have control over the inputs of your system (the UI), thus you can explore the data provided by the service(s) - this control comes from using test doubles, like mocks. Their acceptance tests and API documentation (e.g. OpenAPI) can be good source of ideas for what the services can provide.

  • Are you suggesting to test the UI and API server in seperation, with no integration tests at all?
    – Rsf
    Commented May 16, 2022 at 11:43
  • I've talked about integration tests in (1). Pact will be used to checked if the expectations of the consumer are satisfied by the provider - aka it will will be used to test their Integration Commented May 16, 2022 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.