kotlin multiplatform coverage? [closed] - testing

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Is there any tool to measure test coverage in the common portion of a Kotlin multiplatform project? I'm investigating migrating a Kotlin project to multiplatform. I'm a TDD developer and the code has 98% coverage. A good 95% can move to common. Am I looking at abandoning coverage metrics?

I have also a multiplatform kotlin project that uses jacoco for test coverage.
just follow this guide
but there's a need for a little configuration in case you are using gradle kotlin dsl:
plugins {
kotlin("multiplatform") version "1.3.72"
id("java-library")
jacoco
}
jacoco {
toolVersion = "0.8.6"
}
tasks.jacocoTestReport {
val coverageSourceDirs = arrayOf(
"src/commonMain",
"src/jvmMain"
)
val classFiles = File("${buildDir}/classes/kotlin/jvm/")
.walkBottomUp()
.toSet()
classDirectories.setFrom(classFiles)
sourceDirectories.setFrom(files(coverageSourceDirs))
executionData
.setFrom(files("${buildDir}/jacoco/jvmTest.exec"))
reports {
xml.isEnabled = true
html.isEnabled = true
}
}
running the command below will generate reports on your build/reports/test/jacoco
gradle clean build jacocoTestReport

try this: https://github.com/Kotlin/kotlinx-kover (Gradle plugin for Kotlin code coverage agents: IntelliJ and JaCoCo.)

AFAIK the only tool able to measure coverage for Kotlin at all is Jetbrains IDEA. I'm almost sure that it can count coverage for Kotlin MPP too, but to a shame I don't know any sane way to plug it into CI pipeline.

Related

Proper Convention in Maintaining Data and Feature file in Framework [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 days ago.
Improve this question
As such this is not an issue, but would like to understand a bit on Proper Convention in Maintaining Karate Framework.
we have Karate Framework with Maven build,
Test Data -> is it better to maintain under src/main/resources or src/test/java/{with custom folder}
With Features we have Functional Flow Features which in turn call some re-usable features, this case -> is it better to main both (Functional Flow Features and Re usable Features) under src/main/java or src/test/java
Karate Config -> is it better to be under src/main/resources or src/test/java
To add , With reference to https://github.com/karatelabs/karate/tree/master/karate-core, I observed Test Data, Feature file and config are under src/test.
Another reason to ask is we have lots of products lined up and we use Karate Framework for API Test Automation so would like to understand proper convention so as it makes things easier with further Implementation and Maintenance .
Expecting Recommendations considering using Karate Framework for Long term usage

Is there Kotlin equivalent for AssertJ library? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am converting some tests from Java to Kotlin. For Java tests I use AssertJ library which is very powerful and has rich set of assertions. My problem is that for Kotlin tests I can not use AssertJ and
Kotlin JUnit (org.jetbrains.kotlin:kotlin-test-junit) has very limited set of assertions.
Is there Kotlin equivalent for AssertJ or better way for asserts?
I found Kluent library but I'm still not sure if this is the best library to use.
There is no official equivalent but basic AssertJ is still usable in many cases and looks quite fine:
assertThat(info)
.containsKey("foo")
assertThatThrownBy { session.restTemplate.postForLocation("foo", {}) }
.isExactlyInstanceOf(HttpClientErrorException::class.java)
If you want dedicated wrappers, this early-stage project is trying to achieve this: https://github.com/wuan/assertj-core-kotlin
You are probably no longer searching for an assertion library but just in case you are not yet happy with your current choice, have a look at https://github.com/robstoll/atrium
It supports inter alia:
assertion groups
assertion functions for nullable types
property assertions
method assertions
postulate that a Throwable was thrown
As well as more advanced features such as sophisticated assertion builders, support for i18n and more.
The examples in the README will give you a nice overview:
https://github.com/robstoll/atrium/blob/master/README.md#examples

Suggest best reporting tool with selenium webdriver [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have done with my selenium webdriver script.now,I have tried TestNG and XSLT but still manager is not satisfied with output of generated reports. please suggest me best reporting tools for selenium.
I use following reports while working with TestNG and Selenium.
ReportNG: This is similar to TestNG report however looks far better than TestNG.
http://reportng.uncommons.org/
Maven SureFire Report: if you are using maven project you can have maven surefire plugin and generate a report, it's also far better than that of TestNG.
http://maven.apache.org/surefire/maven-surefire-plugin/
ExtentReport: this is my favorite. It's bit tricky to configure but worth it. It has extentx server as well which stores historical data.
http://extentreports.com/
http://extentreports.com/docs/extentx/
Selenium itself does not provide any reporting features. Reporting is provided by the platform you are using to run tests. As you mentioned yourself, tools like TestNG, jUnit or even Cucumber. Perhaps there are some extensions to these testing frameworks that can provide better results.
What exactly your boss is unhappy with? Perhaps you can tune some settings to improve the current result?

Whether to go for TestNG or Junit for UI Automation? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Planning to build a automation framework using selenium with java.
Quite confused to execute the testcase, whether to go with testng or junit.
Please provide your suggestions...
If you are having lot of dependencies and input constrains you can opt for TestNg. It is having many annotations which controls your test suite in a proper way.
Check out this link. It compares JUnit 4 and TestNG.
I personally use TestNG as it provides more annotations and dependencies. Everything is explained in an article above.
Hope it helps!

Eclipse plugin for TestNG coverage [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Does anybody know about an Eclipse plug-in to analyze code coverage for TestNG unit tests?
EclEmma can be run on TestNG test suites. You can also run a group of test or a given TestNG class with it. It requires the TestNg plug-in
On EclEmma plugin, choose "coverage configuration..." and select the TestNG tab.
Yes EclEmma is the best one. You can also try maven based cobertura which is also good enough.
I also use EclEmma , ever had a look at Clover ? - very , very nice , but not open source.