Questions tagged [testing]

All questions related to testing Magento: manual testing, automated testing, unit tests, integration tests, functional tests, static analysis, load test, ...

Filter by
Sorted by
Tagged with
4
votes
0answers
39 views

Running a single MFTF test that is included within a suite

I am trying to only run the test StorefrontVerifySecureURLRedirectCheckout. To run it I am using the following command: vendor/bin/mftf run:test StorefrontVerifySecureURLRedirectCheckout -k (I have to ...
0
votes
1answer
19 views

What is '-c' in the command ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/Vendor/Module/Test/Unit?

I just know I can execute my test file with this command through PHP-Unit framework but haven't figured out what '-c' is for.
0
votes
0answers
15 views

Grift card rest API for ADD TO CART test | Magento 2 ee

I want to use gift card rest API link attached, which is default API available for add giftcard to cart. POST ​ /V1​/carts​/mine​/giftCards Payload { "giftCardAccountData": { "gift_cards": [ ...
3
votes
1answer
35 views

Run Integration/Functional Tests on an Existing Database for Customer Specific Projects

We develop customer specific projects in Magento 2.3.x, with different customer specific extensions. Development is based on a copy of the production database (master.sql), so we do not usually use ...
0
votes
0answers
22 views

Magento 2.3.1 : A/B testing

I am not sure if this question has been asked before but I badly need to know if AB testing can be set up for Magento 2.3.1 community edition. I know it can be done for Magento 2 enterprise edition ...
0
votes
1answer
17 views

How to find core test names to generate specific tests

I am trying to run MFTF tests only for Checkout. In the DevDocs there are various examples how to generate and run specific tests(MFTF - Getting started - Step 4 - Run a simple test, Generate tests ...
0
votes
0answers
28 views

MAGENTO2: HOW TO RUN TEST FILE .XML IN COMMAND LINE

I already have a file called StorefrontLockCustomerOnLoginPageTest.xmlplaced in the folder app\code\Magento\Customer\Test\Mftf\Test\StorefrontLockCustomerOnLoginPageTest.xml which following this code: ...
4
votes
0answers
34 views

Can @magentoDataFixture files be inside the module itself and not on default directory dev/tests/integration/testsuite?

A very good thing about Magento 2 is that we put together all files inside the module itself. Layout XML, Templates, Less/Sass, Blocks, Models, Helpers, API, SQL scripts and everything. It's important ...
1
vote
3answers
138 views

Magento 2 - Test cronjob from browser

I have created a cronjob in: app/code/Vendor/Module/Cron/MyCron.php It's in development phase, so every time I need to check the data or debug anything I am creating a log file and rescheduling it ...
1
vote
1answer
319 views

Error: Class “Yandex\Allure\Adapter\AllureAdapter” does not exist

Preconditions (*) Magento 2.3.1 upgraded from Magento 2.3.0 Php 7.2.15 OS : Ubuntu 18.04 Bionic Phpstorm 2019.1.1 Evnironemnt : Magento development Steps to reproduce (*) Issue appears after ...
1
vote
2answers
44 views

Get product only with attributes used in product listing in a test

In my test I am creating a product like this: $product = $this->objectManagerHelper->create('Magento\Catalog\Model\Product'); $product ->setId(1) ->setTypeId(Product\Type::...
2
votes
2answers
81 views

Magento2 Application Automation Testing - For Automation Testers

I am doing automation testing on Magento2 application for one of my client. I have heard from some people there are some automated testing frameworks for Magento 2. But everything seems to be ...
5
votes
0answers
78 views

Add to cart not working in Magento 2.2.5 performance testing script “benchmark_2015.jmx” for customer account

In Magento2 - I am using Magento benchmark script "benchmark_2015.jmx" for a default Magento(v2.2.5) installation. In Customer Checkout thread group >> "Add to cart" request(http://prntscr.com/mty00o)...
0
votes
1answer
485 views

How to clean up magento2 database programatically?

How can I delete all test data from magento2 database programatically. Is there is any way to run an API and delete all test data?
2
votes
0answers
42 views

What is the correct way to create Mock input interface in Web-Api functional test?

I've already write successfully a Web-Api unit test for a Custom API. But I'm wondering if there is a way to automatically create a Mock for input data for the API? For example, AccountManagement ...
1
vote
0answers
16 views

Need to automate Magento website [closed]

Can any one please tell me what is the difference between automating through MTAF and normal Selenium + TestNG? What can I achieve from MTAF which I can't achieve using Selenium+ Java+ TestNG ? ...
1
vote
1answer
33 views

Magento2 Object Manager Issue in MTF test run windows

I am learning on how to use MTF in my test module. I am trying to run generator using command php generate.php But I am getting following error - Uncaught Error: Class 'Magento\Mtf\...
0
votes
1answer
139 views

Magento Stress test

I've built a website using Magento version 2.2.3. Now, I want to stress test my website. I've heard that the JMeter is one of the best tools for testing the performance of the site. So I used JMeter ...
8
votes
1answer
164 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
294 views

Magento 2 CatalogSearch

Im trying to run my Integration test on magento2 but keep getting the same error. Module 'Magento_CatalogSearch': Installing data... [Magento\CatalogSearch\Model\Indexer\Scope\...
2
votes
0answers
138 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
125 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 ...
7
votes
1answer
1k views

How to setup CI on Magento 2 extension using Bitbucket Pipeline?

How can I prepare a CI script to check the syntax and code quality of my extension code? It's not necessary to run Unit Test or Integration Test, I'm using Bitbucket and I would like to use Bitbucket ...
1
vote
2answers
33 views

Magento 2 : Redirect in case it's not me during dev phase

I've already installed Magento 2 and started with config and uploading products - working quite nice. Now I'd like to forward all traffic to another website (currently just using a index.php with a ...
0
votes
1answer
702 views

Magento 2 Incorrect dependency in class already exists in context object

I created a extension submitted for approval On my local there is Varnish cashe enabled but sudo php bin/magento setup:di:compile runs without any error. I got 6 errors in Technical Report ...
1
vote
1answer
104 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
1answer
34 views

Testing Pull Requests and Patches from Magento 2's GitHub

I'd like to test the following patch applied by the community. As seen here, https://github.com/magento/magento2/pull/13359/files. Since I've always installed Magento via composer, is there an easy ...
1
vote
0answers
61 views

Magento 2 contributing tests to the new MFTF

I would like to know if it's possible to contribute tests to the new MFTF framework. In the documentation it talks about contributing to the MFTF core itself, but not how to contribute tests for it, ...
1
vote
1answer
380 views

Magento 2, how to create a test from a custom module in the new MFTF (magento functional testing framework)

I've read the documentation that is available for the new MFTF for Magento 2, however I can't figure out how to go about creating tests that are located in a different folder other than the folders ...
1
vote
1answer
77 views

Testing/Development Environment on local server

I need to create a local development environment and struggling a little with the setup. I want to replicate my live server as close as I possibly can. I hope I'm posting this question in a right ...
4
votes
2answers
384 views

Magento 2 Remove test data that is generated from Performance Toolkit?

I tried to test Magento 2 performance on my local computer by using the Magento Performance Toolkit, php bin/magento setup:perf:generate-fixtures /var/www/html/magento2/setup/performance-toolkit/...
2
votes
1answer
464 views

What is Magento Functional Testing Framework (MTFT)

With the new release of Magento version 2.2.2 in release notes they have mentioned a new feature as Magento Functional Testing Framework (MTFT). What is this framework do exactly? Is this a option/...
2
votes
0answers
89 views

As a system integrator, what is the recommended set of tests to run on each build?

To clarify, by "System Integrator" I mean, "I am working on a full Magento project, not just a module" I am currently working with Travis and already am using composer to import all custom extensions ...
2
votes
1answer
205 views

Local Magento installation on MAMP Pro - Unable to view site on iPhone or any other mobile device

Installation: MAMP Pro: 4.2 Magento 1.9.X everything is working perfectly on the local machine, however when I view the site on mobile iPhone, connected to the same network. I get an error: Not ...
1
vote
1answer
407 views

Magento 2 Short array syntax is not allowed while Module testing.

Magento 2 module testing tools gives error "short array syntax not allowed", we do code like following public function toOptionArray() { return [ ['value' => 0, 'label' =&...
6
votes
2answers
154 views

What we can achieve by unit test in Magento 2 ? How it is useful?

I don't know how can we do unit test of our module in Magento 2? What will be benefits of doing a unit test on our Magento 2 module? what will be the outcome of the unit test in Magento 2? Which ...
3
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 ...
0
votes
1answer
104 views

Magium for selenium tesing not working with magento2.2

composer require magium/magento You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug Using version ^0.6.11 for magium/...
1
vote
2answers
450 views

Magento 2 Unit test for exception

Got a basic question about handling Exceptions in Magento 2. I'm currently on Magento 2.2 with PHPUnit 6.2.4. I would like to write a test for a CouldNotSaveException. Got the following code example ...
6
votes
1answer
412 views

Unit test Issue on getting value

I am creating a unit test for my simple method, this method get the value from requestHeader here is my class which I want to create test class namespace Vendor\Module\Helper; use Magento\Framework\...
3
votes
1answer
2k views

What is the correct way to create mock object in unit test

Now days I am focusing on TDD development, and I am following the Magento test class for reference. So firstly I look into Contact module (as it is the small module) and I found that in DataTest.php ...
6
votes
1answer
91 views

Static Application Security Testing (SAST) results Magento Module

I have developed a payment gateway module. Now I need to generate Static Application Security Testing(SAST) result report for ensure all code is scanned for vulnerabilities into my payment module. Is ...
4
votes
1answer
475 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
214 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
56 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 ...
0
votes
1answer
63 views

Session in api-functional tests isLoggedIn always returns false

I have a function in an API call that checks $this->session->isLoggedIn(). The session-object is injected via the consturtor. Now I have to write an api-functional test. But I just can't login ...
0
votes
1answer
495 views

Automated tests: orders, product views and usability for Magento 2

I'm looking for a way to automate testing on multiple websites. Now I'm pretty new to the testing part of Magento 2 and there seems to be a lot of ways to test in Magento 2, like unit testing, ...
5
votes
1answer
244 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
472 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? ...
1
vote
0answers
37 views

Run Tests in Magento 2 for JavaScript issues

Is there a way I can run tests for JS in Magento 2, we have found quite a few errors in the console, I was just wondering if I could run a test from the cli. Thanks