PostgreSQL >= 10 does not generate WAL if there are no transactions
That must be because of commit 6ef2eba3f:


  Skip checkpoints, archiving on idle systems.
  
  Some background activity (like checkpoints, archive timeout, standby
  snapshots) is not supposed to happen on an idle system. Unfortunately
  so far it was not easy to determine when a system is idle, which
  defeated some of the attempts to avoid redundant activity on an idle
  system.


If you really need to have regular WAL activity, the cheapest way is to have a cron job that runs SELECT txid_current() regularly.

If you want to monitor replication, it is better to measure the lag in bytes, that is immune to this problem.