Questions tagged [scalatest]

The Scala testing framework

ScalaTest is a testing framework for Scala, which can test either Scala or Java code.

It supports a number of different testing styles, as JUnit, TestNG, FunSuite (For test-driven development), Spec (for behaviour driven development) and FeatureSpec (for functional, integration, or acceptance testing).

1597 questions
0
votes
1 answer

akka Actor unit testing using testkit

There are many examples of using akka-testkit when the Actor being tested is responding to an ask: //below code was copied from example link val actorRef = TestActorRef(new MyActor) // hypothetical message stimulating a '42' answer val future =…
Ramón J Romero y Vigil
  • 17,373
  • 7
  • 77
  • 125
0
votes
1 answer

How to mock using external call in Akka Actor using ScalaTest

I am new to entire ecosystem including Scala, Akka and ScalaTest I am working on a problem where my Actor gives call to external system. case object LogProcessRequest class LProcessor extends Actor { val log = Logging(context.system, this) …
daydreamer
  • 87,243
  • 191
  • 450
  • 722
0
votes
1 answer

ScalaTest display original Failure stacktrace

How can display the original stacktrace for a Try Failure as part of the test output? When I do the following: result.success.value should equal blah And the result is a Failure I get The Try on which success was invoked was not a Success. Or, if…
tekumara
  • 8,357
  • 10
  • 57
  • 69
0
votes
0 answers

Scripting DB changes in Scala Play

I am trying to autopopulate a bunch of database objects in Scala Play. I've been able to do it successfully so far, but only by disguising my script as a test and running it with activator test-only. Can someone give me some guidance as to how to…
Driver
  • 317
  • 1
  • 4
  • 18
0
votes
3 answers

Using ScalaTest to test java that contain @Autowired and private fields

I have begun to use ScalaTest to test my Java code and I like it (I've read the "Testing in Scala" book). Recently I've been trying to test some java Spring code that contain fields which are marked private and @Autowired. There are no setter…
Rob O'Doherty
  • 549
  • 3
  • 14
0
votes
1 answer

Scalamock scalatest - Not able to stub

I have created a Workflow Processor Trait similar to the one mentioned below: import org.scalatestplus.play._ import play.api.mvc._ import play.api.test._ import play.api.test.Helpers._ import org.scalatest.Matchers._ import…
0
votes
2 answers

What's missing from this ScalaTest/ScalaCheck example?

I'm trying out ScalaCheck and haven't been able to figure out how to build the first example on the ScalaTest user's manual. I'm pretty sure that the following needs to be preceded by some imports and wrapped inside a class that extends from some…
Ben Kovitz
  • 4,920
  • 1
  • 22
  • 50
0
votes
1 answer

Scala: Acceptance Testing Order

for reference: How make tests always run in same order in Scalatest? I plan to test my application by calling controllers/routes and comparing the responses to my expected ones. I do not want to mock my persistence layer, so I can test it too. My…
Tim Joseph
  • 847
  • 2
  • 14
  • 28
0
votes
1 answer

Scalatest PlusPlay Selenium not able to resize a window

Been digging at this for a while, and I can't seem to find a way to resize a window using scalatest plus. The only method I've found searching online or the documentation at…
Driver
  • 317
  • 1
  • 4
  • 18
0
votes
1 answer

Spray JSON: How to get implicitly declared objects into read and write methods?

I am currently struggling with spray-json writing a protocol for my data model. For deserialization of JSON data to my data transfer objects, a DAO has to be contacted to check if an appropriate object exists, otherwise a DeserializationException…
rabejens
  • 7,594
  • 11
  • 56
  • 104
0
votes
1 answer

ScalaTest Plus not recognizing tests

I've been tasked to update and write a series of tests on an app in Scala Play, a language and framework I'm unfamiliar with. Part of what I'd like to do is integrate the ScalaTestPlus library. To get started I have been following the following…
Driver
  • 317
  • 1
  • 4
  • 18
0
votes
1 answer

The right way to fill and test a web form in ScalaTest and FluentLenium

I'm trying to fill, submit, and test a web form in Play Framework, using ScalaTest and FluentLenium. It seems like it should be very straightforward, but I'm having all kinds of problems. First, part of the web form in question:
0
votes
0 answers

Select a value from Drop Down dev Tag

I need to select a value from a drop down using gatling / scala. code as below. formParam seems not working for this type .can some one help me to solve this issue.i need to select Mobile Phone from the Dropdown.
lahiruW
  • 39
  • 1
  • 8
0
votes
1 answer

Assertion for overloaded equality operator fails for triple-equals but passes for double-equals

I overloaded a case class's equality operator: case class Polygon(points: Seq[(Double, Double)]) extends Shape { def ==(that: Polygon): Boolean = { ... } } My unit tests pass when using double-equals in assertions: import…
Roberto Bonvallet
  • 31,943
  • 5
  • 40
  • 57
0
votes
1 answer

Why use Specs2 over JUnit?

We went through online material such as scalatest site. What are advantages of using scala testing framework Specs2? How does it add to the project over JUnit?
1 2 3
99
100