As a backend developer, you might need to connect your application to the Shopozor's management frontend. The development docker image is produced manually upon every PR merging into the dev
branch. You can start the management frontend like this:
docker run -p 5000:5000 -it softozor/shopozor-management-frontend:production-dev
-
All Softozor members are whitelisted
-
When a white-listed author opens a PR, she is triggering the corresponding unit and acceptance tests automatically
-
When a white-listed member updates a PR, she is triggering the corresponding unit and acceptance tests again
-
The end-to-end tests are not run automatically because not all necessary components might be ready for such tests, thus reducing the relevance of their results (e.g. it can be that the frontend implements a login functionality but that functionality is not present in the backend yet; in that case, the e2e would fail)
-
When a non-whitelisted member opens a PR, the builder will publish the question
Can one of the admins verify this patch?
to the PR's comment; in that case, one of Softozor's admins can- comment
ok to test
to accept the PR for testing - comment
test this please
for one time test run - comment
add to whitelist
to add the PR's author to the whitelist
- comment
You can use the following commands in your comments:
retest this please
: this runs the unit and acceptance tests againtest management e2e
: this runs the end-to-end tests (seems to be currently buggy)
The articles below are pretty useful:
- How to integrate Cypress and Cucumber in your development flow in just a few weeks
- Cypress e2e Testing in the Jenkins Pipeline
Make sure you run the script
.vscode/install-extensions.sh
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected] password: Budzonnerie1
Pre-commit (and pre-push) hooks are configured with husky
(see husky
section of package.json). You also need to activate the hooks for the graphql
and fixtures
submodules. To do that, you run
./common/scripts/activate-hooks.sh
- Browse your
saleor
project folder - Run the following commands
pipenv shell
python ./manage.py runserver
- Browse your
saleor
project folder - Run the following commands
pipenv run ./resetDB.sh
Run quasar dev
The set of fixtures used in our acceptance tests is shared among our various applications' codebases. That is why they come as a submodule. To load that fixtures submodule, upon repo cloning, you need to
git submodule init
git submodule update
During development, new fixture data will be added to the fixtures repo. Upon a git pull
on the shopozor-management-frontend
, those new fixtures will not be pulled automatically. You will also need to do a
git pull
(s'il y a du neuf, on est redirigé vers gnu nano)- dans gnu nano, ^X pour quitter, puis N pour ne pas créer de fichier
git submodule update
To run the tests headlessly (without GUI), run
npx cypress run
To run the tests and manage them with the GUI, run
npx cypress open
To run only a specific scenario or a specific feature
- tag it in the feature file, e.g. with @focus
- launch either
npx cypress run -e TAGS='@focus'
or
npx cypress open -e TAGS='@focus'
It is pretty handy to get the skeleton code for each step of a feature file. That can be reached with the following command for the LogAUserIn
feature
cd cypress/integration/Authentication
npx cucumber-js LogAUserIn.feature
which outputs for example
1) Scenario: Le membre du staff n'est pas encore enregistré # LogAUserIn.feature:13
? Etant donné un utilisateur non identifié
Undefined. Implement with the following snippet:
Given('un utilisateur non identifié', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
? Lorsqu'un utilisateur s'identifie avec un e-mail et un mot de passe invalides
Undefined. Implement with the following snippet:
When('un utilisateur s\'identifie avec un e-mail et un mot de passe invalides', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
? Alors il obtient un message d'erreur stipulant que ses identifiants sont incorrects
Undefined. Implement with the following snippet:
Then('il obtient un message d\'erreur stipulant que ses identifiants sont incorrects', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
npm run test:unit