Opens a file of the project root (or below) in Explore by clicking its tree row.
(page, path)
| 614 | |
| 615 | /** Opens a file of the project root (or below) in Explore by clicking its tree row. */ |
| 616 | async function openTreeFile(page, path) { |
| 617 | const parts = path.split('/'); |
| 618 | for (let depth = 1; depth < parts.length; depth++) { |
| 619 | const row = page.locator(`.atlas-tree-row[data-path="${parts.slice(0, depth).join('/')}"]`).first(); |
| 620 | await row.waitFor({ timeout: 30000 }); |
| 621 | for (let attempt = 0; attempt < 4 && (await row.getAttribute('data-expanded')) !== 'true'; attempt++) { await row.click(); await wait(1200); } |
| 622 | } |
| 623 | const file = page.locator(`.atlas-tree-row[data-path="${path}"]`).first(); |
| 624 | if (!(await file.count())) return false; |
| 625 | await file.click(); |
| 626 | await wait(3500); |
| 627 | return true; |
| 628 | } |
| 629 | const cardButton = (page, name) => page.locator('.cbm-chat-explanation').getByRole('button', { name, exact: true }); |
| 630 | |
| 631 | async function k12(page) { |
no test coverage detected