This repository was archived by the owner on Feb 7, 2023. It is now read-only.
File tree 6 files changed +142
-1
lines changed
resources/assets/js/components
6 files changed +142
-1
lines changed Original file line number Diff line number Diff line change 1
1
<template lang="html">
2
2
<div class =" chat-composer" >
3
- <input type =" text" placeholder =" Start typing your message..." v-model =" messageText" @keyup.enter =" sendMessage" >
3
+ <input id = " message " type =" text" placeholder =" Start typing your message..." v-model =" messageText" @keyup.enter =" sendMessage" >
4
4
<button class =" btn btn-primary" @click =" sendMessage" >Send</button>
5
5
</div>
6
6
</template >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Browser ;
4
+
5
+ use App \User ;
6
+ use Tests \DuskTestCase ;
7
+ use Laravel \Dusk \Chrome ;
8
+ use Illuminate \Foundation \Testing \DatabaseMigrations ;
9
+
10
+ class ExampleTest extends DuskTestCase
11
+ {
12
+ use DatabaseMigrations;
13
+
14
+ /**
15
+ * A basic browser test example.
16
+ *
17
+ * @return void
18
+ */
19
+ public function testBasicExample ()
20
+ {
21
+ $ user1 = factory (User::class)->create ([
22
+ 'name ' => 'John Doe '
23
+ ]);
24
+
25
+ $ user2 = factory (User::class)->create ([
26
+ 'name ' => 'Jane Doe '
27
+ ]);
28
+
29
+ $ this ->browse (function ($ first , $ second ) use ($ user1 , $ user2 ) {
30
+ $ first ->loginAs ($ user1 )
31
+ ->visit ('/chat ' )
32
+ ->waitFor ('.chat-composer ' );
33
+
34
+ $ second ->loginAs ($ user2 )
35
+ ->visit ('/chat ' )
36
+ ->waitFor ('.chat-composer ' )
37
+ ->type ('#message ' , 'Hey John ' )
38
+ ->press ('Send ' );
39
+
40
+ $ first ->waitForText ('Hey John ' )
41
+ ->assertSee ('Jane Doe ' );
42
+ });
43
+ }
44
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Browser \Pages ;
4
+
5
+ use Laravel \Dusk \Browser ;
6
+
7
+ class HomePage extends Page
8
+ {
9
+ /**
10
+ * Get the URL for the page.
11
+ *
12
+ * @return string
13
+ */
14
+ public function url ()
15
+ {
16
+ return '/ ' ;
17
+ }
18
+
19
+ /**
20
+ * Assert that the browser is on the page.
21
+ *
22
+ * @return void
23
+ */
24
+ public function assert (Browser $ browser )
25
+ {
26
+ //
27
+ }
28
+
29
+ /**
30
+ * Get the element shortcuts for the page.
31
+ *
32
+ * @return array
33
+ */
34
+ public function elements ()
35
+ {
36
+ return [
37
+ '@element ' => '#selector ' ,
38
+ ];
39
+ }
40
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Browser \Pages ;
4
+
5
+ use Laravel \Dusk \Page as BasePage ;
6
+
7
+ abstract class Page extends BasePage
8
+ {
9
+ /**
10
+ * Get the global element shortcuts for the site.
11
+ *
12
+ * @return array
13
+ */
14
+ public static function siteElements ()
15
+ {
16
+ return [
17
+ '@element ' => '#selector ' ,
18
+ ];
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ *
2
+ ! .gitignore
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests ;
4
+
5
+ use Laravel \Dusk \TestCase as BaseTestCase ;
6
+ use Facebook \WebDriver \Remote \RemoteWebDriver ;
7
+ use Facebook \WebDriver \Remote \DesiredCapabilities ;
8
+
9
+ abstract class DuskTestCase extends BaseTestCase
10
+ {
11
+ use CreatesApplication;
12
+
13
+ /**
14
+ * Prepare for Dusk test execution.
15
+ *
16
+ * @beforeClass
17
+ * @return void
18
+ */
19
+ public static function prepare ()
20
+ {
21
+ static ::startChromeDriver ();
22
+ }
23
+
24
+ /**
25
+ * Create the RemoteWebDriver instance.
26
+ *
27
+ * @return \Facebook\WebDriver\Remote\RemoteWebDriver
28
+ */
29
+ protected function driver ()
30
+ {
31
+ return RemoteWebDriver::create (
32
+ 'http://localhost:9515 ' , DesiredCapabilities::chrome ()
33
+ );
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments