0

We are planning on revamp for an old system. Also previously we haven't done any test automation tasks too. So my plan is to start the automation project earlier for the existing system and give a head start to by more time.

Since this is an revamp logic of the system wont change. Old system doesn't have any API's included. Therefore I'm planning on doing UI and DB testing. But with the delivering of revamp system I want to use this project to system as well as start API test automation too.

As I think it will become complicate if we maintain one project for UI,DB and API testing. Therefore I'm planning on three separate projects in order to maintain easily. Below image is a sketch of what I'm having in my mind at the moment.
enter image description here

So my questions are,
1) Is it ok to create three separate projects like this and user DB project in both UI and API project?

2) Is it a good practice to use one project in another?

3) How to user one project in another? EX : Calling DB project's test cases inside UI project. If a function save function is used in UI test case, using db test case we can check the saved data is in the database

Please share with me if there is any better solution or any reading material

  • 1
    Any reasons for having UI tests touch DB? You should mock out the backend/services calls in order to test UI isolation. – João Farias Jan 27 at 8:31
  • I'm trying to make a E2E using the both UI and DB without considering API. That's why i planned as this – Joe Jan 28 at 7:29
1

Old system doesn't have API - so one project would be E2E framwork with UI tests and then checking DB if everything was saved properly.

The newer system (the one with API) - also should have API tests and then checking if everything was saved properly in DB.

Answering to your questions:

  1. If DB is common for new and old system, it's pretty sensible to create three projects (UI, API and DB) and then use DB project in other two.
  2. Yes
  3. That depends on language. In C# I would create nuget package, and use it as dependency in other projects. In Java I would create .jar package and use it as dependency in other projects... And so on :)
  • Im using java. So it will be a jar. But I don't have any idea what should I include inside jar files. Could you please explain how and what should be included in jars? – Joe Jan 28 at 7:32
  • 1
    So I would create one project with maven and build .jar, which would be handling connection to DB and returning results of SQL queries by exposing public methods (for example: dB.getLastSavedItemInDB()). Then you can use it as external library by importing it to E2E and API tests project. How to do that is done it's explained here: stackoverflow.com/questions/4955635/… – Michal Dobrzycki Jan 28 at 13:40
1

Here is my answers ,Please correct me if i'm wrong.

1) Yes that would be great if you create 3 separate projects (If any given point if you need to run all the test cases in all 3 projects that can be done using a task scheduler or something similar way).

2) Yes, that's how you reduce your time and effort.

3) You need to create dll files for each project and import them to the relevant project you want and then you can call the exact test method you want.

  • Im using java. So it will be a jar. But I don't have any idea what should I include inside jar files. Could you please explain how and what should be included in jars? – Joe Jan 28 at 7:31
  • Why not to use a dependency manager, such as Gradle or Maven? – João Farias Jan 28 at 8:23
  • @Joe im not an expert on Java.So...if you are having issues with calling external jars on other projects please reffer some tutorials. – ChathuD Jan 28 at 15:20

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.