{"id":18825,"date":"2017-10-02T12:15:37","date_gmt":"2017-10-02T09:15:37","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=18825"},"modified":"2017-09-27T11:28:27","modified_gmt":"2017-09-27T08:28:27","slug":"laravel-dusk-codeship","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/","title":{"rendered":"Laravel and Dusk on Codeship"},"content":{"rendered":"<p>Some time back, I posted on how to set up <a href=\"https:\/\/www.webcodegeeks.com\/web-development\/laravel-behat-using-selenium-headless-chrome\/\">Laravel and Behat using Selenium and headless Chrome<\/a>. But since that article, a new option has come into view \u2014 Dusk.<\/p>\n<p>This has several advantages over Behat. For one, the install is greatly simplified. On top of that, the speeds and simplicity in testing the UI and JavaScript have all been wrapped into PHPUnit. Invented by the creator of Laravel, Dusk has amazing integration into the base of Laravel, from easily mocking events, jobs, models, etc. to running migrations and transactions.<\/p>\n<p>In this article, I will cover a much-updated approach to getting all of this working on Codeship, including how to troubleshoot when things are not going as expected on a Codeship build.<\/p>\n<h2>Setting Up Your Local Environment<\/h2>\n<p>As in the last post, I reference <a href=\"https:\/\/www.webcodegeeks.com\/php\/getting-started-laravel-codeship\/\">Matthew Setter\u2019s article about Laravel and Codeship<\/a>. From there though, the next steps change from the previous article since there is no Behat or Selenium to set up.<\/p>\n<blockquote><p>If you miss the Behat Gherkin workflow, try <a href=\"https:\/\/github.com\/alnutile\/pickle\">Pickle<\/a>.<\/p><\/blockquote>\n<p>Instead, I follow the installations docs as seen on <a href=\"https:\/\/laravel.com\/docs\/5.4\/dusk#installation\">Laravel Docs<\/a>. This uses the standalone <a href=\"https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/home\">ChromeDriver<\/a>, eliminating the need for installing Selenium as well. The docs on that page do a great job of explaining how to get set up.<\/p>\n<p>The only thing I would point out is that if you are running your tests in your VM, which I do most of the time, you just need to set your VM to know the IP of your host machine. So when you\u2019re running Dusk from inside of it and point to the URL of your app (eg, http:\/\/foo.com), then the VM\u2019s <code>\/etc\/hosts<\/code> file needs to match that domain to the host IP. This will then open up Chrome on your host machine via this driver.<\/p>\n<p>In this example, I\u2019ll keep it simple and run the server on my host machine. First, I\u2019ll edit my <code>.env<\/code> file to be <code>APP_URL=http:\/\/127.0.0.1:8000<\/code> instead of the default and then in the terminal, type:<\/p>\n<pre class=\"brush:php\">php artisan serve<\/pre>\n<p>You will end up seeing this:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/codeship_dusk_1.png\"><img decoding=\"async\" class=\"aligncenter wp-image-18827 size-large\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/codeship_dusk_1-1024x310.png\" alt=\"\" width=\"620\" height=\"188\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/codeship_dusk_1.png 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/codeship_dusk_1-300x91.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/codeship_dusk_1-768x233.png 768w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<h2>Your First Dusk Test<\/h2>\n<p>We are now ready to write the first test. To begin, I\u2019ll use the command to stub it out:<\/p>\n<pre class=\"brush:php\">php artisan dusk:make FirstUITest<\/pre>\n<p>This will make a file, <code>tests\/Browser\/FirstUITest.php<\/code>. Then I\u2019ll just keep it simple and leave the default stubbed test in there:<\/p>\n<pre class=\"brush:php\">browse(function (Browser $browser) {\r\n                $browser-&gt;visit('\/')\r\n                        -&gt;assertSee('Laravel');\r\n            });\r\n        }\r\n    }<\/pre>\n<p>Now, to run this locally and make sure all is working and running from my host machine:<\/p>\n<pre class=\"brush:php\">php artisan dusk<\/pre>\n<p>You should see, as in the image below, Chrome pop up and run the tests.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-18828\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview.jpg\" alt=\"\" width=\"860\" height=\"687\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview.jpg 1220w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview-300x240.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview-768x613.jpg 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-preview-1024x818.jpg 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<h2>Setting Up Codeship for Dusk<\/h2>\n<p>Now that we have our test, we need to get Codeship ready to run Dusk. First, I\u2019ll add a <code>.env.codeship<\/code> file:<\/p>\n<pre class=\"brush:php\">APP_ENV=testing\r\n    APP_URL=http:\/\/127.0.0.1:8000\r\n    APP_KEY=base64:nF7Ns2Gz9olX2rmfquKzblBRVHIvsFzicqh78TGHh6A=<\/pre>\n<p>Then, I\u2019d like to make a <code>ci\/setup.sh<\/code> folder and file with this content:<\/p>\n<pre class=\"brush:php\">#!\/bin\/sh\r\n    \r\n    set -e\r\n    \r\n    phpenv local 5.6\r\n    composer install --no-interaction\r\n    \r\n    .\/vendor\/laravel\/dusk\/bin\/chromedriver-linux &amp;\r\n    \r\n    cp .env.codeship .env\r\n    \r\n    php artisan serve &gt; \/dev\/null 2&gt;&amp;1 &amp;\r\n    sleep 3<\/pre>\n<p>This makes it easier to debug a build when you SSH into Codeship, as I will demonstrate later on.<\/p>\n<p>All right, now wrap up the two install settings on Codeship as seen in the image below.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings.png\"><img decoding=\"async\" class=\"aligncenter wp-image-18829\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings.png\" alt=\"\" width=\"860\" height=\"1134\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings.png 954w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings-228x300.png 228w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings-768x1013.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk-codeship-settings-777x1024.png 777w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>Now push your code!<\/p>\n<h2>Troubleshooting a Build<\/h2>\n<p>Sometimes things will not work out on the CI as expected, and this is great! Well, <em>great<\/em> in that the CI really does catch the little details that are easy to miss when running tests locally. For example, a classic one for me is that on a Mac, I class with a filename <code>FooBar.php<\/code> but the name <code>class Foobar<\/code> will pass. But on the CI and pure Linux, it won\u2019t. since the caps do not match. I\u2019d much rather have this happen on the CI than on my server.<\/p>\n<h3>SSH and dump<\/h3>\n<p>One great feature of Codeship is the ability to SSH in and <a href=\"https:\/\/documentation.codeship.com\/basic\/builds-and-configuration\/ssh-access\/\">debug<\/a>. Once you are logged in, you can run:<\/p>\n<pre class=\"brush:php\">&gt;sh .\/ci\/setup.sh\r\n    &gt;php artisan dusk<\/pre>\n<p>This is where, in my opinion, it pays off to just have these files instead of numerous lines to run.<\/p>\n<p>After that, you should still see the fail. At this point, alter the test to look like this and add the <code>dump()<\/code>:<\/p>\n<pre class=\"brush:php\">{\r\n        $this-&gt;browse(function (Browser $browser) {\r\n            $browser-&gt;visit('\/')-&gt;dump()\r\n                    -&gt;assertSee('Laravel');\r\n        });\r\n    }<\/pre>\n<p>Then after you run the test again, you\u2019ll get a ton of output on the screen. For me, this led to a message that ChromeDriver could not connect to the <code>APP_URL<\/code>, so I just made sure to rerun <code>php artisan serve<\/code>. Once, I made the mistake of setting <code>assets<\/code> to use <code>https<\/code>, but as you see above, I am serving PHP over <code>http<\/code>.<\/p>\n<h3>Logging and tail<\/h3>\n<p>This is a very simple workflow I do locally but it even comes in handy on Codeship. Using a terminal like <a href=\"https:\/\/www.iterm2.com\/index.html\">iTerm<\/a>, I can have one terminal open and two panes. Then in the top pane, I can SSH in and run the test, while in the bottom one I can tail the logs:<\/p>\n<pre class=\"brush:php\">tail -f clone\/storage\/logs\/laravel.log<\/pre>\n<p>That makes it easy to see results while running tests and trying new things in the top pane.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging.png\"><img decoding=\"async\" class=\"aligncenter wp-image-18830\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging.png\" alt=\"\" width=\"860\" height=\"325\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging.png 1329w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging-300x114.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging-768x291.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/09\/dusk_and_logging-1024x388.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<blockquote><p>The log file will not be there until there is something to log.<\/p><\/blockquote>\n<h3>SCP and screenshots<\/h3>\n<p>Finally, Dusk saves screenshots of failed jobs. They are located in <code>tests\/Browser\/screenshots<\/code> and named after the function name and number, <em>eg<\/em>, <code>failure-testExample-0.png<\/code>. This does not help you much in SSH mode! But if you\u2019re lucky enough to have SSH running on your machine and a port open on your router, then:<\/p>\n<pre class=\"brush:php\">scp -v ~\/clone\/tests\/Browser\/screenshots\/*.png yourname@your_ip:~\/<\/pre>\n<p>This will download those files locally to your computer. This is needed since SCP to Codeship requires a password, so you can\u2019t just download those files from your machine.<\/p>\n<p>!Sign up for a free Codeship Account<\/p>\n<h2>Gherkin and BDD<\/h2>\n<p>In case you\u2019re missing BDD and the Gherkin syntax that Behat provides, I want to share how to use <code>pickle<\/code>. By using <a href=\"https:\/\/github.com\/alnutile\/pickle\">Pickle<\/a>, you can still have the same flow as before, where there\u2019s a Gherkin-based test to run that will use Dusk.<\/p>\n<p>To begin with, let\u2019s install Pickle into the dev part of your app using Composer:<\/p>\n<pre class=\"brush:php\">composer require alnutile\/pickle -dev<\/pre>\n<blockquote><p>The Pickle docs mention <code>cgr<\/code> and global install. This is great for your host machine or VM (Guest), but for Codeship, we\u2019ll just include it into our <code>dev<\/code> composer.json.<\/p><\/blockquote>\n<p>Then in my project, I\u2019ll make a folder and file, <code>tests\/features\/example_pickle.feature<\/code>:<\/p>\n<pre class=\"brush:php\">Feature: Running pickle on Codeship\r\n    \r\n      Scenario: Is the site loaded\r\n      Given I am on the home page of my app\r\n      Then I should see the intro text<\/pre>\n<p>Now we want to make our Dusk test out of this. I can later make a unit or integration test out of this same file as well:<\/p>\n<pre class=\"brush:php\">vendor\/bin\/pickle initialize --context=browser tests\/features\/example_pickle.feature<\/pre>\n<p>This will stub out a file located at <code>tests\/Browser\/ExamplePickleTest.php<\/code> for editing.<\/p>\n<p>Just like before, it is stubbed out, but in this case, the file Pickle created is broken into <code>steps<\/code>. This will allow you to build up your tests and your code, since this is happening before you start to code, one step at a time. By the time I\u2019m done, it will look like this:<\/p>\n<pre class=\"brush:php\">class ExamplePickleTest extends DuskTestCase\r\n    {\r\n    \r\n        \/**\r\n        * @var Browser\r\n        *\/\r\n        protected $browser;\r\n    \r\n        public function testsTheSiteLoaded()\r\n        {\r\n    \r\n            $this-&gt;browse(function (Browser $browser) {\r\n                $this-&gt;browser = $browser;\r\n                $this-&gt;givenIAmOnTheHomePageOfMyApp();\r\n                $this-&gt;thenIShouldSeeTheIntroText();\r\n            });\r\n        }\r\n    \r\n    \r\n        protected function givenIAmOnTheHomePageOfMyApp()\r\n        {\r\n            $this-&gt;browser-&gt;visit('\/');\r\n        }\r\n    \r\n        protected function thenIShouldSeeTheIntroText()\r\n        {\r\n            $this-&gt;browser-&gt;assertSee('Laravel');\r\n        }\r\n    \r\n    \r\n    }<\/pre>\n<p>Okay, now to run it locally:<\/p>\n<pre class=\"brush:php\">vendor\/bin\/pickle run --context=browser tests\/features\/example_pickle.feature<\/pre>\n<p>All this is doing is wrapping Dusk, so as before, you could just run <code>php artisan dusk<\/code>, seeing the test come together one step at a time. And that is it; we can leave Codeship settings as they are.<\/p>\n<p>To make the <code>Integration<\/code> or <code>Feature<\/code> test out of this, run:<\/p>\n<pre class=\"brush:php\">vendor\/bin\/pickle initialize tests\/features\/example_pickle.feature<\/pre>\n<p>As you are completing the steps in that file, you can run:<\/p>\n<pre class=\"brush:php\">vendor\/bin\/pickle run tests\/features\/example_pickle.feature<\/pre>\n<p>And as with Dusk, Pickle is just wrapping PHPUnit, so in your Codeship test settings, make sure to add <code>vendor\/bin\/phpunit --stop-on-failure<\/code>.<\/p>\n<p>As you see, getting up to speed with Dusk and Laravel on Codeship is very easy. There really is no reason not to test your UI, even when it contains JavaScript.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Web Code Geeks with permission by Alfred Nutile, partner at our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\" target=\"_blank\" rel=\"noopener\">WCG program<\/a>. See the original article here: <a href=\"https:\/\/blog.codeship.com\/laravel-and-dusk-on-codeship\/\" target=\"_blank\" rel=\"noopener\">Laravel and Dusk on Codeship<\/a><\/p>\n<p>Opinions expressed by Web Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014 Dusk. This has several advantages over Behat. For one, the install is greatly simplified. On top of that, the speeds and simplicity in testing the &hellip;<\/p>\n","protected":false},"author":1343,"featured_media":930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[385],"class_list":["post-18825","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-laravel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Laravel and Dusk on Codeship - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Laravel and Dusk on Codeship - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-02T09:15:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alfred Nutile\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alfred Nutile\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\"},\"author\":{\"name\":\"Alfred Nutile\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b81bae9d3dfea85b60775f65ae6f3364\"},\"headline\":\"Laravel and Dusk on Codeship\",\"datePublished\":\"2017-10-02T09:15:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\"},\"wordCount\":1235,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"keywords\":[\"Laravel\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\",\"name\":\"Laravel and Dusk on Codeship - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"datePublished\":\"2017-10-02T09:15:37+00:00\",\"description\":\"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/php\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Laravel and Dusk on Codeship\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b81bae9d3dfea85b60775f65ae6f3364\",\"name\":\"Alfred Nutile\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/77ed5ac1ba5bfedd76782e75fa79863a52fa58058342f23bf01ff301d542f5b0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/77ed5ac1ba5bfedd76782e75fa79863a52fa58058342f23bf01ff301d542f5b0?s=96&d=mm&r=g\",\"caption\":\"Alfred Nutile\"},\"description\":\"Alfred Nutile is a web app developer and podcaster at DevelopersHangout.\",\"sameAs\":[\"https:\/\/blog.codeship.com\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/alfred-nutile\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Laravel and Dusk on Codeship - Web Code Geeks - 2026","description":"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/","og_locale":"en_US","og_type":"article","og_title":"Laravel and Dusk on Codeship - Web Code Geeks - 2026","og_description":"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014","og_url":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-10-02T09:15:37+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","type":"image\/jpeg"}],"author":"Alfred Nutile","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Alfred Nutile","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/"},"author":{"name":"Alfred Nutile","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b81bae9d3dfea85b60775f65ae6f3364"},"headline":"Laravel and Dusk on Codeship","datePublished":"2017-10-02T09:15:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/"},"wordCount":1235,"commentCount":1,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","keywords":["Laravel"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/","url":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/","name":"Laravel and Dusk on Codeship - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","datePublished":"2017-10-02T09:15:37+00:00","description":"Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view \u2014","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/php\/laravel-dusk-codeship\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"PHP","item":"https:\/\/www.webcodegeeks.com\/category\/php\/"},{"@type":"ListItem","position":3,"name":"Laravel and Dusk on Codeship"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/b81bae9d3dfea85b60775f65ae6f3364","name":"Alfred Nutile","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/77ed5ac1ba5bfedd76782e75fa79863a52fa58058342f23bf01ff301d542f5b0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/77ed5ac1ba5bfedd76782e75fa79863a52fa58058342f23bf01ff301d542f5b0?s=96&d=mm&r=g","caption":"Alfred Nutile"},"description":"Alfred Nutile is a web app developer and podcaster at DevelopersHangout.","sameAs":["https:\/\/blog.codeship.com"],"url":"https:\/\/www.webcodegeeks.com\/author\/alfred-nutile\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/1343"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=18825"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/18825\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/930"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=18825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=18825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=18825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}