0

I have a system that display 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 the correct data is represented on UI. What should be the test strategy for this? I'm thinking of using Playwright framework.

What I have think so far:

1) for every test case

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

it doesn't seem ideal.

2)

  • seperating api tests
  • mocking api calls in UI testing

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

3)

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

what is your suggestion?

1
  • 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
    May 11 at 13:08

1 Answer 1

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.

2
  • Are you suggesting to test the UI and API server in seperation, with no integration tests at all?
    – Rsf
    May 16 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 May 16 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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