Comments (5)
Looking to do the same. Any suggestions?
from scalatestplus-play.
Hi @dpoetzsch,
Thanks for investigating this. Another solution is to declare GuiceOneAppPerSuite
with a self-type for Suite
instead of TestSuite
(Suite
is the parent type for both TestSuite
and AsyncTestSuite
):
trait GuiceOneAppPerSuite extends BaseOneAppPerSuite with GuiceFakeApplicationFactory {
this: org.scalatest.Suite =>
}
That way, it should work when you mix GuiceOneAppPerSuite
and AsyncTestSuite
or TestSuite
. If you want to give it a try and submit PR, let me know so I can help you by reviewing it. :-)
Best.
from scalatestplus-play.
For those looking for a quick hack, you can declare the async suite as a nested suite:
import org.scalatest._
import org.scalatestplus.play.guice.GuiceOneAppPerSuite
import scala.collection.immutable
class GuiceOneAppPerAsyncSuite extends TestSuite with GuiceOneAppPerSuite {
val nestedSuite = new AsyncFlatSpec {
// async tests here
}
override def nestedSuites: immutable.IndexedSeq[Suite] = Vector(nestedSuite)
}
from scalatestplus-play.
@marcospereira I'm also no Scala magician, but I was trying out your suggestion above to attempt this:
trait GuiceOneAppPerSuite extends BaseOneAppPerSuite with GuiceFakeApplicationFactory {
this: org.scalatest.Suite =>
}
It seems like that won't work because BaseOneAppPerSuite
extends TestSuiteMixin
. Does this mean you're left with rewriting a bunch of the tree with async versions like @dpoetzsch's original suggestion?
from scalatestplus-play.
took at crack at this, moved TestSuite/TestSuiteMixin to Suite/SuiteMixin: #255
from scalatestplus-play.
Related Issues (20)
- Add link to http://www.scalatest.org/plus/play in description HOT 1
- Update documentation for unit testing controllers
- Success of before and after injection varies according to GuiceOneServerPerTest or GuiceOneServerPerSuite HOT 1
- 4.0.1 JAR on Maven Central has malformed META-INF/MANIFEST.M HOT 6
- Element.find to wrap WebElement.findElement
- [build] Travis uses sauce Labs limited to 5 concurrent jobs HOT 4
- Release for Scala 2.13.0-RC2 HOT 1
- Migrate formatter to scalafmt HOT 2
- Migrate formatter to scalafmt HOT 1
- deprecated WebBrowser is used HOT 2
- Doesn't seem like the JVM arguments make their way into the Application. HOT 1
- Revamp Travis build
- MiMa validation for the `2.13` artifact HOT 1
- ScalaTest 3.1.0 Support HOT 7
- Release for ScalaTest 3.1.x HOT 3
- Version 5.1.0 seem to miss MockitoSugar HOT 3
- MockitoSugar is no longer part of ScalaTest HOT 8
- Question about Sonatype permissions / groupId HOT 6
- Aborted tests not reported in JUnit XML reporter - support scalatest 3.2.x HOT 3
- BaseOneServerPerSuite swallows exception when stopping the server fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalatestplus-play.