Git Product home page Git Product logo

dusk-dashboard's People

Contributors

dbpolito avatar michielgerritsen avatar mpociot avatar nie7321 avatar nunomaduro avatar owenvoke avatar pascaldls avatar ricardoboss avatar robprigroup avatar royduin avatar stefanullrich avatar upsite4k avatar vesper8 avatar wuori avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dusk-dashboard's Issues

Tests running Showing no tests or results in dashboard

When I click on the Run test, I see that the tests are being perfomed in the terminal. However the results do not show up in the dashboard.
I am running on a laradock environment where I had to forward port 9773 in order to show the dashboad. Is there something else I need to do to get it running ?

Not working with large DOM responses

Hello there ๐Ÿ‘‹

Tests are passing in dusk, but the preview is not available in the browser.

I'm getting the following error in the browser terminal.

VM1898:1 Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at WebSocket.conn.onmessage (dashboard:252)

It works fine for a small HTML response like the welcome.blade.php view.

Is there any known solution for this issue?

Thanks,
Jeff.

dusk dashboard should have an option to run particular set of test cases

As for now dusk dashboard have a single button and on clicking it starts to execute all my test cases in tests/browser directory.
Dusk dashboard should have some more friendly UI as it should enlist all the test cases in the directory test/browser, in the form of check list hierarchy according to the file-folder structure in the director. dashboard should allow user to mark the test cases in the checklist that user wants to execute and then run the test cases accordingly.

Needs to be updated for Tailwind 1.0

I installed the dusk dashboard today and noticed it looked quite different from the screenshots.

Screen Shot 2019-06-12 at 3 57 59 PM

Using https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css instead of the current version of Tailwind makes it look just like the README.

I believe most of the class names relating to colours were changed in 1.x, so that needs to be updated.

I can take a stab at it?

Dockerized selenium not working

I have a laravel and selenium container for testing, dusk works fine in the console
Starting the dusk-dashboard works fine and it shows up
When I press start in the dashboard the tests start running in the console...great
The console presents the results from the test... great

However the dashboard is not update with the test results and screenshots etc.

Any ideas what I am missing ?

It seems that there is no communication from the laravel container to the browser window

Single Page Application

Does this not work with SPA (Single Page Application)? I'm running a Laravel/Vue app that's using Vue-Router to serve all of the pages. It doesn't seem to show the clicks or assertions in the left panel.

Running Dusk 5 + Laravel 5.8 and nothing shows in frame when running tests

  • Running Dusk 5 + Laravel 5.8 + Latest Dusk Dashboard
  • Running inside Homstead
  • When I click "start tests" it runs through the tests on the left hand side and the console (SSH) shows the tests running also but the frame that should show the site being tested shows nothing (it's completely white and empty).

Any ideas?

Here's my DuskTestCase.php which is used in all Dusk tests.

<?php

namespace Tests;

use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use BeyondCode\DuskDashboard\Testing\TestCase as BaseTestCase;

abstract class DuskTestCase extends BaseTestCase
{
    use CreatesApplication;

    /**
     * Prepare for Dusk test execution.
     *
     * @beforeClass
     * @return void
     */
    public static function prepare()
    {
        static::startChromeDriver();
    }

    /**
     * Create the RemoteWebDriver instance.
     *
     * @return \Facebook\WebDriver\Remote\RemoteWebDriver
     */
    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu',
            '--headless',
            '--window-size=1920,1080',
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515', $this->enableNetworkLogging(
                DesiredCapabilities::chrome()->setCapability(
                    ChromeOptions::CAPABILITY, $options
                )
            )
        );
    }
}

Test shows up as passing while it isn't

Hi,

Amazing work on the package!
It seemed to work well, but after a bit of playing around with it I have found that it gives false positives for my tests when running it with the package enabled. I have freshly installed Laravel Dusk and this package on an existing project. The one test I added always ends up as successful even though it's not. The dashboard correctly shows the tests as failing in the steps but not in the console or the counters at the top.

If I run php artisan dusk like normal with the package's BaseTestCase import enabled it also gives a false positive.

When I revert the import in DuskTestCase back to the default it ends up as failing again as it should (the random gibberish does not appear in the page).

