(page, config)
| 89 | } |
| 90 | |
| 91 | async function ensureAnalyticsLoaded(page, config) { |
| 92 | await page.goto(config.baseUrl, { waitUntil: 'domcontentloaded', timeout: 45000 }); |
| 93 | await page.waitForTimeout(1200); |
| 94 | |
| 95 | const hasLogin = await page.locator('#user, input[name="user"]').first().count(); |
| 96 | if (hasLogin) { |
| 97 | await page.locator('#user, input[name="user"]').first().fill(config.user); |
| 98 | await page.locator('#password, input[name="password"]').first().fill(config.pass); |
| 99 | await clickFirst(page, ['#submit-form', 'button[type="submit"]', 'input[type="submit"]'], 'login submit'); |
| 100 | } |
| 101 | |
| 102 | if (!page.url().includes('/apps/analytics')) { |
| 103 | await page.goto(config.baseUrl, { waitUntil: 'domcontentloaded', timeout: 45000 }); |
| 104 | } |
| 105 | await waitForIdle(page); |
| 106 | await dismissAnalyticsOnboarding(page); |
| 107 | await waitForIdle(page); |
| 108 | } |
| 109 | |
| 110 | async function dismissAnalyticsOnboarding(page) { |
| 111 | const splash = page.locator('#app-splash-screen').first(); |
no test coverage detected