Cypress runs inside browser and i believe you need to execute command to list topics of Kafka, which is outside the scope of browser. But cypress provides exec() command to execute anything in command line. Give this a read
https://docs.cypress.io/api/commands/exec