laravel-dusk

Laravel Dusk: unknown error: call function result missing 'value'

和自甴很熟 提交于 2019-12-08 05:37:59
问题 I'm having problems with the Laravel Dusk type() and value() method. I'm getting the following error. $ php artisan dusk --group=activation Warning: TTY mode is not supported on Windows platform. PHPUnit 5.7.27 by Sebastian Bergmann and contributors. DevTools listening on ws://127.0.0.1:12599/devtools/browser/84028821-2ca1-4d26-b66c-4697d2302117 E 1 / 1 (100%) Time: 13,35 seconds, Memory: 18,00MB There was 1 error: 1) Tests\Browser\CounselorActivationTest:

Can Laravel Dusk test results be logged?

∥☆過路亽.° 提交于 2019-12-08 03:52:36
问题 Dusk is providing individual logs for tests that returned failures / warnings in the console, but what I'm really after is one big log file or report that lists the pass/fail status of each test in my Dusk script. Can anyone suggest a way to go about this? I can't find an answer anywhere but it seems like it should be a relatively common thing to need so I'm sure I've overlooked something. 回答1: You can use PHPUnit's logging: php artisan dusk --log-junit junit.log php artisan dusk --log

Laravel Dusk - Reuse browser with its session and cookies

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 02:04:01
问题 I've just used Laravel Dusk to test a javascript site. Want to reuse the current browser with its session and cookies for some reason (keep me logged in on the site), so I don't need to pass auth process. Any way to reuse the current browser? I've already searched about this, but I found no practical info/example. Note: I use Dusk by default with Google Chrome and a standalone ChromeDriver (not Selenium) 回答1: I had the same requirement using Laravel Dusk. The trick is to use the Facebook

Laravel Dusk how to get multiple element's attributes?

蹲街弑〆低调 提交于 2019-12-08 01:57:21
问题 I just began using Laravel Dusk on Laravel 5.8 and already faced an issue. Was searching a lot on Google, but haven't found an answer. $browser->visit('https://www.website.com') ->script('window.scrollTo(0, 1000);'); $elems = $browser ->pause(1000) ->elements('.elem a'); This is my current code to get all the links under a certain element on the page. What I want to do is get all the links and get their href attribute or any custom attribute they might have (I want to specify the name if the

Select an option based on text in drop-down with Laravel Dusk

こ雲淡風輕ζ 提交于 2019-12-08 00:31:27
问题 I want to choose a drop-down option based on its text,what should i do? This is my Html code : <select name="category"> <option>Appliances</option> <option>Sporting Goods</option> <option>Cosmetics</option> </select> And this is my selector in dusk : ->select('category','Appliances') 回答1: You can use XPath: $selector = "//select[@name='category']/option[text()='Appliances']"; $browser->driver->findElement(WebDriverBy::xpath($selector))->click(); 回答2: To select a value in a dropdown selection

How to reuse a Dusk test browser instance?

坚强是说给别人听的谎言 提交于 2019-12-06 21:17:23
问题 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

Laravel dusk not working .env.dusk.local

别等时光非礼了梦想. 提交于 2019-12-06 20:25:57
问题 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

Laravel Dusk: unknown error: call function result missing 'value'

六眼飞鱼酱① 提交于 2019-12-06 13:39:46
I'm having problems with the Laravel Dusk type() and value() method. I'm getting the following error. $ php artisan dusk --group=activation Warning: TTY mode is not supported on Windows platform. PHPUnit 5.7.27 by Sebastian Bergmann and contributors. DevTools listening on ws://127.0.0.1:12599/devtools/browser/84028821-2ca1-4d26-b66c-4697d2302117 E 1 / 1 (100%) Time: 13,35 seconds, Memory: 18,00MB There was 1 error: 1) Tests\Browser\CounselorActivationTest::testActivationWithSubscriptionWithPasswordLogin Facebook\WebDriver\Exception\UnknownServerException: unknown error: call function result

Laravel dusk: test file upload with Dropzone.js

十年热恋 提交于 2019-12-06 11:37:33
I'm using laravel 5.6 and Dusk for this specific test. I'm trying to assert a file upload in my dropzone. But my Dropzone is created in a way that I don't have a file input element. So I can't use the attach() method. So I tried the following $file = new \Symfony\Component\HttpFoundation\File\UploadedFile(base_path() . '/tests/samples/Cylinder.stl', 'Cylinder.stl'); $response = $this->actingAs( $this->user ) ->from( 'my-url' ) ->post( route('attachments.store' ) , [ 'file' => $file ]); But the error bag is containing this error "errors" => Illuminate\Support\ViewErrorBag {#1194 #bags: array:1

Laravel Dusk - Reuse browser with its session and cookies

邮差的信 提交于 2019-12-06 06:29:31
I've just used Laravel Dusk to test a javascript site. Want to reuse the current browser with its session and cookies for some reason (keep me logged in on the site), so I don't need to pass auth process. Any way to reuse the current browser? I've already searched about this, but I found no practical info/example. Note: I use Dusk by default with Google Chrome and a standalone ChromeDriver (not Selenium) I had the same requirement using Laravel Dusk. The trick is to use the Facebook/WebDriver/Remote/RemoteWebDriver class and its manage() method . Pseudo code: use Facebook\WebDriver\Chrome