(depth, configure = true)
| 117 | await page.waitForSelector('[data-testid="atlas-chat-depth"]', { state: 'visible' }); |
| 118 | }; |
| 119 | const ask = async (depth, configure = true) => { |
| 120 | const before = await page.locator('[data-testid="atlas-chat-turn"]').count(); |
| 121 | if (configure) { |
| 122 | await activateChat(); |
| 123 | await page.locator(`[data-testid="atlas-chat-depth-option"][data-value="${depth}"]`).click(); |
| 124 | } |
| 125 | const input = page.locator('[data-testid="atlas-command-input"]'); |
| 126 | await input.fill('@getOrder what does it do?'); |
| 127 | await input.press('Enter'); |
| 128 | await page.waitForFunction((count) => { |
| 129 | const turns = [...document.querySelectorAll('[data-testid="atlas-chat-turn"]')]; |
| 130 | return turns.length > count && turns.at(-1)?.getAttribute('data-status') === 'answered'; |
| 131 | }, before, { timeout: 60000 }); |
| 132 | return page.locator('[data-testid="atlas-chat-turn"]').last(); |
| 133 | }; |
| 134 | const cardsOf = async (turn) => { |
| 135 | const toggle = turn.locator('[data-testid="atlas-chat-cards-toggle"]'); |
| 136 | if (await toggle.getAttribute('data-fold') === 'open') await toggle.click(); |
no test coverage detected