Replies: 1 comment
-
@vidhun73 This repository is for a Clojure/ClojureScript Gradle plugin, so I think you'll want to ask this JS to Java question elsewhere. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cleaner is usually some object (helper). Which collect actions what should be done at the end of a test. For example if we create a db table in scope of the test then we should immediately inform cleaner that we need delete the table.
Cleaner is executed at the and of the test (part "after").
It is executed always if test passed or failed.
All tasks in cleaner are stored in stack LIFO.
If cleaner task fail then we need log it but continue with cleaning (try catch statement should be there probably).
Michal did not found any cleaner in TestNG. We should probably implement it. Could be added into context. If we use annotation @BeforeTest for creation and adding into context and @AfterTest for execution then it should be enough. Source: https://howtodoinjava.com/testng/testng-before-and-after-annotations/
Attaching cleaner.js what we have in our javascript solution. Could be refactored to java.
class Cleaner {
constructor(my_logger) {
this.cleaning_tasks_to_be_executed = [];
this.enable();
this.my_logger = my_logger;
}
}
module.exports = Cleaner;
Beta Was this translation helpful? Give feedback.
All reactions