Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests - Replace duplicated steps with foreach for brands tests #16403

merged 2 commits into from Nov 14, 2019


Copy link

boubkerbribri commented Nov 13, 2019

Questions Answers
Branch? develop
Description? Replace duplicated steps with foreach for brands tests
Type? refacto
Category? TE
BC breaks? no
Deprecations? no
Fixed ticket? no
How to test? TEST_PATH="functional/BO/catalog/brandsAndSuppliers/brands/*" URL_FO=SHOP_URL npm run specific-test

This change is Reviewable

@boubkerbribri boubkerbribri added this to the milestone Nov 13, 2019
@boubkerbribri boubkerbribri requested a review from PrestaShop/prestashop-core-developers as a code owner Nov 13, 2019
Copy link

PierreRambaud left a comment

I love it!

@boubkerbribri boubkerbribri added the TE label Nov 13, 2019

This comment has been minimized.

Copy link

SimonGrn commented Nov 14, 2019

I love it!

I'm not a huge fan of it, since it "breaks" the tests steps: you don't have an it for every step, you have some it and some loops.

@SimonGrn SimonGrn merged commit 3df285c into PrestaShop:develop Nov 14, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Travis CI - Pull Request Build Passed
@boubkerbribri boubkerbribri deleted the boubkerbribri:usingForEachForBrands branch Nov 14, 2019

This comment has been minimized.

Copy link

PierreRambaud commented Nov 14, 2019

@SimonGrn Data Providers allow to define tests once and run them multiple times with different datasets.
You still have an it each time you run an test, only parameters are changing 🤔 This is one of the best practice in every testing language / framework, at least to remove duplicate code / logic :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
PrestaShop 1.7.7
Awaiting triage
4 participants
You can’t perform that action at this time.