Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [integration-test]

Denotes questions related to integration tests on Magento.

0
votes
1answer
44 views

Error while running the integration test

I am trying to create a integration test to check if my module is enabled or not. Following is the code in my test class <?php namespace Anshu\Learning\Test\Integration; use Magento\Framework\...
2
votes
0answers
22 views

Mocked shared instance incomplete on second identical integration test

I'm writing an integration test on a plugin that changes the action of an existing form. The plugin calls a helper method that decides whether the url should be changed and returns the result. I ...
1
vote
0answers
16 views

Overriding the dev/tests/integration/framework/Magento/TestFramework/Config.php class

I want to override the dev/tests/integration/framework/Magento/TestFramework/Config.php class. Can anyone have an idea about how to override classes inside dev folder?
1
vote
0answers
29 views

Magento Integration Test failing

I am running a suite of tests (integration tests) with Magento 2. One test passes when it runs on its own and fails when it runs as part of the whole testsuite the test uses a local fixture: @...
3
votes
2answers
691 views

Error with integration test

After a fresh install of the latest beta Magento release, I have an error when running integration tests that seems to be related to stock feature. Since the stock has been under heavy development in ...
9
votes
1answer
154 views

Magento 2 : What is the intended use of the integration test functionality?

I write a lot of integration tests for Magento 2. This helps my local development and they fit nicely in a CI way of working. However, there are some oddities about the integration test suite of ...
2
votes
0answers
93 views

Magento integration test conflict with new customer eav attribute

