laravel-dusk

Running Laravel Dusk on Homestead

十年热恋 提交于 2019-12-05 20:29:38
I use Homestead Version 1.0.1 and Laravel version 5.4.16 . I setup the Laravel dusk by reading the documentation . But, when I run php artisan dusk by ssh to my homestead. I got an error like the following PHPUnit 5.7.17 by Sebastian Bergmann and contributors. E 1 / 1 (100%) Time: 2.52 minutes, Memory: 10.00MB There was 1 error: 1) Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["no-first

How to reuse a Dusk test browser instance?

北慕城南 提交于 2019-12-05 02:26:13
My project on the Laravel 5.4 framework and I am using Dusk for browser tests. I have a page that has several sections I'd like to test independently, however I'm running into the problem where I have to start a new browser instance, login, and navigate to that page, for each individual test. public function testExample() { $this->browse(function (Browser $browser) { $browser->loginAs(1) ->visit('/admin/dashboard') ->assertABC() ->assertXYZ(); }); } So when I have 4-5 of these in class allTheThingsTest extends DuskTestCase , I'm spawning 4-5 browser instances per test class . Obviously this

Laravel dusk not working .env.dusk.local

佐手、 提交于 2019-12-05 01:33:24
I have an application and I want to use Laravel Dusk. I created a file named .env.dusk.local with a database for tests and a file named .env with my default database. I ran the php artisan command and created a user by /register . After I created a login test with the same email but with a different password, this would not be a problem because in .env.dusk.local it would be a different bank and would not have any users registered. But when I run the php artisan dusk command it takes the information from the original .env and ends up erasing all records from my default database. I would like

Laravel Dusk + Vue with ElementUI

我的梦境 提交于 2019-12-04 20:02:33
I need help writting test with Laravel Dusk. I'm using Vue with ElementUI . I really like this framework, however, I can't use Dusk's build-in select() method in my tests. It's because the select component of ElementUI does not generate a real <select> tag, instead, it creates a normal <input> (that is readonly) and, at bottom of the page, the popper with select's options, so, there is not a <select> tag in my page, only a <div> and a readonly <input> . How can I write a test with Dusk that lets me click on a 'div'?? If I try to type on that input with something like this: // $browser->select(

Testing vuetify v-select with laravel dusk

走远了吗. 提交于 2019-12-04 05:31:48
问题 Does anyone know how to test vuetify v-select with laravel dusk? I've tried $browser->select('size', 'Large'); without success this is one of the v-selects that i want to test <v-flex class="form__item"> <v-select id="estatus" dusk="estatus" v-model="form.id_estatus" label="Estatus" :items="estatus" item-text="nombre" item-value="id" v-validate="{ required:true }" data-vv-name="estatus" data-vv-as="estatus" :error-messages="(errors.collect('estatus'))" required ></v-select> </v-flex> And this

How to solve Exception It is unsafe to run Dusk in production in laravel 5.5?

孤人 提交于 2019-12-04 05:22:57
I upgrated my project from laravel 5.4 to laravel 5.5 , I dont have any problem in local env but in server i get this exception , I searched a lot and i know this issue may be duplicated but no solutions solved my problem! How can i not registering dusk when environment is production? i wrote this code in AppServiceProvider.php : public function register() { // Dusk, if env is appropriate if ($this->app->environment('local', 'testing')) { $this->app->register(DuskServiceProvider::class); } } but it seems not working. can anyone help? EDITED : my composer.json file: "require-dev": { "filp

Xdebug of Laravel Dusk in Netbeans on Homestead

白昼怎懂夜的黑 提交于 2019-12-02 05:49:46
问题 In Laravel Homestead, I've been able to use Xdebug for unit tests, feature tests, poking around in the browser, etc. But it hangs when I try to use Xdebug for Dusk (tests in tests/Browser folder). I thought these questions might help, but I still haven't gotten it working: debugging laravel artisan from PHPStorm with homestead Xdebug laravel artisan commands I've tried various approaches, including: export XDEBUG_CONFIG="idekey=netbeans-xdebug remote_connect_back=0 remote_host=10.0.2.2" php

Testing vuetify v-select with laravel dusk

删除回忆录丶 提交于 2019-12-02 05:27:43
Does anyone know how to test vuetify v-select with laravel dusk? I've tried $browser->select('size', 'Large'); without success this is one of the v-selects that i want to test <v-flex class="form__item"> <v-select id="estatus" dusk="estatus" v-model="form.id_estatus" label="Estatus" :items="estatus" item-text="nombre" item-value="id" v-validate="{ required:true }" data-vv-name="estatus" data-vv-as="estatus" :error-messages="(errors.collect('estatus'))" required ></v-select> </v-flex> And this the generated HTML When v-select is clicked, shows the option list in other part of the HTML Click on

Laravel dusk asserting for 404 errors

隐身守侯 提交于 2019-12-02 03:01:27
问题 I'm trying to use laravel dusk to test for 404 not found error. Specifically when loading an image. After reading the laravel dusk documentation I've found no asserts that could help me test if a 404 exception occurs. Is there a good way of getting a browser test to know whether a resource has failed loading or is it simply not possible? 回答1: There is intentionally no way to access HTTP status codes: https://github.com/laravel/dusk/issues/422 https://github.com/facebook/php-webdriver/issues

Laravel dusk asserting for 404 errors

心不动则不痛 提交于 2019-12-02 02:19:27
I'm trying to use laravel dusk to test for 404 not found error. Specifically when loading an image. After reading the laravel dusk documentation I've found no asserts that could help me test if a 404 exception occurs. Is there a good way of getting a browser test to know whether a resource has failed loading or is it simply not possible? There is intentionally no way to access HTTP status codes: https://github.com/laravel/dusk/issues/422 https://github.com/facebook/php-webdriver/issues/470 Robert David You can use browser -> driver -> manage() -> getLog('browser') to get the log and see if