Soumettre la recherche
Mettre en ligne
Magento2.3 API Functional Testing
•
1 j'aime
•
296 vues
V
Vishwas Bhatnagar
Suivre
How to write and execute functional test cases in magento2.
Lire moins
Lire la suite
Logiciels
Signaler
Partager
Signaler
Partager
1 sur 39
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
Mathew Beane
Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2
Max Pronko
Testing with Spring: An Introduction
Testing with Spring: An Introduction
Sam Brannen
Magento Indexes
Magento Indexes
Ivan Chepurnyi
Introduction To Appium With Robotframework
Introduction To Appium With Robotframework
Syam Sasi
JCConf 2022 - New Features in Java 18 & 19
JCConf 2022 - New Features in Java 18 & 19
Joseph Kuo
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi
Customizing Theme and Style for Material Design : Droid Kaigi 2016
Customizing Theme and Style for Material Design : Droid Kaigi 2016
Yuki Anzai
Contenu connexe
Tendances
ProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and Tricks
netomi
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
MICHRAFY MUSTAFA
Thinking in react
Thinking in react
aashimadudeja
Difference between xml and json
Difference between xml and json
Umar Ali
Une introduction à Javascript et ECMAScript 6
Une introduction à Javascript et ECMAScript 6
Jean-Baptiste Vigneron
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Koichi Sakata
Laravel の paginate は一体何をやっているのか
Laravel の paginate は一体何をやっているのか
Shohei Okada
WordPress REST API hacking
WordPress REST API hacking
Jeroen van Dijk
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
Bartłomiej Żyliński
Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用
Tokuhiro Matsuno
Spring starterによるSpring Boot Starter
Spring starterによるSpring Boot Starter
Ryosuke Uchitate
SwiftのDI方法につい て最近考えてた話
SwiftのDI方法につい て最近考えてた話
Yahoo!デベロッパーネットワーク
Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8
AppDynamics
Appium & Robot Framework
Appium & Robot Framework
Furkan Ertürk
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
Roel Hartman
4장. Class Loader
4장. Class Loader
김 한도
Maven
Maven
Mourad HASSINI
MVC ppt presentation
MVC ppt presentation
Bhavin Shah
Angular.pdf
Angular.pdf
Jaouad Assabbour
Angular 11
Angular 11
PapaDjadjigueye
Tendances
(20)
ProGuard / DexGuard Tips and Tricks
ProGuard / DexGuard Tips and Tricks
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
Thinking in react
Thinking in react
Difference between xml and json
Difference between xml and json
Une introduction à Javascript et ECMAScript 6
Une introduction à Javascript et ECMAScript 6
Graal in GraalVM - A New JIT Compiler
Graal in GraalVM - A New JIT Compiler
Laravel の paginate は一体何をやっているのか
Laravel の paginate は一体何をやっているのか
WordPress REST API hacking
WordPress REST API hacking
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用
Spring starterによるSpring Boot Starter
Spring starterによるSpring Boot Starter
SwiftのDI方法につい て最近考えてた話
SwiftのDI方法につい て最近考えてた話
Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8
Appium & Robot Framework
Appium & Robot Framework
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
4장. Class Loader
4장. Class Loader
Maven
Maven
MVC ppt presentation
MVC ppt presentation
Angular.pdf
Angular.pdf
Angular 11
Angular 11
Similaire à Magento2.3 API Functional Testing
Max Yekaterinenko - Magento 2 & Quality
Max Yekaterinenko - Magento 2 & Quality
Meet Magento Italy
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Meet Magento Italy
Magento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and Overview
Tom Erskine
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
Igor Miniailo
Testlink Test Management with Teamforge
Testlink Test Management with Teamforge
CollabNet
DevOps on AWS
DevOps on AWS
Amazon Web Services
Magento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data Patches
atishgoswami
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon Web Services
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Amazon Web Services
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
Test Policy and Practices
Test Policy and Practices
Talentica Software
API design best practices
API design best practices
Igor Miniailo
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Amazon Web Services
Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6
Knoldus Inc.
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
Amazon Web Services
Automated Testing in Magento 2
Automated Testing in Magento 2
Magecom UK Limited
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Igor Miniailo
Automate you Appium test like a pro!
Automate you Appium test like a pro!
TestObject - Mobile Testing
A Complete Guide to Functional Testing
A Complete Guide to Functional Testing
Matthew Allen
Similaire à Magento2.3 API Functional Testing
(20)
Max Yekaterinenko - Magento 2 & Quality
Max Yekaterinenko - Magento 2 & Quality
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Eugene Shaksuvarov - Tuning Magento 2 for Maximum Performance
Magento Function Testing Framework - Intro and Overview
Magento Function Testing Framework - Intro and Overview
Backwards Compatibility Developers Guide. #MM17NL
Backwards Compatibility Developers Guide. #MM17NL
Testlink Test Management with Teamforge
Testlink Test Management with Teamforge
DevOps on AWS
DevOps on AWS
Magento 2.3 Schema and Data Patches
Magento 2.3 Schema and Data Patches
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
Introduction to Integration Tests in Magento / Adobe Commerce
Test Policy and Practices
Test Policy and Practices
API design best practices
API design best practices
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Browser-Based Load Testing with Grafana K6
Browser-Based Load Testing with Grafana K6
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
Automated Testing in Magento 2
Automated Testing in Magento 2
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Automate you Appium test like a pro!
Automate you Appium test like a pro!
A Complete Guide to Functional Testing
A Complete Guide to Functional Testing
Dernier
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
Alexandre Beguel
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
rahul_net
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
KrzysztofKkol1
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
itservices996
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
Steve Caron
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
Neo4j
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
kalichargn70th171
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
OnePlan Solutions
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
VictoriaMetrics
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
OnePlan Solutions
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
kalichargn70th171
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
Christopher Curtin
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
SasikiranMarri
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Shane Coughlan
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
Jean Silva
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
vaideheekore1
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
AS Design & AST.
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
manoharjgpsolutions
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
maor17
Dernier
(20)
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
Understanding Plagiarism: Causes, Consequences and Prevention.pptx
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
Magento2.3 API Functional Testing
1.
© 2019 Magento,
Inc. Page | 1 API Functional Testing in Magento 2.3
2.
© 2019 Magento,
Inc. . Page | 2 Senior Software Developer at BORN Group Vishwas Bhatnagar https://www.linkedin.com/in/vishwasbhatnagar/
3.
© 2019 Magento,
Inc. Page | 3 Agenda
4.
© 2019 Magento,
Inc. Page | 4 Agenda • Testing In Magento 2 • What is API Functional Testing ? • Why Do we need API Functional Testing • API Functional test case writing • Configuring , running and cleanup after test cases
5.
© 2019 Magento,
Inc. Page | 5 Not In Scope
6.
© 2019 Magento,
Inc. Page | 6 Not in Scope • Unit Tests • Integrations Tests • Functional Tests • Magento Testing Framework using Selenium
7.
© 2019 Magento,
Inc. Page | 7 Testing In Magento 2
8.
© 2019 Magento,
Inc. Page | 8 Tests available in Magento 2 Unit Tests Integration Tests Functional Tests Performance Tests Static Code Analysis Tests JavaScript Tests Integrity Tests Legacy Tests
9.
© 2019 Magento,
Inc. Page | 9 Unit Testing Individual classes or functions in isolation Resides in dev/tests/unit
10.
© 2019 Magento,
Inc. Page | 10 Integration Tests • Interactions between components, layers, and the environment • dev/tests/integration
11.
© 2019 Magento,
Inc. Page | 11 Functional Tests Same way user would interact dev/tests/functional and dev/tests/api-functional Functional Test API Functional MTF
12.
© 2019 Magento,
Inc. Page | 12 Performance Tests Track and maintain performance level per build dev/tests/performance
13.
© 2019 Magento,
Inc. Page | 13 Few more tests Static Code Analysis Tests : Static code analysis checks that PHP code follows the Magento 2 coding standards and best practices(dev/tests/static) JavaScript Tests : Tests the accuracy of JavaScript functions. (dev/tests/js). Integrity testing check how an application is linked. Basically, they tell us if your application should be able to run. Legacy Tests
14.
© 2019 Magento,
Inc. Page | 14 What is API Functional Testing ?
15.
© 2019 Magento,
Inc. Page | 15 API Functional Tests • Process used within software development in which software is tested to ensure that it conforms with all requirements. • Makes sure that nothing visible to the customer broke. • Don't care about how something is built • Don't care How something works at a high level
16.
© 2019 Magento,
Inc. Page | 16 Why Do we need API Functional Testing
17.
© 2019 Magento,
Inc. Page | 17 API Functional Testing Advantages • Adheres with Agile software Development • Testing parallel with development • Finds problems early in the development cycle • Allows easy the programmer to refactor code or upgrade • Writing the test first forces you to think through your design and what it must accomplish before you write the code
18.
© 2019 Magento,
Inc. Page | 18 Getting Started
19.
© 2019 Magento,
Inc. . Page | 19 Writing Test cases • Should inherit from the generic test case MagentoTestFrameworkTestCaseWebapiAbstract. • Should Use ObjectManager for testing in isolation • Class /File name should end with test • Methods should start with test • All Methods should be declared public
20.
© 2019 Magento,
Inc. . Page | 20 Sample Test cases
21.
© 2019 Magento,
Inc. . Page | 21 Assertions You can make various assertions that are available in phpunitFrameworkAssert like • assertArrayHasKey • assertCount • assertSame • assertEquals • assertNotEmpty • assertGreaterThan • assertIsReadable • assertNotNull
22.
© 2019 Magento,
Inc. . Page | 22 Assertion Example
23.
© 2019 Magento,
Inc. Page | 23 Running Test Cases
24.
© 2019 Magento,
Inc. . Page | 24 Configuring magento to run tests • Copy /dev/tests/api-functional/phpunit_rest.xml.dist to /dev/tests/api-functional/phpunit_rest.xml
25.
© 2019 Magento,
Inc. . Page | 25 Configuring magento to run tests • Copy /dev/tests/api-functional/config/install-config- mysql.php.dist to /dev/tests/api-functional/config/install-config- mysql.php. • Configure your DB connection and install
26.
© 2019 Magento,
Inc. . Page | 26 Running Using CLI • Switch to M2_ROOT/dev/test/api-fuctional/ • To Run Test class – ../../../vendor/bin/phpunit --debug ../../../app/code/Born/VehicleSearch/Test/Api/JobPostTest • To run a test method – ../../../vendor/bin/phpunit --debug --filter testJobSaveNoAction ../../../app/code/Born/Jobs/Test/Api/JobPostTest
27.
© 2019 Magento,
Inc. . Page | 27 Running Using CLI
28.
© 2019 Magento,
Inc. . Page | 28 Analyzing the Test Result
29.
© 2019 Magento,
Inc. Page | 29 Complex Test case Writing ?
30.
© 2019 Magento,
Inc. Page | 30 Use DocBlock Annotations @magentoAppIsolation : • Enable and Disable • Application state after a test run will be the same as before the test run @magentoDbIsolation : • Enable and Disable • All data, required for a test, live during transaction only. Any test results won’t be written in a database.
31.
© 2019 Magento,
Inc. Page | 31 @magentoDataFixture/magentoApiDataFixture: • Used to setup environment • All data, required for a test, live during transaction only. Any test results won’t be written in a database @magentoAppArea : • Adminhtml | frontend | global • Set area to application
32.
© 2019 Magento,
Inc. Page | 32 @magentoCache: • <type>|all enabled|disabled • Disables cache @magentoConfigFixture : • [<store_code>_store] <config_path> <config_value> • Configuration values for individual tests and revert them after the test execution
33.
© 2019 Magento,
Inc. . Page | 33 Fixture Example
34.
© 2019 Magento,
Inc. Page | 34 Clean it Up !
35.
© 2019 Magento,
Inc. Page | 35 Cleaning data after test case execution • RollBack Scripts – If you use fixtures to insert data you can create a rollback script for it . – Same format as the corresponding fixture: a script or a method – Should be Stored in the same directory – Same class as the corresponding fixture and suffixed with Rollback
36.
© 2019 Magento,
Inc. . Page | 36 Cleaning data after test case execution Script Fixture : Magento/Catalog/_files/categories.php RollBack : Magento/Catalog/_files/categories_rollback.php Method Fixture : MagentoCatalogModelProductTest::prepareProduct RollBack : MagentoCatalogModelProductTest::prepareProductRollback
37.
© 2019 Magento,
Inc. . Page | 37 Cleaning data after test case execution • TearDown Method – If you want to perform any actions after constraints – To be included in test case file
38.
© 2019 Magento,
Inc. Page | 38 Questions ?
39.
© 2019 Magento,
Inc. Page | 39 Thank You
Télécharger maintenant