CombineGridTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Tests\Feature;
  3. use Tests\TestCase;
  4. class CombineGridTest extends TestCase
  5. {
  6. protected $login = true;
  7. public function test()
  8. {
  9. $this->visit('admin/tests/report')
  10. ->assertResponseStatus(200)
  11. ->see('报表')
  12. ->see('avgMonthCost')
  13. ->see('avgVist')
  14. ->see('avgCost')
  15. ->see('top');
  16. // Column::help
  17. $this->assertCount(1, $this->crawler()->filter('th a i[class*=fa-question-circle]'));
  18. $this->assertCount(2, $this->crawler()->filter('thead tr'));
  19. $firstTr = $this->crawler()->filter('thead tr')->first()->filter('th');
  20. // cost
  21. $this->assertEquals("2", (string) $firstTr->eq(2)->attr('rowspan'));
  22. // avgCost
  23. $this->assertEquals("3", (string) $firstTr->eq(3)->attr('colspan'));
  24. // avgVist
  25. $this->assertEquals("3", (string) $firstTr->eq(4)->attr('colspan'));
  26. // top
  27. $this->assertEquals("3", (string) $firstTr->eq(5)->attr('colspan'));
  28. }
  29. }