LOAD_PLUGINS=1 QUNIT_SKIP_CORE=1 QUNIT_SINGLE_PLUGIN='discouse-humble-box' /home/ravenstorm/.rbenv/versions/2.5.3/bin/rake qunit:test
Chrome is not installed. Download from https://www.google.com/chrome/browser/desktop/index.html
rake aborted!
Command failed with status (1): [LOAD_PLUGINS=1 QUNIT_SKIP_CORE=1 QUNIT_SIN...]
/home/ravenstorm/discourse/lib/tasks/plugin.rake:117:in `block in <main>'
Tasks: TOP => plugin:qunit
Install Chrome and then give it another try.
Oh sorry i’ve pasted an old error code which i had stored in a pastebin 
navigate to http://localhost:60099/qunit?qunit_single_plugin=discouse-humble-box&qunit_skip_core=1&seed=187998423095278311109560784485973475676
Tests timed out
rake aborted!
Command failed with status (124): [node /home/ravenstorm/discourse/vendor/ass...]
/home/ravenstorm/discourse/lib/tasks/qunit.rake:89:in `block in <main>'
Tasks: TOP => qunit:test
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [LOAD_PLUGINS=1 QUNIT_SKIP_CORE=1 QUNIT_SIN...]
/home/ravenstorm/discourse/lib/tasks/plugin.rake:117:in `block in <main>'
Tasks: TOP => plugin:qunit
Try running the test in the browser as David suggested earlier. So, in your browser, when the server is running, go to your-local-site/qunit. Very often, for me, timeouts in the Terminal have errors in JS that I could see and fix after visiting /qunit on the browser.
Thats one of the problems 
I can’t find acceptance tests on my /qunit
Even after turning on all modules and filtering it with box and humble nothing is here 
Try renaming the folder to test/javascripts/acceptance - that extra s is quite important!
You might need to do rm -rf tmp, and then restart your development server for the changes to take effect.
Do what David said above (rename the folder to javascripts), but ALSO, change the name of your plugin in plugin.rb to discourse-humble-box to match the folder name. I did these two changes, and I see tests locally:
Yea i’ve seen those as well now, but these aren’t really eye-opening results tbh.
But gotta dig deeper and lookup why these errors are shown.
Thanks for the help guys.
For example the second test case… if i am testing it myself by hand… it works, but running it on qunit it fails 
Ok, got a brief idea whats bringing me the errors and it confuses me:
http://localhost:9292/ in my browser has the plugin installed and working
http://localhost:9292/qunit the test shows, that the plugin is not even installed
I thought these two are using the same enviroment ?
Could this be caused by my local dev-enviroment since it’s not using docker and I’m not able to install the plugin like Install Plugins in Discourse ? It’s just sitting in the plugins folder like the others.
Any idea how this is possible ?
J’essaie de suivre ce guide, mais je suis bloqué dès le début : je n’arrive pas du tout à accéder à /qunit. (Cela semble également lié à Install Discourse on Ubuntu or Debian for Development, qui est essentiellement l’approche que j’utilise pour déployer Discourse sur ma machine locale afin d’en apprendre le développement, mais ce guide est l’élément déclencheur de mon obstacle, j’ai donc pensé à le mettre ici.) Tenter d’y accéder renvoie une réponse « Cette page n’existe pas ou est privée ».
Le contrôleur pour la route /qunit (discourse/app/controllers/qunit_controller.rb at 166fe3bb34f99bd0baa613726486ce0f13c7a992 · discourse/discourse · GitHub) mentionne qu’il est # uniquement utilisé dans les tests / dev non-ember-cli (le commentaire avant cette méthode), j’ai donc essayé d’exécuter l’instance avec RAILS_ENV=test bundle exec rails server, mais EmberCli.enabled? est toujours true.
Quelle approche utilisez-vous pour exécuter un serveur de développement local afin que nous puissions réellement accéder à /qunit (ce qui implique probablement de désactiver EmberCLI) ? (Je manque certainement quelque chose d’évident.)
Le nouveau chemin est /tests. Je mettrai à jour le message initial - merci !
Super, merci ! Passons à l’obstacle suivant :
Ce lien direct vers le test d’acceptation particulier donne une erreur (avec une trace d’appels) :
Erreur : Aucun test ne correspond au module "Acceptance: Purple Tentacle".
En effet, lorsque je recherche dans la liste déroulante “Module :”, je ne vois rien qui corresponde à “purple” ou “Purple”. Y a-t-il une nouvelle partie du système pour enregistrer des plugins ou leurs tests qui pourrait manquer ici ?
Si je recherche “purple” en utilisant la zone de texte “Filtre :”, cela m’amène à l’URL suivante : http://localhost:4200/tests?filter=purple, ce qui me donne une erreur différente :
Erreur : Impossible de trouver le module `helpers/qunit-helpers` importé depuis `discourse/plugins//acceptance/purple-tentacle-test`
at missingModule (http://localhost:4200/assets/vendor.js:259:11)
Avez-vous des idées sur ce qui pourrait être déplacé ici ?
Par ailleurs, l’URL /tests utilise-t-elle la route “catch-all” get "*url", to: 'permalinks#show' et donc Permalink.find_by_url pour la résolution réelle ? Si oui, à quel moment de l’initialisation de Discourse le mappage de l’URL /tests est-il chargé dans la base de données ?
@jlc, merci beaucoup d’avoir essayé notre guide et de nous tenir informés. ![]()
J’ai apporté quelques modifications au test d’acceptation exemple de l’OP pour refléter certains nouveaux changements que nous utilisons pour les tests d’acceptation. Essentiellement, les deux changements sont :
- les importations, et
- l’utilisation de la constante
needsdansacceptance
Cela devrait résoudre la plupart des problèmes que vous avez mentionnés. Vous pouvez également utiliser certaines des options needs ici :
Examiner l’ensemble du fichier qunit-helpers serait également très utile !
