bank-name-debug.spec.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { test, expect } from '@playwright/test';
  2. test('调试银行名称管理页面', async ({ page }) => {
  3. console.log('导航到银行名称管理页面...');
  4. await page.goto('http://localhost:8080/admin/bank-names');
  5. // 等待页面加载
  6. await page.waitForTimeout(3000);
  7. // 截图查看页面
  8. await page.screenshot({ path: '/mnt/code/188-179-template-6/test-results/bank-page-debug.png', fullPage: true });
  9. console.log('已保存截图: test-results/bank-page-debug.png');
  10. // 获取页面HTML
  11. const bodyText = await page.locator('body').textContent();
  12. console.log('页面内容预览:', bodyText?.substring(0, 500));
  13. // 查找所有select元素
  14. const selects = page.locator('select');
  15. const selectCount = await selects.count();
  16. console.log('找到的select元素数量:', selectCount);
  17. for (let i = 0; i < selectCount; i++) {
  18. const select = selects.nth(i);
  19. const options = await select.locator('option').allTextContents();
  20. console.log(`Select ${i} 选项:`, options);
  21. }
  22. // 查找表格
  23. const tables = page.locator('table');
  24. const tableCount = await tables.count();
  25. console.log('找到的table元素数量:', tableCount);
  26. if (tableCount > 0) {
  27. const rows = await tables.first().locator('tr').count();
  28. console.log('第一个表格的行数:', rows);
  29. }
  30. });