mercredi 3 janvier 2018

Best folder structure for Galen test framework

What's the best way to run Galen using some sort of folder structure? And how to do you handle paths and imports?. All the documentation seems to be written like you want to dump the config file, tests, and spec files in the root folder of a project. I was hoping for something like"

 root
 |-- qa
 |   `-- galen
 |       |-- tests
 |       |   |-- specs
 |       |   |   |-- components
 |       |   |   |   `-- header.gspec
 |       |   |   `-- homepage.gspec
 |       |   `-- homepage.test
 |       `-- galen.config
 `-- env
     `-- drivers
         |-- chromedriver
         `-- firefox

I think I can get this to work with

galen check qa/galen/features/specs/homepage.spec  --url http://ift.tt/1cQFkBe  --size 640x480  --config qa/visual/galen.config

And my config with:

# Driver paths
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Path to Drivers
$.webdriver.chrome.driver=env/drivers/chromedriver
$.webdriver.gecko.driver=env/drivers/geckodriver

Or running homepage.test with:

galen test qa/galen/features/browser.test  --config qa/visual/galen

if homepage.test then contains the command:

check qa/galen/features/specs/homepage.spec

But it feels kind of clunky setting the path to the specs in each test, I thought it would find all gspec files without needing a path from where I run the command in terminal. Is there something that can be added to the config file to append a path to tests and spec folders? Is there a suggested setup structure I'm missing? Also the components and Importing sections don't address how to do this from another folder, which made me think I'm missing something.

Aucun commentaire:

Enregistrer un commentaire