We need functional tests for Products:

  • List and CRUD for product types
  • List and CRUD for products
  • Breadcrumbs

Comments

artusamak’s picture

Assigned: Unassigned » artusamak

Is it necessary to add fields to a product type for the CRUD testing?

rszrama’s picture

Hmm, I was going to say no, but then I realized that we actually will need to test it - reason being we'll want to make sure that adding required fields with a fixed number of options affects the add to cart form. I figure it's worth baking that functionality into our DrupalCommerceWebTestCase and at least asserting that the fields are showing up on the product add / edit forms. Then the Cart module's tests will need to assert that the fields are being used as "Attribute" selectors on the add to cart form.

artusamak’s picture

When i'm doing the following assertion to verify that the list of the products is okay:

$this->drupalGet('admin/commerce/products');

The response code is a 403, i settled the right permissions and i don't know why i got this code. I saw that the url admin/commerce/products was defined in a view but the Products view only define the following path: admin/commerce/products/list.

Isn't something wrong? :)
Thanks.

rszrama’s picture

Hmm, not sure. Views appearing in tabs is still voodoo to me... I don't really know how it handles them, I just managed to find the right combination of options that made the IA work for me. Does the assertion work if you use the /list URL?

artusamak’s picture

Yes that's what i tried instead and now... when i'm doing a get assertion on admin/commerce/products/list i'm always getting a 404...
Views issue ? :)
I'll see with Damz tomorrow.

rszrama’s picture

When in doubt, blame DamZ. : D

Also, you might chat with auzigog in the #drupalcommerce channel. He's been doing some testing work as well, and I'd hate for you guys to accidentally write the same stuff. His repository is http://github.com/auzigog/drupalcommerce.

Anonymous’s picture

Oh I'm glad someone already started an issue around this! I though I was just caught in simpletest hell (well... I kind of am).

I happened to be attempting to trying $this->drupalGet('admin/commerce/products'); myself and encountering the same problem! Same goes for admin/commerce/products/list.

admin/commerce/products redirects me to /store but still has the products tabs along the top. This page used to give me an access denied error until I threw 5 different clear_cache_all() calls throughout the test.

admin/commerce/products/list gives me 404 not found.

It drove me crazy all day today when I was trying to verify if a product creation function was acting properly.

Artusamak, hit me up in IRC tomorrow. I'll be there all day (starting around 8am PST).

pcambra’s picture

  • Access the product listing
  • Add a product
  • Edit a product
  • Delete a product
  • Access product types
  • Add product type
  • Edit product type
  • Delete product type
  • Test access to manage and display fields
  • Check the admin breadcrumbs
  • Normal users can't access to admin pages or disabled products
pcambra’s picture

rszrama’s picture

Status: Needs review » Fixed

You are THE MAN. Thanks, Pedro... committed. ; )

Status: Fixed » Closed (fixed)
Issue tags: -Commerce Sprint August 2010

Automatically closed -- issue fixed for 2 weeks with no activity.