screenshot 2018-12-13 at 00 28 34

public function testExample()
{
    $this->browse(function (Browser $browser) {
        $browser->visit('/login')
                ->assertSee('sdashdkhalskdh');
    });
}

Any idea?

Run dashboard from browser

It would be cool if I could start the listener dashboard from the bowser. But when I call
Artisan::call('dusk:dashboard');
in my controller I get
The "./tests/Browser" directory does not exist.

However when I call from the cli php artisan dusk:dashboard, the dashboard starts fine

'open' is not recognized as an internal or external command, operable program or batch file.

When I run php artisan dusk:dashboard, I get an error message:

Started Dusk Dashboard on port 9773
Your Dusk tests are now being watched.
If the dashboard does not automatically open, visit: http://freshdining.local:9773/dashboard
'open' is not recognized as an internal or external command,
operable program or batch file.

I get output in the dashboard, but some screenshots seem look like it has not loaded the CSS yet.

Dusk Dashboard on docker

I am working on Laravel 5.7 application built on docker (docker-compose). Several containers with nginx and php kept as separate containers. I may run Laravel dusk tests on php container, however I am changing APP_URL into container internal server name.
Is it possible Dusk Dashboard to be run on docker containers?
My first issue is to forward 9773 port outside docker into browser to see dashboard views but no success so far.

Use config for host.

dusk-dashboard uses the config value from "app.url" for the host of the dashboard.
However that value can be something other than the local machine we are testing from when using Virtual Machines.

It would be nice if that value had it's own config key and defaults perhaps to localhost.

Fatal Error: incompatible declarations

After installation I ran php artisan dusk:dashboard and got the usual messages:

Started Dusk Dashboard on port 9773
Your Dusk tests are now being watched.
If the dashboard does not automatically open, visit: http://localhost:9773/dashboard

After opening the dashboard in Chrome and clicking on "Start Tests" nothing happens visually (looking at the network activity I was able to see messages were sent via a websocket).

I tried to run tests in the console using php artisan dusk and got this error message for every test:

Fatal error: Declaration of BeyondCode\DuskDashboard\Testing\TestCase::onNotSuccessfulTest(Throwable $t) must be compatible with PHPUnit\Framework\TestCase::onNotSuccessfulTest(Throwable $t): void in xxx\vendor\beyondcode\dusk-dashboard\src\Testing\TestCase.php on line 16

After editing the TestCase#onNotSuccessfulTest(Throwable $t) to return void I was able to start dusk from console and also from the dashboard.

"This test did not perform any assertions" error

So I've been banging my head as to why suddenly my tests don't work anymore, and then I remembered I installed this package but haven't been using it. I reverted this line to the default and now everything works again

use BeyondCode\DuskDashboard\Testing\TestCase as BaseTestCase;

back to

use Laravel\Dusk\TestCase as BaseTestCase;

Keep in mind I wasn't running the dashboard at all, just trying to run my tests from the command line as per usual

I was getting this error:

This test did not perform any assertions

And the test was judged to be "risky"

It's probably because of my unconventional way of testing.. let me explain what I do in my app so you might understand why it isn't working.

I have one single test which loads some parameters from the cache (which are set as part of another console method with Cache::forever

This one single test calls a Page and passes it those things loaded from the cache, and the page then uses those params to call a dynamic function. Finally inside that function is where all the assertions are done

Something as simple as this:

PostRecipeTest.php

<?php

namespace Tests\Browser;

use Tests\DuskTestCase;
use Tests\Browser\Pages\PostNewRecipe;

class PostRecipeTest extends DuskTestCase
{
    public function testPostRecipe()
    {
        $site = cache()->get('site');
        $recipe = cache()->get('recipe');

        $this->browse(function ($browser) use ($site, $recipe) {
            $browser->visit(new PostNewRecipe($site, $recipe));
        });
    }
}
<?php

namespace Tests\Browser\Pages;

use Laravel\Dusk\Browser;
use Illuminate\Support\Facades\URL;

class PostNewRecipe extends Page
{
    use SiteScripts;

    protected $site;
    protected $recipe;

    public function __construct($site, $recipe)
    {
        $this->site = $site;
        $this->recipe = $recipe;
    }

    public function url()
    {
        return $this->site['login_path'];
    }

    /**
     * Assert that the browser is on the page.
     *
     * @return void
     */
    public function assert(Browser $browser)
    {
        $functionName = $this->site['name'];
        
        return $this->$functionName($browser);
    }

Inside the method called above

    public function someMethod(Browser $browser)
    {
        $browser->resize(1024, 768); // Width and Height

        $browser->assertPathIs('/');
        ...

When using

use BeyondCode\DuskDashboard\Testing\TestCase as BaseTestCase;

The test would always reach this first assertion (assertPathIs) and would exit there, not giving a failure but rather exiting with the error 'This test did not perform any assertions'

I guess this package does not like the way I'm testing my assertions into a method instead of being directly included in the Page's assert() method.. do you have any idea why? Works perfectly with vanilla Laravel Dusk

Regards

BadMethodCallException

I have 1341 tests in total. I run them all once. But in all of them I get the following error.
BadMethodCallException: Call to undefined method [setActionCollector].
For example, I will share a test.
Screenshot from 2020-02-13 14-53-31

This test is working correctly without using Dusk Dashboard.

Also, my DuskTestCase file is as follows.

<?php

namespace Tests;

use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use BeyondCode\DuskDashboard\Testing\TestCase as BaseTestCase;
use Tests\Browser\Browser;

abstract class DuskTestCase extends BaseTestCase
{
    use CreatesApplication;

    /**
     * Prepare for Dusk test execution.
     *
     * @beforeClass
     */
    public static function prepare()
    {
        static::startChromeDriver();
    }

    /**
     * Create the RemoteWebDriver instance.
     *
     * @return RemoteWebDriver
     */
    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu',
            '--headless',
            '--window-size=1920,1080',
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )
        );
    }

    /**
     * Create a new Browser instance.
     *
     * @param RemoteWebDriver $driver
     *
     * @return \Laravel\Dusk\Browser
     */
    protected function newBrowser($driver)
    {
        return new Browser($driver);
    }
}

I also run my tests from the php.dusk.xml file. What is the reason I got this error when everything looks right?

PHP 8 Support

Composer won't let me install this on my PHP 8.0 project -- are major code updates needed, or can we just update the composer file to allow for php8 usage? Thanks!

Assets of visited url not found

I have a basic laravel setup that automates the testing of legacy php application. Somehow the images of the legacy app are not show in the dashboard screenshots.
Any ideas ?

Laravel Dusk version 5

Laravel Dusk is now at v5, so when I try and install I get

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/dusk (locked at v5.0.0, required as ^5.0) -> satisfiable by laravel/dusk[v5.0.0].
    - beyondcode/dusk-dashboard 1.0.0 requires laravel/dusk ^4.0 -> satisfiable by laravel/dusk[4.0.x-dev].
    - beyondcode/dusk-dashboard 1.0.1 requires laravel/dusk ^4.0 -> satisfiable by laravel/dusk[4.0.x-dev].
    - beyondcode/dusk-dashboard 1.0.2 requires laravel/dusk ^4.0 -> satisfiable by laravel/dusk[4.0.x-dev].
    - beyondcode/dusk-dashboard 1.0.3 requires laravel/dusk ^4.0 -> satisfiable by laravel/dusk[4.0.x-dev].
    - Conclusion: don't install laravel/dusk 4.0.x-dev
    - Installation request for beyondcode/dusk-dashboard ^1.0 -> satisfiable by beyondcode/dusk-dashboard[1.0.0, 1.0.1, 1.0.2, 1.0.3].

Accordeon tests

would be nice to see collapsable tests instead of just one big list
Accordeon style, default collapsed
image

wrong parent function call in MakesAssertions trait

Probably just a typo in file src/Dusk/Concerns/MakesAssertions.php:

    /** {@inheritdoc} */
    public function assertDontSeeIn($selector, $text)
    {
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);

        return parent::assertDontSeeLink($selector, $text);
    }

needs to return

        return parent::assertDontSeeIn($selector, $text);

Will create a pull request.

Screenshot in readme

Please, add an image of the panel in readme to have a preview of the installed package.

JS Dialog not seen ?

I get this error when running my test Facebook\WebDriver\Exception\UnexpectedAlertOpenException: unexpected alert open: {Alert text :

However when I derive my DuskTestCase from the original one
use Laravel\Dusk\TestCase as BaseTestCase;
I do not get this error...

My testscript expects the alert open, and uses
$browser->acceptDialog();
to close it

Run single test

Hi there!

Dashboard looks amazing! ๐Ÿ’ช

I've got one question. I have more than 200 tests. When I am writing a new one, it would be great not to have to wait for all of them to see my new test running in the dashboard :)
Is it currently possible to run a single test, or a group, or a filter?

Laravel 6.x is not supported

composer require beyondcode/dusk-dashboard --dev

Using version ^1.1 for beyondcode/dusk-dashboard
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for beyondcode/dusk-dashboard ^1.1 -> satisfiable by beyondcode/dusk-dashboard[1.1.0].
- Conclusion: remove laravel/framework v6.10.1
- Conclusion: don't install laravel/framework v6.10.1
- beyondcode/dusk-dashboard 1.1.0 requires illuminate/console 5.6.|5.7.|5.8.* -> satisfiable by laravel/framework[5.8.x-dev], illuminate/console[5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].

No images

I'm getting no images shown. I'm using mix() to show the assets, maybe that's why

php artisan dusk:dashboard Error

When I run php artisan dusk:dashboard
I recive the followed error

ErrorException : simplexml_load_file(): I/O warning : failed to load external entity "file:/C:/SGP-Laravel/phpunit.dusk.xml"

at C:\SGP-Laravel\vendor\beyondcode\dusk-dashboard\src\Console\StartDashboardCommand.php:94
90| }
91|
92| protected function getTestSuitePath()
93| {

94| $xml = simplexml_load_file(base_path('phpunit.dusk.xml'));
95|
96| $directories = [];
97|
98| foreach ($xml->testsuites->testsuite as $testsuite) {

Exception trace:

1 simplexml_load_file("C:\SGP-Laravel\phpunit.dusk.xml")
C:\SGP-Laravel\vendor\beyondcode\dusk-dashboard\src\Console\StartDashboardCommand.php:94

2 BeyondCode\DuskDashboard\Console\StartDashboardCommand::getTestSuitePath()
C:\SGP-Laravel\vendor\beyondcode\dusk-dashboard\src\Console\StartDashboardCommand.php:72

Please use the argument -v to see more details.

guzzle http "^7.0"

Hello,

Is there any way to use your package with guzzleHttp "^7.0" ? Some of other package of my app require this version of guzzle and your package require "^6.3" so i have a conflict!

Can you help me?

regards

Starting test display

Feature request: would be nice to show a spinning icon or something as soon as the test has started and while it is running

Electron app

Would be pretty awesome if there were a electron app of this.

Select folder, start test, zero composer.

Truncated data when using debugbug bar

If debug bar is enabled the amount of data coming back through the websocket means it gets truncated and fails to parse as json, i guess it would also happen with a really large amount of html

When using Components, always getting a "call to a member function collect() on null" error

When I use a component and a $browser->within(new MyComponent, . . .), I'm always getting an error:

    public function test_dashboard_available()
    {
        $this->browse(function (Browser $browser) {
            $browser->within((new Multiselect('#search-status-selector')), function ($browser) {
                $browser->clickOption(3);
            });
        });
    }

Resulting in:

Error: Call to a member function collect() on null

/home/vagrant/code/dusk-dashboard/src/Dusk/Concerns/MakesAssertions.php:262
/home/vagrant/code/a-nice-project/tests/Browser/Components/Bootstrap/Multiselect.php:39

I think the problem is that the Laravel\Dusk\Browser is just doing a new static() to make a Browser for the component -- it doesn't know that it needs to call setActionCollector().

I can work around the bug by passing the BrowserActionCollector through from the test case, and then calling setActionCollector myself before the component uses the browser instance, but this is kinda gross.

I'm not sure what the right way to solve this is!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.