I have a several Scala test with Future and with Await time and the same structure. Tests check some method which write file to file system.
I want to execute tests strictly consistent each test have to start after future in previous test will be finished. Could u help me find the way?
Now I have a failed test, because next test cant check result.
class Test1 extends AsyncFunSuite with BeforeAndAfterAll with Eventually with Matchers {
test("test 1") {
// clean file system
Try(
Await.ready(
Future(TestedMethod1.run(someArgs)), 10 seconds)
)
// checking file
}
test("test 2") {
..... // the same tests
}
}
class Test2 extends AsyncFunSuite with BeforeAndAfterAll with Eventually with Matchers {
test("test 1") {
..... // the same tests
}
test("test 2") {
..... // the same tests
}
}