sylius / pluginskeleton Goto Github PK
View Code? Open in Web Editor NEWSkeleton for starting Sylius plugins.
Home Page: https://sylius.com/plugins/
Skeleton for starting Sylius plugins.
Home Page: https://sylius.com/plugins/
Hi, guys.
It looks like JS behat tests failing due to some session or auth issue:
$ vendor/bin/behat
@managing_products
...
@ui @javascript
Scenario: Adding a text attribute to product
Given I want to create a new simple product
Expected to be on "http://localhost:8080/admin/products/new/simple" but found "http://localhost:8080/admin/login" instead (Sylius\Behat\Page\UnexpectedPageException)
PS: I've followed all installation steps for clean copy of latest plugin skeleton. Chromedriver and selenium server also latest.
Also, how about adding it to travis and add badges? As I can see - config is ready for that.
Thanks
It would be nice to have dev environment near to test one. Even though BDD is great, sometimes running an app on separate database makes life easier, for example when a dev wants to write some dummy code before deciding if the whole feature should be implemented in a specific way.
Something went wrong with merge conflicts and once project is created and pushed to the master, the application files from web folder are not tracked by git.
Ref. https://github.com/Sylius/PluginSkeleton/blob/1.1/tests/Application/.gitignore#L6-L10
Why cache and logs directories are being set to the system's root /tmp
instead of project /var
? Can I set it to default path or will it cause some unexpected problems?
It's a common use case to install/uninstall plugins for any e-commerce plateforme.
If I create a plugin which require to extend the DB schema by new columns/tables, how can I tell my customers to install this plugin: there should be simple and unique procedure to apply on all Sylius plugins.
I don't think I should ask them to exec app/console doctrine:schema:update --force
Same question: how can I guide them to uninstall it?
Magento2 for example, offers a command to enable/disable + install/uninstall plugins.
Also it gives plugin developers a clear interface to write install/uninstall scripts (similar to doctrine migrations)
Isn't it a good idea to have PHPSpec and PHPUnit by default in the travis.yml build file?
Getting Yarn to work on Travis-CI is a bit tough, let's wait for @pamil. :)
After running yarn install
, is unable to run successfully yarn run gulp
, which output is:
\tests\Application> yarn run gulp
yarn run v0.22.0
$ gulp
[14:31:24] Using gulpfile C:\Coding\php\SyliusMyPlugin\tests\Application\gulpfile.js
[14:31:24] Starting 'admin'...
[14:31:24] Finished 'admin' after 11 ms
[14:31:24] Starting 'shop'...
[14:31:24] Finished 'shop' after 3.82 ms
[14:31:24] Starting 'default'...
[14:31:24] Finished 'default' after 41 μs
[gulp-chug] Gulpfile, Gulpfile.js, contents is empty. Reading directly from disk...
events.js:160
throw er; // Unhandled 'error' event
^
Error: Problem finding locally-installed `gulp` for gulpfile �[35mundefined�[39m. (Try running `npm install gulp` from �[35mC:\Coding\php\SyliusMyPlugin\vendor\sylius\sylius\src\Sylius\Bundle\AdminBundle�[39m to install a local gulp for said gulpfile.)
Error: Cannot find module 'gulp' from 'C:\Coding\php\SyliusMyPlugin\vendor\sylius\sylius\src\Sylius\Bundle\AdminBundle'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Also tried to run npm install gulp
, which also installed globally, but it not helped. Windows 10 x64
The AppKernel
class alway loads the default configuration file config.yml
but it should load the config_dev.yml
in dev-mode and so on.
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
Add bin/console
directly to the plugin template, so it can be run easier and not from tests/Application
.
After cloning this repo I went to the tests/Appliation
folder and followed the instruction in the README. Therefore I did
yarn install
-> works fineyarn build
-> errors:yarn run v1.10.1
$ gulp build
[12:53:17] Failed to load external module @babel/register
[12:53:17] Requiring external module babel-register
[12:53:18] Using gulpfile ~/Development/Sylius/PluginSkeleton/tests/Application/gulpfile.babel.js
[12:53:18] Starting 'build'...
[12:53:18] Starting 'buildAdmin'...
[12:53:18] Starting 'buildShop'...
[12:53:18] 'buildAdmin' errored after 19 ms
[12:53:18] Error: File not found with singular glob: /Users/sok/Development/Sylius/PluginSkeleton/tests/Application/../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js (if this was purposeful, use `allowEmpty` option)
at Glob.<anonymous> (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob-stream/readable.js:84:17)
at Object.onceWrapper (events.js:273:13)
at Glob.emit (events.js:182:13)
at Glob.EventEmitter.emit (domain.js:442:20)
at Glob._finish (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:197:8)
at done (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:182:14)
at Glob._processSimple2 (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:688:12)
at /Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:676:10
at Glob._stat2 (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:772:12)
at lstatcb_ (/Users/sok/Development/Sylius/PluginSkeleton/tests/Application/node_modules/glob/glob.js:764:12)
[12:53:18] 'build' errored after 26 ms
[12:53:18] The following tasks did not complete: buildShop
[12:53:18] Did you forget to signal async completion?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Hello, I'm not able to run the skeleton. when I do:
php bin/console server:run --env=dev --docroot=/path/to/MyPlug/tests/Application/web
I got error:
**
ChannelNotFoundException Twig_Error_Runtime
HTTP 500 Internal Server Error
An exception has been thrown during the rendering of a template ("Channel could not be found! Tip: You can use the Web Debug Toolbar to switch between channels in development.").**
After installing a new project, and launching all the commands, then running the behat tests with Selenium, the context "I am logged in as an administrator" doesn't seem to be working.
I can see that a user is created in the database, but I am not logged in : the 3 example scenarios accessing the admin part of the website are failing because I am redirected to the login page.
Expected to be on "http://localhost:8080/admin/products/new/simple" but found "http://localhost:8080/admin/login" instead (Sylius\Behat\Page\UnexpectedPageException)
Is there a configuration that I am missing somewhere ? For the sessions ? The cache ? Something else ? The weird thing is that if I launch the website on http://localhost:8080, I can log in, and go to the given pages without problem.
The README mentioned to execute the bin/console
command to install the assets. However the command was not found because it is not executable by default. Add chmod +x bin/console
to the README file.
During last trainings I've noticed that it would be useful to have full dev env capabilities enabled by default. (Web Debug Toolbar and Profiler)
Currently, the db.sql file is shared between dev and test environment. Sometimes it's a little bit annoying as Behat Doctrine hook context clears the database the developer could have filled with some dev data.
Currently, the db.sql
file is placed in var/cache
directory which makes clearing the cache tricky. Moving it to var/db
location should fix this issue.
Current installation requires "sylius/sylius": "~1.4.0@dev",
. Can't that just be that latest supported Sylius version? In that case plugin developers take a wider range of Sylius versions in mind (also should maybe be tested against in Travis), and not only using latest versions. Makes plugins available to a bigger group of developers.
Shouldn't it be renamed to Plugin and make use of the special Trait?
Running $ yarn run gulp
does not parse ShopBundle and AdminBundle private files. This may be related to invalid path configuration in Gulpfile in tests/Application
.
Hi guys,
I think that we should use the .env
file inside tests/Application
as the only .env
file used both for CI and for development.
Currently, if we want to use .env
files, to make the plugin work locally we need to copy .env.test.dist
to .env.test
and to .env
(we don't want to do set -a && source tests/Application/.env.test && set +a
locally). Then in the .env
file we can do our changes (for example use a SQLite DB).
I propose to change the following line:
Line 13 in c084945
to:
env_file: tests/Application/.env
It this way we can remove set -a && source tests/Application/.env.test && set +a
from the .travis.yml
file and then also remove all the -e test
from all the commands in the README.
What do you think?
Hi, I tried latest skeleton setup and followed all given instruction. When I tried dynamic route :
http://localhost:8000/dynamic-welcome
or http://localhost:8000/dynamic-welcome/waqar
I got following exception:
(1/1) FatalThrowableError Type error: Argument 1 passed to FOS\RestBundle\Controller\ExceptionController::__construct() must be an instance of FOS\RestBundle\View\ViewHandlerInterface, none given, called in /home/waqar/mydev/salesperson/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php on line 202
Please guide for this.
Hi, I tried a Plugin Skeleton, but behat tests failed for default features:
@managing_products
Feature: Adding a new product with text attribute
In order to extend my merchandise with more complex products
As an Administrator
I want to add a new product with text attribute to the shop
Background:
Given the store operates on a single channel in "United States"
And the store has a text product attribute "Gun caliber"
And the store has a text product attribute "Overall length"
And I am logged in as an administrator
Type error: strpos() expects parameter 1 to be string, null given (Behat\Testwork\Call\Exception\FatalThrowableError)
#1 vendor/sylius/sylius/src/Sylius/Behat/Service/Setter/CookieSetter.php(50): Sylius\Behat\Service\Setter\CookieSetter->prepareMinkSessionIfNeeded()
#2 vendor/sylius/sylius/src/Sylius/Behat/Service/SecurityService.php(103): Sylius\Behat\Service\Setter\CookieSetter->setCookie('MOCKSESSID', 'bf43018f907a5ca...')
#3 vendor/sylius/sylius/src/Sylius/Behat/Service/SecurityService.php(62): Sylius\Behat\Service\SecurityService->setToken(Object(Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken))
#4 vendor/sylius/sylius/src/Sylius/Behat/Context/Setup/AdminSecurityContext.php(74): Sylius\Behat\Service\SecurityService->logIn(Object(Sylius\Component\Core\Model\AdminUser))
#5 [internal function]: Sylius\Behat\Context\Setup\AdminSecurityContext->iAmLoggedInAsAnAdministrator()
Can you advice what is the configuration which will make this work, please?
Would be great if the documentation mentioned that.
See Sylius/Sylius#8340.
By including Sylius' behat.yml.dist
we require dependencies that are not necessary, but can not be disabled:
behat/mink-selenium2-driver
friends-of-behat/performance-extension
friends-of-behat/variadic-extension
lakion/mink-debug-extension
Continuation of #11
Can we mention in the README that the plugin can run in other environments than test? 🙂
Hi there!
Would it be possible to customize the SyliusPluginTrait
so that it accepts Model
namespace instead of Entity
for Doctrine declarations?
When trying to install the plugin skeleton we get an error from the Nelmio Alice bundle.
Command:
(cd tests/Application && bin/console assets:install web -e test)
Error:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "NelmioAliceBundle" from namespace "Nelmio\Alice\Bridge\Symfony".
Did you forget a "use" statement for another namespace? in /Users/*/projects/syliusplugin/vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Application/Kernel.php:103
See related project https://github.com/Sylius/Sylius/projects/4.
Currently yarn=0.21.3-1
is being used. Is there anything preventing using the latest Yarn version in Travis CI?
Let's assume I am working on SyliusWalletPlugin which extends user to have wallet feature as follows
In my plugin, I have defined interface and walletableTrait
UserWalletInterface extends UserInterface
{
public function getWallet();
}
Now the end user who uses the plugin needs to implement UserWalletInterface and include wallatable trait.
Now how one can do Behat scenario testing which doesn't have a working User class which can only be implemented at the end user.
I would add somewhere in the README that to be able to launch the database commands, you have to modify the .env files in tests/Application with your database credentials.
Also, I had to search in the database if there was any admin users created, and by chance the password is the same as the username, so I would also add in the readme that you can access the admin panel with the username sylius and the password sylius.
I'm trying to test app in my browser, as written in Readme.md, but receive this error:
MyTestPlugin\tests\Application> php bin\console server:run -e test
[ERROR] The document root directory "C:\Coding\php\MyTestPlugin/public" does not exist.
As soon as I'm trying to use the channel context anywhere and do XML / API testing on it (PHPUnit) I get the error that the Channel could not be found. I'm using the default fixtures and the skeleton application.
Is there a way I can set the single channel available in the fixtures as the one being used before I run the tests?
Because the SyliusPluginSkeleton is just a Symfony app, some more advanced plugins can be presented as the demo app. That being said, in this case, it'd require a front controller for prod environment.
Because the monolog is disabled, the logs are not being saved.
Currently, the plugin does not allow to use Model namespace for Doctrine models. Following this Sylius standard in it would be nice.
Trying to override a custom entity resource in the plugin with the docs-recommended way causes table exists Doctrine error. Here's the use case - BitBagCommerce/SyliusCmsPlugin#36.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.