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

Invalid entity_type specified: catalog_product #27

Open
adam-j-martin opened this issue Jun 25, 2013 · 19 comments
Open

Invalid entity_type specified: catalog_product #27

adam-j-martin opened this issue Jun 25, 2013 · 19 comments
Labels

Comments

@adam-j-martin
Copy link

Hi there,
Great work on this. However, I have the following error when following the example in the documentation here.

F---

(::) failed steps (::)

  1. Invalid entity_type specified: catalog_product
    In step Given the following products exist:'. # AdminUserContext::theProductsExist() From scenario Turn off reviews per product'. # features\admin_user_manages_review_visibility.feature:6
    Of feature `Admin User can manage review visibility'. # features\admin_user_manages_review_visibility.feature

1 scenario (1 failed)
4 steps (3 skipped, 1 failed)
0m0.109s

any help appreciated :)

@debo
Copy link
Contributor

debo commented Jun 26, 2013

Hi @adam-j-martin thanks for your feedback and issue report. I just tried to replicate your issue on my environment but without luck unfortunately. The error you are getting is coming straight out of Magento which is not able to find a specific entity into EAV.

Could you please verify that the BehatMage extension is enabled in the behat.yml file and that the data-install scripts has been properly executed? Do you know how to verify that? Also, did you refreshed or reloaded the page to ensure that the data-install script runs.

Please let me know how do you get on with it.

Thanks,
Debo

@adam-j-martin
Copy link
Author

Hi Debo,
This is what I have in my behat.yml - I am not sure if everything is in there that is needed. And sorry, data install scripts? Do you mean magento ones.

default:
formatter:
name: progress
paths:
bootstrap: '%behat.paths.features%/bootstrap'
extensions:
MageTest\MagentoExtension\Extension: ~
Behat\MinkExtension\Extension:
base_url: http://magento.local
#javascript_session: sahi
#browser_name: firefox
goutte:
server_parameters:
HTTP_HOST: %behat.mink.base_url%
sahi: ~

perhaps I am missing something in my composer.json?

{ "name": "magento-bdd", "description": "Magento BDD", "config": { "bin-dir": "bin" },
"require": {
    "php": ">=5.3.0"
},
"require-dev": {
    "magetest/magento-behat-extension": "dev-develop",
    "magetest/magento-phpspec-extension": "*"
},
"autoload": {
    "psr-0": {
        "": [
            "src",
            "htdocs/app",
            "htdocs/app/code/local",
            "htdocs/app/code/community",
            "htdocs/app/code/core",
            "htdocs/lib"
        ]
    }
},
"minimum-stability": "dev"

}

@adam-j-martin
Copy link
Author

Actually I had to change composer as I got an error about mink sahi driver, so added the following:

"magetest/magento-behat-extension": "dev-develop", "magetest/magento-phpspec-extension": "_", "behat/mink": "_", "fabpot/goutte": "1.0.x-dev", "behat/mink-extension": "dev-master", "behat/mink-goutte-driver":"dev-master", "behat/mink-sahi-driver": "*"

Is it possible to see both your behat.yml and the composer file

@adam-j-martin
Copy link
Author

Still having issues with this. Not sure of the next steps to be honest. The error occurs when running bin/behat before writing any code for Magento. That is, this is failing trying with the product fixture. The exact problem code is:

$id = $this->model->getIdBySku($attributes['sku']);

which is found on line 63 of class Product (which implements FixtureInterface)

@alistairstead
Copy link
Contributor

I have not had time to test but I think using the mink extension as well as the magento extension may be the problem.

Can you possibly try only loading the Magento extension in you behat.yml?

@debo
Copy link
Contributor

debo commented Jun 27, 2013

Hi @adam-j-martin,

yes, if you followed the guide in the README.md it tells you to create a data-install script to add an attribute to the product, did you created that script and ensured it ran? Yesterday I went through the documentation to be sure I didn't miss anything and I've not been able to replicate. Investigation is still going on...

@adam-j-martin
Copy link
Author

Hi @marcodebortoli - I appreciate your help on this. I understand what you are saying around the data-install script.. but the error I am getting is in the checking if the product exists - not the check on the new required attribute.

@alistairstead - I did try again with the following behat.yml

default:
formatter:
name: progress
extensions:
MageTest\MagentoExtension\Extension: ~
Behat\MinkExtension\Extension:
base_url: enterprise.local
goutte:
server_parameters:
HTTP_HOST: %behat.mink.base_url%

sorry about the formatting

@debo
Copy link
Contributor

debo commented Jun 27, 2013

@adam-j-martin : I understand, but that's indeed Magento raising an exceptions because it cannot find a particular entity for what I can see and it's investigated also here:
http://www.magentocommerce.com/boards/viewthread/4719/

Regarding the behat.yml file this is what I'm currently using:
https://gist.github.com/MarcoDeBortoli/9cca7bcb1ff9285a0b60

@adam-j-martin
Copy link
Author

capture

this is at the step immediately after adding the step definition to the AdminUserContext. Also, to eliminate the issue being around the attribute I have created it manually for now and assigned it to the default attribute set. I also manually created the product.

Cheers

@debo
Copy link
Contributor

debo commented Jun 27, 2013

@adam-j-martin can you please gist the output of the following command:

$ bin/behat -dl

Thanks

@adam-j-martin
Copy link
Author

@marcodebortoli
https://gist.github.com/adam-j-martin/5876759

One thing to mention is that I am testing with Enterprise 1.13.0.1
I have tried to comment out a few things as tests - i.e providing the correct id instead of getting it to look it up.. but then it just moves the problem to the fixture save. So definitely an issue with the magento model as you say. But I have tried this on several different machines now

@debo
Copy link
Contributor

debo commented Jun 27, 2013

Mmmm the last given in your list looks a bit suspicious to me. This is my output after following steps by steps the README.me

https://gist.github.com/MarcoDeBortoli/dc9b2a418641d878fac3

Could you please verify and confirm that your context file extends MagentoContext?

@adam-j-martin
Copy link
Author

@adam-j-martin
Copy link
Author

@marcodebortoli

https://gist.github.com/adam-j-martin/5877032

this is the verbose output - I have just copied your behat.yml exactly (changing the base url) and now the error is not a fatal (good) but a failing test (good)... but not getting the message about missing attribute but still the message about invalid entity_type.

@debo
Copy link
Contributor

debo commented Jun 27, 2013

Hi @adam-j-martin ok in complete honesty I didn't try the extension with the that EE version yet. I'm going to test it straight away and let you know as soon as I have some results.

@adam-j-martin
Copy link
Author

Hi @marcodebortoli - Magento have removed the download of that version - so let me know if you need me to send you a copy... or I could zip up my bdd project completely for you (along with db)

@debo
Copy link
Contributor

debo commented Jun 27, 2013

I have that version, but yes, if you can share with me your project, given it doesn't contain any sensitive informations, that will surely help me nail down the problem especially if it's due by something specifically related to it. Thanks.

@adam-j-martin
Copy link
Author

@marcodebortoli - Shall I wetransfer.com the archive to you? what email address please

@debo
Copy link
Contributor

debo commented Jun 27, 2013

@adam-j-martin I just emailed you.

@jamescowie jamescowie added the bug label Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants