Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: implement scalatest integration #373

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

✨ feat: implement scalatest integration #373

wants to merge 1 commit into from

Conversation

gaeljw
Copy link
Member

@gaeljw gaeljw commented Apr 21, 2024

No description provided.

@gaeljw gaeljw self-assigned this Apr 21, 2024
@gaeljw gaeljw linked an issue Apr 21, 2024 that may be closed by this pull request
@gaeljw gaeljw added ⚡ enhancement Request for new functionality 🍼 incomplete Blocked until more information is provided labels Apr 21, 2024
@dfurmans dfurmans self-requested a review June 18, 2024 20:42
options: T
): Try[RuntimeOptionsBuilder] = {
Try {
// TODO verify how getClass behaves with the trait
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let`s say

trait CucumberSuiteOptions
trait CucumberSuiteOptionSpf extends CucumberSuiteOptions
def parse[T <: CucumberSuiteOptions](options: T with CucumberSuiteOptions): String = {
  val clazz = options.getClass
   clazz.toString
}
parse(new CucumberSuiteOptionSpf{}) // val res3: String = class rs$line$16$$anon$1

In Welcome to Scala 3.3.1 (17.0.2, Java OpenJDK 64-Bit Server VM).


class RunCukesTest extends CucumberSuite with CucumberSuiteOptions {

override def featuresPath: Seq[String] = Nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about Functor Option to express something that could be ... could be

parse(options) match {
case Success(value) => value
case Failure(exception) =>
println(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure that we would like to have this print in SOUT asis ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not but so far I just got inspired from the cucumber-junit module and copy/pasted stuff from there.

private val context: CucumberExecutionContext
) extends Suite {

private val children: Seq[PickleSuite] = {
Copy link
Contributor

@mpkorstanje mpkorstanje Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many levels of hierarchy can Scala test express? If more than 2, it might be worthwhile to match the layout in the feature file. Representing only the feature and pickles was a JUnit 4 limitation.

@gaeljw
Copy link
Member Author

gaeljw commented Jun 22, 2024

@dfurmans @mpkorstanje this is a very first draft, I don't even remember if it compiles yet 😅 No need for a deep review for now I guess.

I don't have plans to work on it in the coming weeks, if anyone wants to take over and complete it, I'm perfectly fine with that :)

@mpkorstanje
Copy link
Contributor

Alright, no worries! I'm currently working on some stuff in cucumber for junit 5 that is somewhat related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍼 incomplete Blocked until more information is provided ⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a cucumber-scalatest integration
3 participants