Skip to content

Assets missing when running integration tests #262

@rgladwell

Description

@rgladwell

When running Scalatest integration tests for Play2 using the scalatestplus API assets are not correctly hosted. Test run correctly from CLI sbt.

This appears to be because the test classpath does not include the assets folder as it does when running within sbt.

Steps to reproduce:

  1. Clone test case project (git clone [email protected]:rgladwell/scalaide-scalatest-play-integration.git)
  2. Install the sbt-eclipse plugin globally
  3. Run sbt eclipse
  4. Import the project in Eclipse
  5. Go to Run -> Run Configurations and create a new configuration
  6. Create new run configuration with the Type as "Package". Select "integration" as the package name
  7. Hit Run

Expected result: tests should pass as they do when you execute sbt test from the command line.

Actual result: Tests fail as the started Scalatest server is not correctly hosting the assets (404 was not equal to 200)

Workaround: http://stackoverflow.com/a/25051844/48611

The workaround (adding the assets folder to the test classpath) should be automatically done by the Scala IDE Play plugin though.

Test case project: https://github.com/rgladwell/scalaide-scalatest-play-integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions