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

Fix flaky tests #163

Merged
merged 32 commits into from
Dec 2, 2019
Merged

Fix flaky tests #163

merged 32 commits into from
Dec 2, 2019

Conversation

zeina-idris
Copy link
Contributor

@zeina-idris zeina-idris commented Oct 21, 2019

  • Fixed most of the obvious flaky tests by adding { timeout } to most buttons that call to the backend
  • CreateCusomer() and Login() are now in different commands in commands.js
  • Show loading animation in cart and order list #160 Handled "isLoading" case in:
    • Cart
    • Order list
    • Product list
  • Added graphqlTimeout option in cypress.json configuration.

Checklist

  • E2E tests

Copy link
Contributor

@lauraluiz lauraluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are very important improvements in this PR that will for sure make tests more reliable. And tests are already green, so flaky tests are not so annoying as they were. What I want to say with this is that whenever you are not 100% sure a timeout helps, remove it. If then you identify a test that is flaky and this is the cause, put it back. But adding timeouts that are not necessary will harm the tests more than not having them.

Looking forward merging this PR to make e2e testing sturdy 💪

src/components/cartdetail/PageCartDetail.vue Outdated Show resolved Hide resolved
src/components/cartdetail/PageCartDetail.vue Show resolved Hide resolved
src/components/productoverview/ProductList.vue Outdated Show resolved Hide resolved
src/components/useraccount/myorders/TabOrderList.vue Outdated Show resolved Hide resolved
tests/e2e/specs/login_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/userProfile_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/userProfile_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/userProfile_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/userProfile_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/cartDetailPage_spec.js Outdated Show resolved Hide resolved
@zeina-idris zeina-idris requested a review from lauraluiz November 7, 2019 16:46
Copy link
Contributor

@lauraluiz lauraluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't manage to review everything today, more tomorrow ;)

src/components/cartdetail/PageCartDetail.vue Outdated Show resolved Hide resolved
src/components/cartdetail/PageCartDetail.vue Outdated Show resolved Hide resolved
src/components/productoverview/ProductList.vue Outdated Show resolved Hide resolved
src/components/useraccount/myorders/TabOrderList.vue Outdated Show resolved Hide resolved
src/components/cartdetail/PageCartDetail.vue Outdated Show resolved Hide resolved
src/components/productoverview/ProductList.vue Outdated Show resolved Hide resolved
src/components/productoverview/ProductList.vue Outdated Show resolved Hide resolved
src/components/useraccount/myorders/TabOrderList.vue Outdated Show resolved Hide resolved
tests/e2e/specs/miniCart_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/orderList_spec.js Show resolved Hide resolved
tests/e2e/specs/pageProductOverview_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/pageProductOverview_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/pageProductOverview_spec.js Outdated Show resolved Hide resolved
tests/e2e/specs/pageProductOverview_spec.js Outdated Show resolved Hide resolved
@zeina-idris
Copy link
Contributor Author

ProductList component was failing in the unit test, because it's expecting products!
So I start the component with v-if=products then we have all the cases in this order:
v-if=isLoading
v-else-if=products.results.length
v-else bad case
Tested it everywhere and works like a charm.

cypress.json Outdated Show resolved Hide resolved
Copy link
Contributor Author

@zeina-idris zeina-idris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Co-Authored-By: Laura Luiz <laura.luiz@commercetools.de>
@lauraluiz lauraluiz merged commit 9ffc33d into development Dec 2, 2019
@lauraluiz lauraluiz deleted the fix-flaky-tests branch December 2, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants