Some games do not support gamepad vibration. It depends on the specific game title.
If the gamepad vibration is not working during gaming, then it does not mean the gamepad is faulty. Check the game description to see if it supports vibration.
Since vibration works with the test button, the most likely reason for your issue is that the game doesn't support vibration.