-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from LowerRockLabs/develop
Develop
- Loading branch information
Showing
4 changed files
with
224 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
namespace LowerRockLabs\LaravelLivewireTablesAdvancedFilters\Tests\Dusk\Web; | ||
|
||
use Laravel\Dusk\Browser; | ||
use LowerRockLabs\LaravelLivewireTablesAdvancedFilters\Tests\Dusk\DuskTestCase; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
|
||
final class DateRangeTest extends DuskTestCase | ||
{ | ||
public static function urlProvider(): array | ||
{ | ||
return [ | ||
'TW2' => [ | ||
'/tailwind', | ||
], | ||
'TW2-slidedown' => [ | ||
'/tailwind-slidedown', | ||
], | ||
'TW3' => [ | ||
'/tailwind3', | ||
], | ||
'TW3-slidedown' => [ | ||
'/tailwind3-slidedown', | ||
], | ||
'BS4' => [ | ||
'/bootstrap-4', | ||
], | ||
'BS4-slidedown' => [ | ||
'/bootstrap-4-slidedown', | ||
], | ||
|
||
'BS5' => [ | ||
'/bootstrap-5', | ||
], | ||
'BS5-slidedown' => [ | ||
'/bootstrap-5-slidedown', | ||
], | ||
|
||
]; | ||
} | ||
|
||
/** | ||
* testDatepickerFilterOpens | ||
*/ | ||
#[DataProvider('urlProvider')] | ||
public function testDaterangeFilterOpens($baseURL): void | ||
{ | ||
$this->browse(function (Browser $browser) use ($baseURL) { | ||
$browser->visit($baseURL); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("dateRange_" . trim($baseURL, '//') . "_1_Initial_Load_" . date('Y-m-d H')); | ||
|
||
$browser->press('@filtBtn'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("dateRange_" . trim($baseURL, '//') . "_2_Clicked_Filter_Button_" . date('Y-m-d H')); | ||
|
||
$browser->assertDontSee('Wed'); | ||
|
||
$browser->click('#users2-filter-e_mail_verified_range'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("dateRange_" . trim($baseURL, '//') . "_3_opened_Flatpickr_" . date('Y-m-d H')); | ||
|
||
$browser->assertSee('Sun')->assertSee('Mon')->assertSee('Tue')->assertSee('Wed')->assertSee('Thu')->assertSee('Fri')->assertSee('Sat')->assertSee('28')->assertSee('15')->assertSee('1')->assertSee('7')->assertSee('25')->assertSee(date('F')); | ||
|
||
$browser->assertVisible('div.flatpickr-calendar.animate.arrowBottom.arrowLeft.open > div.flatpickr-innerContainer > div > div.flatpickr-days > div > span:nth-child(10)'); | ||
|
||
$firstDate = $browser->attribute('div.flatpickr-calendar.animate.arrowBottom.arrowLeft.open > div.flatpickr-innerContainer > div > div.flatpickr-days > div > span:nth-child(10)', 'aria-label'); | ||
|
||
$secondDate = $browser->attribute('div.flatpickr-calendar.animate.arrowBottom.arrowLeft.open > div.flatpickr-innerContainer > div > div.flatpickr-days > div > span:nth-child(15)', 'aria-label'); | ||
|
||
$browser->click('div.flatpickr-calendar.animate.arrowBottom.arrowLeft.open > div.flatpickr-innerContainer > div > div.flatpickr-days > div > span:nth-child(10)'); | ||
|
||
$browser->click('div.flatpickr-calendar.animate.arrowBottom.arrowLeft.open > div.flatpickr-innerContainer > div > div.flatpickr-days > div > span:nth-child(15)'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("dateRange_" . trim($baseURL, '//') . "_4_Selected_Dates_" . date('Y-m-d H')); | ||
|
||
$browser->press('@filtBtn'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->assertSee($firstDate)->assertSee($secondDate); | ||
|
||
$browser->screenshot("dateRange_" . trim($baseURL, '//') . "_5_Final_Check_" . date('Y-m-d H')); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
namespace LowerRockLabs\LaravelLivewireTablesAdvancedFilters\Tests\Dusk\Web; | ||
|
||
use Laravel\Dusk\Browser; | ||
use LowerRockLabs\LaravelLivewireTablesAdvancedFilters\Tests\Dusk\DuskTestCase; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
|
||
final class NumberRangeTest extends DuskTestCase | ||
{ | ||
public static function urlProvider(): array | ||
{ | ||
return [ | ||
'TW2' => [ | ||
'/tailwind', | ||
], | ||
'TW2-slidedown' => [ | ||
'/tailwind-slidedown', | ||
], | ||
'TW3' => [ | ||
'/tailwind3', | ||
], | ||
'TW3-slidedown' => [ | ||
'/tailwind3-slidedown', | ||
], | ||
'BS4' => [ | ||
'/bootstrap-4', | ||
], | ||
'BS4-slidedown' => [ | ||
'/bootstrap-4-slidedown', | ||
], | ||
|
||
'BS5' => [ | ||
'/bootstrap-5', | ||
], | ||
'BS5-slidedown' => [ | ||
'/bootstrap-5-slidedown', | ||
], | ||
|
||
]; | ||
} | ||
|
||
/** | ||
* testNumberRangeFilterOpens | ||
*/ | ||
#[DataProvider('urlProvider')] | ||
public function testNumberRangeFilterOpens($baseURL): void | ||
{ | ||
$this->browse(function (Browser $browser) use ($baseURL) { | ||
$browser->visit($baseURL); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("numberRange_" . trim($baseURL, '//') . "_1_Initial_Load_" . date('Y-m-d H')); | ||
|
||
$browser->press('@filtBtn'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("numberRange_" . trim($baseURL, '//') . "_2_Clicked_Filter_Button_" . date('Y-m-d H')); | ||
|
||
$initialMinValue = $browser->value('#users2\.filters\.success_rate\.min'); | ||
|
||
$this->assertEquals(0, $browser->value('#users2\.filters\.success_rate\.min')); | ||
|
||
$initialMaxValue = $browser->value('#users2\.filters\.success_rate\.max'); | ||
|
||
$this->assertEquals(100, $browser->value('#users2\.filters\.success_rate\.max')); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->dragLeft('#users2\.filters\.success_rate\.max', 50); | ||
|
||
$browser->value('#users2\.filters\.success_rate\.max', "75"); | ||
|
||
$this->assertEquals(75, $browser->value('#users2\.filters\.success_rate\.max')); | ||
|
||
$browser->pause(500); | ||
|
||
$browser->screenshot("numberRange_" . trim($baseURL, '//') . "_4a_First_Drag" . date('Y-m-d H')); | ||
|
||
$browser->mouseover('#users2-filter-e_mail_verified_range'); | ||
|
||
$browser->pause(1000); | ||
|
||
$browser->screenshot("numberRange_" . trim($baseURL, '//') . "_4b_Second_Drag" . date('Y-m-d H')); | ||
|
||
$this->assertEquals(0, $browser->value('#users2\.filters\.success_rate\.min')); | ||
|
||
$browser->mouseover('#users2-filter-e_mail_verified_range'); | ||
|
||
$browser->pause(2000); | ||
|
||
$browser->screenshot("numberRange_" . trim($baseURL, '//') . "_5_Final_Check_" . date('Y-m-d H')); | ||
}); | ||
} | ||
} |