Selenium JUnit 5 Tutorial Home / Video /

How to Execute JUnit 5 Test Scripts | JUnit 5 Tutorial | Part-III

How to Execute JUnit 5 Test Scripts | JUnit 5 Tutorial | Part-III

About the Video

In Part 3 of the JUnit 5 Testing tutorial series, join 𝑹𝒆𝒙 𝑱𝒐𝒏𝒆𝒔 (@RexJonesII), a seasoned QA Engineer, Trainer, YouTuber, and Blogger. This video covers executing JUnit 5 test scripts using IntelliJ, Command Line via Maven, and without the Static Configuration Method. Watch this video to deeply understand running test scripts and enhance your testing skills with practical insights!

Video Chapters

00:01 Introduction

00:37 Execute Test Scripts via IntelliJ

02:44 Execute Test Scripts From The Command Line via Maven

11:17 Execute Test Scripts Without Static Configuration Method

17:35 Conclusion

Key Topics Covered

Executing Test Scripts Using IDE: It starts with demonstrating how to run all tests in a project using the IDE by right-clicking on the Java folder and selecting "Run all tests." The video highlights the use of JUnit Jupiter and JUnit Vintage for running JUnit 5 and JUnit 4 test scripts, respectively.

Maven Command Line Execution: The presenter then transitions to executing tests via Maven commands in the terminal, explaining Maven's project management utility and its life cycle phases such as validate, compile, test, package, verify, install, and deploy. The video emphasizes the mvn clean test command to execute test scripts and discusses the need for including the Maven Surefire plugin in the pom.xml file to properly invoke test phases.

Configuration Annotations Without Static Methods: The latter part of the video addresses executing test scripts without using static methods in configuration annotations (@BeforeAll and @AfterAll). It explains that by default, these methods require static signatures unless the test class is annotated with @TestInstance(Lifecycle.PER_CLASS), which allows for a single instance of the test class to be used across all tests, negating the need for static methods.

Troubleshooting and Solutions: Throughout the presentation, potential issues and their solutions are addressed, such as why tests might not execute (e.g., missing Maven Surefire plugin) and how to resolve errors related to configuration annotations. The video provides detailed explanations on how to correct these issues to ensure smooth test execution.

Related Blogs & Hubs

How To Run JUnit Tests In Jupiter? [JUnit Jupiter Tutorial]

How to execute JUnit 4 tests with JUnit 5 [Tutorial]

A Comprehensive Guide On JUnit 5 Extensions

Complete JUnit 5 Mockito Tutorial For Unit Testing

Rex Jones II

Rex Jones II

Rex is an Experienced Quality Assurance (QA) Engineer with a history of working in the IT and Services industry. Certified as a Certified Software Test Engineer (CSTE) and Test Management Approach (TMap). Also skilled in Automation, Agile Methodologies, Test Strategies, and Software Development Life Cycle (SDLC) with a passion for testing software manually or automation such as Selenium.

......
...

Testμ 2024

Join the free online conference to decode the future of testing!

...21 - 23 August, 2024

More Videos from Selenium JUnit 5 Tutorial