There are quite some code samples on the Github wiki, I suggest you check them out.
It would look something like this (combined this and this):
// HTML<div powerbi-type="report" powerbi-report-id="5dac7a4a-4452-46b3-99f6-a25915e0fe55" powerbi-embed-url="https://app.powerbi.com/reportEmbed"></div> // JS var embedConfiguration = { type: 'report', id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55', embedUrl: 'https://app.powerbi.com/reportEmbed' }; var $reportContainer = $('#reportContainer'); var report = powerbi.embed($reportContainer.get(0), embedConfiguration); // Here we listen for the loaded event report.on('loaded', event => { // Here the reports are loaded, do something that can be detected by Selenium. $('#reportContainer').addClass('done-loading'); });