question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Listener to run before/after a set of tests

See original GitHub issue

I want to have a different set of tests (probably specified by different tags) and have hooks to run before and after running those set of tests. Is it possible to do this in kotlintest?

One use case for this feature is separating integration tests from unit tests. Usually, integration tests need to set up a testing environment which takes time and it is not desired to run this set up process before all the tests (beforeProject listener).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
alisabzevaricommented, Nov 7, 2018

If there was a way to not limit to one file, that would be great. I should still be able to freely organize my tests.

0reactions
sksamuelcommented, Jan 12, 2020

This now works in master and is part of 4.0 Any beforeTest / afterTest methods added to a test factory only apply to the tests in that factory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Listener to run before/after a set of tests · Issue #458 - GitHub
I want to have a piece of code running before and after a set of tests. One realworld example would be preparing the...
Read more >
TestNG Listeners in Selenium : Types & Examples
ISuiteListener: As the name suggests, this listener works at the suite level. It listens and runs before the start and end of suite...
Read more >
TestNG Annotations and Listeners - Software Testing Help
@AfterSuite: This method will be executed after all the tests in the suite are run. · @AfterTest: This method will be executed after...
Read more >
JUnit Listeners with All Details and Examples!
In this post, we will learn how to use JUnit Listeners. We will use JUnit 4 Rules to create a listeners to listen...
Read more >
Test Fixtures and Test Listeners (Test Hooks) - Katalon Docs
setUpTestCase, Run before each test case starts, Before executed test cases ... To activate the setUp and tearDown methods, you need to set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found