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

Refactor luma tests #48

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

kolaente
Copy link
Collaborator

This PR refactors luma tests, mainly by adding cy.intercept to get rid of calls to cy.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.

@peterjaap peterjaap requested a review from vladhorielov March 29, 2022 09:24
@peterjaap
Copy link
Contributor

@vladhorielov could you do a review on this? Since we're not doing Luma anymore, I have no project to test this on.

Copy link
Collaborator

@vladhorielov vladhorielov left a comment

Choose a reason for hiding this comment

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

I checked the tests, below is a list of tests that do not work now

Copy link
Collaborator

@vladhorielov vladhorielov left a comment

Choose a reason for hiding this comment

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

@kolaente
Copy link
Collaborator Author

@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
Copy link
Collaborator

vladhorielov commented Mar 30, 2022

@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/ ?

@peterjaap
Copy link
Contributor

peterjaap commented Apr 14, 2022

@vladhorielov how is this review going?

@kolaente have you looked at Vlad's results yet?

@kolaente
Copy link
Collaborator Author

@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.

@kolaente
Copy link
Collaborator Author

I think most of the tests should work now - only the account tests needs further testing.

@vladhorielov
Copy link
Collaborator

@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

@kolaente
Copy link
Collaborator Author

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 $?

@vladhorielov
Copy link
Collaborator

You mean the test should work in a store with $?

yes

@vladhorielov
Copy link
Collaborator

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 ?

@peterjaap
Copy link
Contributor

Any work being done on this still @vladhorielov @kolaente ?

@vladhorielov
Copy link
Collaborator

@peterjaap nope from my side. I was just a code reviewer, but it doesn't work for me.

@kolaente
Copy link
Collaborator Author

@peterjaap currently not.

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.

3 participants