Open kolaente opened 2 years ago
@vladhorielov could you do a review on this? Since we're not doing Luma anymore, I have no project to test this on.
@vladhorielov How are you running these? Against a default Magento luma installation with test data? What fails?
They work perfectly fine in the instance I tested them in but that's one with a few customizations here and there.
@vladhorielov How are you running these? Against a default Magento luma installation with test data? What fails?
They work perfectly fine in the instance I tested them in but that's one with a few customizations here and there.
I ran on a default Magento 2 Luma with a simple date. I have problem with some selectors and cy.intercept/cy.wait Can you provide a link to the site you tested on? or you can run these tests here for example https://magento2-demo.magebit.com/ ?
@vladhorielov how is this review going?
@kolaente have you looked at Vlad's results yet?
@peterjaap I've looked into it briefly but didn't had the time yet to properly fix this. I hope to get to that next week.
I think most of the tests should work now - only the account tests needs further testing.
@kolaente @peterjaap i just rechecked the tests:
The cart test fails at the coupon code generation stage. I don't think it's right to create code via rest api, as it requires additional steps for testing (create a token and additional logic for the request), what do you think? I think it's better to leave the standard code "H20" for this product "affirm-water-bottle.html"
Category test not working
The checkout test does not work, we also use € as the currency, although the default should be $
Account test still not working
I initially added the create random coupon step because we didn't have a usable coupon in our test dump and I'd have to create one anyway via the api. Might as well do it directly in the test.
The checkout test does not work, we also use € as the currency, although the default should be $
You mean the test should work in a store with $?
You mean the test should work in a store with $?
yes
I initially added the create random coupon step because we didn't have a usable coupon in our test dump and I'd have to create one anyway via the api. Might as well do it directly in the test.
it doesn't work everywhere, i think we need use another way for testing this, the default code "H20" for this product "affirm-water-bottle.html" doesn't work for you ?
Any work being done on this still @vladhorielov @kolaente ?
@peterjaap nope from my side. I was just a code reviewer, but it doesn't work for me.
@peterjaap currently not.
This PR refactors luma tests, mainly by adding
cy.intercept
to get rid of calls tocy.wait
with a fixed number of seconds. There are still a few of those in there but I think this already improves the reliability of the tests. The PR also uses the methods introduced in #47 to assert for success and error messages.The things changed and fixed in this PR are mostly those I noticed while implementing the cypress test suite for a luma based shop. I've also added a few test cases from our MFTF-based testing suite (which we're going to retire very soon, thanks to Cypress!) which may be useful to others.
Each area of changes is in a separate commit, I could also split this PR into multiple smaller ones if that makes it easier to review.