Closed (outdated)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Tests
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
22 Feb 2011 at 22:48 UTC
Updated:
19 Feb 2019 at 13:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
recidive commentedI added tests for paying during checkout, validating payment information, and adding payments through admin UI.
https://github.com/recidive/drupalcommerce/tree/1069896
I'm moving to needs review, but actually it can be improved to testing adding new payment method and offsite payments.
Comment #2
recidive commentedI added tests for payment method rules.
Can we commit those tests and work on offsite payment tests in another issue?
Comment #3
rszrama commentedSounds like a plan. In fact, you can spawn two child issues. One for adding and testing an example payment method for a redirected service. Another for adding and testing an example CC payment method.
Committed this.
Comment #4
pcambraA couple of things after reviewing this:
Comment #5
recidive commentedI did the following improvements to payments tests, but was not able to post an update here due to Git migration.
From the commit message:
https://github.com/recidive/drupalcommerce/commit/22daa8bbff26a86d78c2be...
@pcambra, I think we can leave the assertions there in createOrderAndGoToPayment(), since they are basically checking if we are on the correct pages. Will the $this->assertFieldById() work for ajax posts too?
I'll add the access check tests.
Comment #6
recidive commentedAdded access checks:
https://github.com/recidive/drupalcommerce/commit/fc82c478303e1b7e0d59bc...
Comment #7
pcambraDo we really need to keep assertions in each process?
I'm working in customer tests now and I'm going to include the generic "create order" with customer information filled in the commerce_base so we don't have to include it all over again (payment tests and tax tests include it and probably checkout tests can get benefit of this function as well), so there will be a commerce base test that ensures that the piece of code is correct, I'll update this issue as soon as we can include it.
With the new payment method access to administration test, we can get rid of the assertion in testCommercePaymentAdministration for 200 response (line 178)
and in testCommercePaymentMethodsAdministration (line 239)
I think we need to complete a payment, currently testCommercePaymentAdministration only "pays" half of the order total
Also we should create a helper module for offsite payments and test that the payment redirect happens, that the offsite button is present and so on.
I tested the replacement of assertFieldByXPath by assertFieldById and it seems safe even after the postAjax.
Comment #8
recidive commented"I think we need to complete a payment, currently testCommercePaymentAdministration only "pays" half of the order total"
This was done in #5.
It's not clear in your comment what needs work.
Comment #9
pcambraI pulled from your github repo for this branch (1069896) and I can see changes in #6 but not changes in #5, maybe you could take a look to this and put together the changes in a patch?
Comment #10
recidive commentedComment #11
pcambraI've merged all the on-going tests in this issue #908302: Complete "version 1.0" of the CommerceBaseTestCase
Setting this to needs work as we need to create a helper module for offsite payments and test that the payment redirect happens, that the offsite button is present and so on.
Comment #12
pcambraAdded new testing for offsite payment methods
Repo: git.drupal.org:sandbox/pcambra/1081200.git
Branch: 1069896
Diff: http://drupalcode.org/sandbox/pcambra/1081200.git/commitdiff/52033605dd5...
Comment #13
rszrama commentedDoes this need to stay in needs work mode? I've pulled those changes in, but we can further extend the tests by defining "remote" URLs in that module - i.e. page callbacks that redirect right back to the success or failure page to ensure the checkout workflow is correct. It doesn't really matter that we aren't actually redirecting to a URL on a separate domain, just that there's some sort of redirect and that we test a return that either simulates a customer cancellation, a failed payment, or a successful payment.
Comment #14
bojanz commented