I tried to run my integration test using bin/magento dev:tests:run integration but i always got an error like this: Module 'Company_CutomerExtraAttribute': Upgrading data... [Magento\Framework\...
1
vote
0answers
104 views

MFTF and the replacement of the Functional Testing Framework

I would like to understand more about how this works and how to utilize it properly. I do know It’s not available in the latest version of Magento installed by Composer. You need to install Magento ...
3
votes
1answer
176 views

Disable Module in integration tests / how is the sandbox config.php written

I have set up stock Magento 2 Integration testing as shown in the dev docs. Are disabled certain modules in the app/etc/config.php But when running the test and after deleting that folder, the ...
0
votes
0answers
146 views

Magento 2 : When running integration tests, how can I override some of the dependencies that are injected?

I am running an integration test for Magento 2, but I am at a certain point that my integration test needs a different dependency than my production code. Without going too much into detail as to why, ...
3
votes
1answer
37 views

2.2.3 : Are there situations when @magentoDbIsolation cannot be used in integration tests?

I'm currently experiencing a weird issue. I've written a bunch of integration tests, and it is my understanding that I can use the @magentoDbIsolation annotation to isolate my database transactions ...
3
votes
2answers
378 views

Magento 2 Integration Tests issue for custom attributes

I have created 2 new product attributes that are mandatory (required), "vendor_id" and "delivery_country". After creating this two attributes the integration tests are failing. I executed the ...
1
vote
1answer
78 views

Problems Loading a Custom Model in an Integration Test

I’m working on an integration test that utilizes a custom model and am unable to load the object. Core objects are loading fine. I can create a quote using my own fixture without issue. As far as I ...
1
vote
0answers
32 views

Is it possible to perform integration test end to end in payment gateway (Magento 2.2)?

The payment gateway which perform authorize and capture action by third party , Is it possible to perform integration test from end to end , like start from build request to response and then success ...
1
vote
0answers
226 views

How to use fixture files in Magento2 Integration test?

I am beginner in integration testing and I need a brief highlight on concept of using fixture files in Magento 2 Integration Testing . I tried with following simple code to test what impact in ...
2
votes
2answers
2k views

Magento 2 Integration test can't run - store_website doesn't exist

I am trying to write the integration test. I follow the guide from http://devdocs.magento.com/guides/v2.1/test/integration/integration_test_execution.html to setup the environment. After I updated all ...
5
votes
1answer
433 views

Running an integration test doesn't create a new Magento Installation

When I read the documentation, it is my understanding that when I want to run an integration test, Magento should create a fresh new installation. So I copied install-config-mysql.php.dist to install-...
0
votes
1answer
186 views

How to write a test for custom router and plugin in magento 2?

I have created a module in magento 2 for adding prefix to the url of all product and category. here is the snippet code for the router : /** * Match route pages for handling cp / ip * ...
0
votes
1answer
50 views

How do Magento2 Integration and Functional Test relate to composer vendor folder?

I want to write a full test suite for my new module. Unit tests are no problem as they can be tested in isolation, and therefore can be in a tests folder within the package. However Integration and ...
5
votes
1answer
202 views

Magento 2 Testing Attributes

I've just started working on Magento 2. I created my first custom attribute for the customer entity and now i would like to create a test for it. As far as i understand it, this should be an ...
2
votes
1answer
365 views

Magento 2 Integration Test db-port

I've tried running Magento's built-in integration testing using MySQL:5.7 docker container on a different port. php bin/magento dev:tests:run integration Question is, how can I use a different port? ...
0
votes
1answer
652 views

How can I run phpunit commands from any location in CLI?

In Magento 2 documentation "Running Unit Tests in the CLI" is text: To run all tests, navigate to the Magento base directory and execute the following command: $ ./vendor/bin/phpunit -c ...
3
votes
1answer
339 views

Magento2 - Why would Magento Test Framework - Integration tests fail on a clean composer install

Firstly as I'm using Magento Enterprise I don't think I can pull against a git repository where I know the tests are passing. I presume that these are being run in travis-ci.com rather than .org ...
1
vote
1answer
152 views

Integration test cron job is not running

I want to test code with integration test that uses cron. The code, what runs by integration test, creates entry to cron_schedule table, but cron does not run created cron-job when it is designated. ...
1
vote
2answers
651 views

How to write database integration tests?

I know how to test methods that return some values - that is basic unit testing, but what if I want to test methods that enter values to database. I have found this post, that says integration test ...
1
vote
1answer
580 views

Where does Magento create the catalogsearch_fulltext_scope1 .. n tables?

Magento 2 creates one fulltext search table per store view, but I am wondering where exactly these are created and how I can force it. Context: We have a setup script (InstallData) that creates store ...
2
votes
1answer
732 views

Setup scripts fail integration tests in Magento2

I have setup integration tests for app/code that was working fine. Now I have a module that adds some product attributes in a setup script, it doesn't have any tests but it is part of the project. ...
4
votes
1answer
539 views

Magento 2: How to change config value within one process / request?

For integration tests purposes I need to set a different config value to a single config directive. However the configInterface always returns the value which was set as the first one. Code of the ...
1
vote
2answers
274 views

Magento 2: How long should Unit, Integration and Framework Tests take to run on an unmodified site;

Magento 2: How long should Unit, Integration and Framework Tests take to run on an unmodified site. I am experiencing 10 - 15 minutes for PHPUnit tests Integration tests run for hours and hours... I ...
0
votes
3answers
373 views

Magento CE 1.9.x Testing

We're working on several Magento projects with CE 1.9.X and we're looking for a testing framework to do unit and functional testing. I've done a little research and I've seen posts talking about ...
1
vote
1answer
227 views

Testing magento 2 admin user _isAllowed

Started off building my first module in M2. I'm trying to write a test to prove whether an admin role has the correct resource for the module im building and if not check that the correct return ...
1
vote
1answer
326 views

Magento2 Integration Tests fails when installing data for Magento_Catalog test db throwing Asymmetric transaction rollback

I am trying to run the full set of standard integration tests, which I want to run before deployments on an continuous integration server. (Whilst developing I will run just for my own module using ...
6
votes
1answer
3k views

“Asymmetric transaction rollback error” in integration test

I encountered this error in an integration test. It looks like on shutdown it tries to rollback a transaction which is not open. Stack Trace Fatal error: Uncaught Exception: Asymmetric transaction ...
3
votes
2answers
551 views

Unit Test or Integration Test for this kind of functions?

I have the following resolve function in one of my classes: public function __construct( \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository, \Magento\Framework\Webapi\...
1
vote
1answer
352 views

Testing Block output

I made a customization to the TopMenu and want to run an integration test. I have the following code: /** * Check if menu items have the right URL */ public function testUrlInMenu() { \Magento\...
2
votes
1answer
436 views

Magento 1: module integration test without Ecomdev module

What would be the most simple setup to create controller integration tests for Magento 1 custom module without the Ecomdev module ?
0
votes
2answers
446 views

error on Magento 2 Integration Test

when trying to execute dev:test:run integration getting following error Next Magento\Framework\Exception\LocalizedException: Command returned non-zero exit code: `mysqldump --defaults-extra-file='/...
1
vote
2answers
540 views

Magento 2 integration test in admin context

I'm writing an integration test for Magento 2 where I have to emulate the admin area. To do so, I use the @magentoAppArea annotation: /** * @magentoAppArea adminhtml */ However, some things did ...
1
vote
0answers
95 views

Magento 2 Integration Test for Custom Entity Attribute

I'm developing a Magento 2 module and within it's integration tests I'd like to write a quick test to check if a certain entity (in my case category from catalog module) has a custom attribute by it's ...
1
vote
1answer
47 views

Howto install Magento2 Testframework as dev requirement

until now, I developed my Magento2 Modules in the app/code directory of a running magento2 instance. This is pretty easy and you can run your tests without having much to think about. after reading ...
6
votes
1answer
763 views

Mock dependencies in Magento 2 integration tests

Suppose the following scenario: I have a class that makes calls to an external service The class implements an interface and is defined as preferred implementation for this interface in di.xml A ...
10
votes
2answers
200 views

Test configuration pages with AbstractBackendController: testAclNoAccess fails

I'm writing an integration test for a configuration section and encountered the following failure from the default test cases: My\Module\ConfigTest::testAclNoAccess Failed asserting that 302 is ...
10
votes
2answers
458 views

Can someone explain what the @magentoDbIsolation annotation does for an integration test?

Looking through the integration tests written for the core modules, I see many instances of the annotation @magentoDbIsolation enabled appear above test functions. There's no mention of this ...
2
votes
1answer
898 views

Integration test in magento 2, error display in cmd

Fatal error: Class 'Magento\TestFramework\Helper\Bootstrap' not found in /var/www/html/magento2/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/TypeTest.php on line 17 above error are ...
6
votes
1answer
1k views

Magento 2 integration tests load data fixtures before config fixtures

Let's say I have a method in my integration test with annotations like this: /** * @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php * @magentoConfigFixture ...
25
votes
3answers
4k views

Creating Integration Tests for Magento 2 Modules

So far for my Magento 2 testing needs, I've been using PHP Unit as (more or less) an acceptance tester -- testing results of server and HTML requests made into a system with my module(s) installed. I'...
2
votes
3answers
599 views

Recreate the table in integration tests database

Let's say I created a module that has it's own setup script that should create a new table. Everything installed fine through command line and when I ran integration tests that table was there (in ...