Migrate tests to Junit5 + AssertJ#757
Conversation
This reverts commit 4b1cb7e
This reverts commit eb4bb28
This reverts commit 7b3db81
# Conflicts: # src/test/java/com/codeborne/selenide/ex/ListSizeMismatchTest.java # src/test/java/com/codeborne/selenide/ex/TextMismatchTest.java # src/test/java/com/codeborne/selenide/webdriver/RemoteDriverFactoryHeadlessOptionsTest.java
|
why do you choice |
|
Actually hamcrest was bundled with Junit4, that was the reason for me to
prefer it over AssertJ. Junit 5 bundles none of them, so now the choice is
tougher, because in any case you add extra dependency. I also like AssertJ
a bit more :)
Viele Grüße
Alexei Vinogradov
…On 27. Juni 2018 at 19:14:52, Boris Osipov ***@***.***) wrote:
why do you choice AssertJ? what was wrong with hamcrest?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#757 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGQ4YNrcJxZ5bXdNmMybCgUDJhjkpokFks5uA72MgaJpZM4U6DB9>
.
|
| /* | ||
| * Copyright 2018 Aliaksandr Rasolka | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); |
There was a problem hiding this comment.
Selenide is licensed by MIT. Why we have here Apache 2?
There was a problem hiding this comment.
Oops. Sorry about that. Copied from another project.
|
@BorisOsipov |
| * @author Aliaksandr Rasolka | ||
| * @since 4.12.2 | ||
| */ | ||
| public class UnitTest implements WithAssertions { |
There was a problem hiding this comment.
I don't understand what the metaphor should stand behind this class.
In any case, it should not appear in the main package of selenide, because as far as I know some of Selenide users - there will be many of them trying to use this class in every crazy and terrible way they can find :)
Remove all hamcrest using. Drop legacy integration test with junit4 rules. Remove junit vintage engine. Remove junit4 video recorder. Remove UnitTest class. Use direct implements instead. Add soft assert rule documentation.
# Conflicts: # src/test/java/com/codeborne/selenide/impl/DownloadFileWithProxyServerTest.java # src/test/java/integration/FileDownloadViaHttpGetTest.java # src/test/java/integration/FileDownloadViaProxyTest.java # src/test/java/integration/LocalHttpServer.java # src/test/resources/page_with_uploads.html
# Conflicts: # src/test/java/com/codeborne/selenide/ElementsCollectionTest.java # src/test/java/com/codeborne/selenide/impl/BySelectorCollectionTest.java # src/test/java/com/codeborne/selenide/impl/FilteringCollectionTest.java # src/test/java/com/codeborne/selenide/impl/HeadOfCollectionTest.java # src/test/java/com/codeborne/selenide/impl/LastCollectionElementTest.java # src/test/java/com/codeborne/selenide/impl/TailOfCollectionTest.java # src/test/java/integration/CollectionWaitTest.java
| id 'checkstyle' | ||
| id 'com.github.spotbugs' version '1.6.2' | ||
| id 'org.sonarqube' version '2.6.2' | ||
| id 'com.github.ben-manes.versions' version '0.20.0' |
| * @author Aliaksandr Rasolka | ||
| * @since 4.12.2 | ||
| */ | ||
| public class BrowserStrategyExtension implements AfterAllCallback { |
There was a problem hiding this comment.
- Add javadoc with usage sample.
- It's not clear from javadoc, is this "browser per class" or "browser per method"?
|
|
||
| /** | ||
| * Initialize default screen shooter extension with disabled successful tests capture. | ||
| */ |
There was a problem hiding this comment.
- remove useless javadoc
- call
this(false)
| public class ScreenShooterExtension implements BeforeAllCallback, AfterEachCallback, AfterAllCallback { | ||
| private static final Logger log = Logger.getLogger(ScreenShooterExtension.class.getName()); | ||
|
|
||
| private boolean captureSuccessfulTests; |
| * @return ErrorsCollector instance | ||
| * | ||
| * @see ErrorsCollector | ||
| */ |
| * Used during extension registration. | ||
| * | ||
| * @see ErrorsCollector | ||
| */ |
There was a problem hiding this comment.
instead of useless javadoc, please add a code sample: how to use this class?
Fix-up javadoc for extensions.
|
@asolntsev All issues were fixed. |
Proposed changes
Introduce
BrowserStrategyExtension,ScreenShooterExtension,SoftAssertsExtension,TextReportExtensionand testMockWebDriverExtensionextensions as port of Junit4 rules.Still not sure if we need to save old Junit4 test
SoftAssertJUnitTestthat ignored for a long time.Also this test requred to save old
LegacyIntegrationTestbase test.As solution I propose to delete this methods as test doesn't run.
Note1: Squash commits until merge.
Note2: Also I propose to move Junit4 rules and Junit5 extensions to modules. So no dependencies confuse facing.
Update: Ignored junit4 rule test replaced with documentation.
Checklist
gradle check chrome htmlunitcommand