"Import Keywords from Git" is behaving wrongly

**OS: **OSX Sierra 10.13.5

Katalon Studio Version: 5.6.1

## Katalon Studio logs:

MacOS (file:///Applications/Katalon%20Studio.app/Contents/MacOS/config/.metadata/.plugins/org.eclipse.ui.workbench/log): attached katalonlog

## Environment (for Web testing)

not relevant

## Steps to reproduce -

1. Created a new project for WebUI testing. Keyword is empty of course.

2. In the Test Explore, right click ‘Keywords’, select ‘Import’ > ‘Git’ . Specified GitHub - kazurayam/ksbackyard: This project is a Katalon Studio project where I develop a few Custom Keywords to share with other Katalon Studio projects of mine. as URL. Specified username and password.

3. In Branch selection, select ‘develop’

4. In the Local Destination dialog, the given was ‘/Keywords’ directory. Notably, I could not change the destination directory.

5. Cloning was done. I got unexpected result.

**
**

## Expected Behavior -

In the Keywords directory, I expected to have:

$ cd Keywords/
$ tree
.
└── com
    └── kazurayam
        └── ksbackyard
            ├── Assert.groovy
            ├── QuietBrowser.groovy
            ├── ScreenshotDriver.groovy
            ├── URLParser.groovy
            └── test
                ├── AllTests.groovy
                └── URLParserTest.groovy
4 directories, 6 files

## Actual Behavior -

In the Keywords directory, I got:

$ cd Keywords/
$ tree .
.
├── Keywords
│   └── com
│       └── kazurayam
│           └── ksbackyard
│               ├── Assert.groovy
│               ├── QuietBrowser.groovy
│               ├── ScreenshotDriver.groovy
│               ├── URLParser.groovy
│               └── test
│                   ├── AllTests.groovy
│                   └── URLParserTest.groovy
├── Libs
│   ├── CustomKeywords.groovy
│   └── internal
│       └── GlobalVariable.groovy
├── Scripts
│   ├── main
│   │   ├── ImageDiff
│   │   │   └── Script1535088864890.groovy
│   │   ├── TC1
│   │   │   └── Script1533719508880.groovy
│   │   ├── clearMaterials
│   │   │   └── Script1533972327178.groovy
│   │   └── makeIndex
│   │       └── Script1533877220381.groovy
│   └── test
│       ├── AssertTest
│       │   └── Script1534206725465.groovy
│       ├── Epilogue
│       │   └── Script1535150638308.groovy
│       ├── Prologue
│       │   └── Script1535150652033.groovy
│       └── ksbackyard.test
│           ├── AllTestsRunner
│           │   └── Script1535150726294.groovy
│           └── URLParserTestRunner
│               └── Script1535150743234.groovy
├── Test Listeners
│   └── MyTestListener.groovy
└── Test Suites
    ├── ImageDiff.groovy
    ├── TS1.groovy
    ├── clearMaterials.groovy
    └── makeIndex.groovy
22 directories, 22 files

I was just surprised that Libs, Scripts, Test Listeners, Test Suites directories are cloned. What is the definition of “Keyword” I would like to ask Katalon Team.

I got the Keywords/Keywords directory created. This is nonsense.

Have you, Katalon Team, ever used “Import Keyword from Git” for your own sake? I doubt it.

Before cloning 2018-08-25 20.43.34.png

Clone Git Repository Specify URL Username Password 2018-08-25 20.45.51.png

Clone Git Repository develop branch selected 2018-08-25 20.46.30.png

Clone Git Repository Local Destination specified 2018-08-25 20.46.56.png

After cloning 2018-08-25 20.47.44.png

After cloning unexpected resources cloned 2018-08-25 20.47.59.png

3 Likes

It will download all of .groovy files from the remote repository in this case, so the remote repository is expected to hold only keyword directory

so the remote repository is expected to hold only keyword directory

Do you require users to store only the Keywords directory into Git while leaving other resources (Test Cases, Object Repository, Test Suites, Data Files, Checkpoints, Test Listeners, Profile) outside of the Git repository’s scope?

2 Likes

Basically, you could use appropriate entries in the .gitignore to ensure that all non Keywords-related files are excluded from versioning a project whose Keywords subdirectory should serve as a blueprint for other Katalon projects. At least that’s what I’m doing right now.

But I think the point is that the Git client built into Katalon Studio is not able to treat the Keywords subdirectory as an independent Git repository instead of the actual entire project, if needed (I suspect that both are not possible at the same time because of the Git directory conventions, but I’m not sure about that). Because what use is it that the Keywords subdirectory itself ends up in a separately required Git repository if it has to be restored as an additional package name level when imported into an already existing target Keywords folder?

That’s that I have to rename it, which of course can easily be done directly in Katalon Studio. But this doesn’t seem to be a very well thought-out solution. The alternative would be to use an external Git client to version only the central Keywords subdirectory itself and not its entire project folder.

@Katalon team:

To get to the point again: If I want to import a Keywords directory from a repository that was created with the Git client of Katalon Studio itself and therefore also contains the project root, then this Keywords subdirectory should not be nested into an additional Keywords directory layer.

From my point of view, all you have to do is remove this Keywords layer from the destination path given during the import or allow me to do it myself. Unfortunately it is not (yet) possible to edit it:

The icing on the cake, of course, would be if you could offer me the needed .gitignore file to create such a pure Keywords repository, so that I don’t have to worry myself about ignoring all files outside the Keywords subdirectory.

But the second alternative, however, would certainly be even better: Already during the Git export, it should be possible to create the Keywords directory as a separate repository without the project root. After all, the Keywords are treated as an artifact during the import, because in this case you don’t want to cause any changes to the rest of the project.

image.png

Alex mentioned that a Gradle plugin named com.katalon.gradle-plugin is there:

It seems it supports importing external dependencies (*.jar files) from Maven Repository.

I can imagine a scene where this gradle-plugin is extended to support exporting/importing keyword source codes.

1 Like