-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sample test classes write files into the subproject's root directory so that the file trees get dirty #8
Comments
build/tmp
directory
In which directory under the project root should I house the output files from tests? As for Maven, https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html writes
As for Gradle, https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root writes
My question: ... Neither. I do not want any test case source dependent on which build tool to be used. |
I looked at https://github.com/kazurayam/selenium-webdriver-java/blob/master/.gitignore It contains a line
I believe that @bonigarcia had an intention to create the However, the current test classes are written so that they write the files into the project's root directory, rather than the Then, I would modify the test class so that they write files into the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as spam.
This comment was marked as spam.
I would create several branches: kazurayam8a, kazurayam8b, etc. In each branches, I would work modifying the source code. In each branch, I would work for a single output file to be moved into the The plan is as follows:
|
I need to be careful about the "Current Working Directory". Now I have a statement in my test class source:
This assumes that the "Current Working Directory" is given with a value equal to the directory However, this assumption is too fragile according to the runtime environment. In https://discuss.gradle.org/t/how-do-i-set-the-working-directory-for-testng-in-a-multi-project-gradle-build/7379/7,
A case
This command passed and it created a directory However, in IntelliJ IDEA, in the Java editor, I opend the It ran passed, but it created a directory IntelliJ run the test with "Current Working Directory" = This IntelliJ's behavior confuses me. I should find out how to configure IntelliJ IDEA so that it works just like Gradle. However, is it possible? ---- I am not sure. |
This comment was marked as outdated.
This comment was marked as outdated.
…ent_listeners.MyEventListener now writes file into the test-output directory
As you see in kazurayam developed a package of classes: However there is a problem. The package I do not like to duplicate the source code of the I will publish the jar of |
…the ProjectDirectoryResolver class
I have created a project "com.kazrurayam:unittest-helper:0.1.0" https://github.com/kazurayam/unittest-helper I have published the jar to the Maven Central repository, which will become available for download in a few days. |
I will modify the branches kazurayam8, kazurayam8a, kazurayam8b, kazurayam8c, kazurayam8d so that the use the "com.kazrurayam:unittest-helper:0.1.0" as one of their dependencies downloaded from the maven repositories. |
…junit5-seljup and -testng subprojects
… the extentReport.html is now written into the test-output dir
… the ch04/cdp/FullPageScreenshot*Test classes writes files into the test-output dir
I found that the sample codes of the Chapter 9 "File Download" section are sensitive. There are 3 tests which write into output files. One writes a file into the "Downloads" dir under the One writes a file into the dir as One writes a file into the file as It seems that the book author, @bonigarcia, had a specific intention to show the ways how to locate the output files, but I am not sure. We would need a sample code that writes a file into the "Downloads" directory of a user. Should I modify the samples that uses |
…file into the test-output dir in the projects root dir
… test-output dir under the project root dir
…st-outpu dir under the project root dir
…e into the test-output dir in the project root dir
…es into the test-output dir under the projects root dir
This comment was marked as outdated.
This comment was marked as outdated.
I have got an additional requirement. I want to create subdirectory under the output dir. The subdirectory could be any string. For example, I can set the Fully Qualified Class Name of the test case class as the subDir. Once implemented then the paths of output would look like this:
The path becomes rich. The path tells us which test class created the file. |
The unittest-helper project published a new version v0.3.0 https://github.com/kazurayam/unittest-helper/releases/tag/0.3.0 The API has been changed. The selenium-webdriver-java project should use the unittest-helper v0.3.0. I will update the kazurayam8consolidated branch. |
The following graph shows the tree of a project root directory which contains multiple subprojects:
Then I executed all tests of the subprojects.
When all tests finished, I viewed the directory tree under a subproject
selenium-webdriver-junit4
I found a lot of new files under the subproject's root directory. I executed
git status
command to find the new files:These new files are not
gitignored
. Therefore if I carelessly do the following operation:then the newl files will be commited into the project tree. A disastrous plution of the project tree!
The sample tests in the book should not write files into the project's root directory. The tests should write files into a particular directory in the project's root directory.
And I want to list the directroy in the
.gitignore
file so that Git ignores all the test outputs silently.The text was updated successfully, but these errors were encountered: