forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequestsSearchTest.php
More file actions
48 lines (39 loc) · 1.56 KB
/
RequestsSearchTest.php
File metadata and controls
48 lines (39 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Tests\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Artisan;
use Laravel\Dusk\Browser;
use ProcessMaker\Models\ProcessRequest;
use ProcessMaker\Models\User;
use Tests\Browser\Pages\RequestsPage;
use Tests\DuskTestCase;
class RequestsSearchTest extends DuskTestCase
{
public function testPmqlErrors()
{
$this->markTestSkipped('Skipping due to Dusk issues...');
$user = User::first();
ProcessRequest::factory()->create([
'name' => 'Some Request',
'user_id' => $user->id,
'status' => 'ACTIVE',
]);
$this->browse(function (Browser $browser) use ($user) {
$browser->loginAs($user)
->visit(new RequestsPage)
->click('@advanced-search-button')
->waitFor('@pmql')
->keys('@pmql', ...array_fill(0, 50, '{backspace}'))->type('@pmql', 'foo = "bar"')
->click('@search-button')
->waitFor('.alert-wrapper div')
->assertSeeIn('.alert-wrapper div', "Unknown column 'foo'")
->keys('@pmql', ...array_fill(0, 50, '{backspace}'))->type('@pmql', 'name = "bar"')
->click('@search-button')
->waitForText('No Data Available')
->keys('@pmql', ...array_fill(0, 50, '{backspace}'))->type('@pmql', 'name like "some%"')
->click('@search-button')
->waitFor('@vuetable td')
->assertSeeIn('@vuetable', 'In Progress');
});
}
}