Giter Club home page Giter Club logo

intellij-plugin's Introduction


IntelliJ Plugin

PLUS PRO Enterprise
    (includes all in PLUS)     [*] coming soon

This plugin works fully-featured on IntelliJ Community Edition. JS support is built-in and does not require you to be running IntelliJ IDEA Ultimate.

By using this plugin, you agree to the Karate Labs EULA. Data on a few user actions is collected and subject to our Privacy Policy. HTML reports generated by the Karate open-source library has additional analytics.

License Activation

License activation and status is unified within the IntelliJ settings UI. Go to Settings -> Languages & Frameworks -> Karate and you should see something like this.

 

Click the Sign In link and you will be taken through the usual flow linked to your existing subscription details.

Once you have authenticated successfully, copy the session ID from the browser and paste it into the input-box now showing in the IntelliJ settings view. Click Apply to complete the sign-in.

Once signed-in you can work offline. You can always open this settings page to see how many days are left in your session.

If you need an offline license because of strict security or similar restrictions in your environment, please contact us. Please note that this option is available only for enterprise customers of Karate Labs.

Run From Editor

You can right-click a *.feature file in the explorer or within the editor and run it. An IntelliJ run-configuration will be created which you can customize later if needed.

You can also run a single Scenario by right-clicking on it or using the "gutter" icon. Right-clicking on the gutter-icon also brings up the option to debug instead of run.

 

You can even run a single "example" in a Scenario Outline by right-clicking on one of the data-rows within an Examples table.

Troubleshooting

If you don't see the options to run a test (described above) make sure that the Karate icon shows for open *.feature files in the editor and in the project-explorer. If the "Cucumber for Java" plugin is installed, it can conflict with Karate.

 

To make sure that the Karate plugin can run *.feature files, you can go to Settings -> Editor -> File Types -> Recognized File Types.

If you really need to mix Cucumber tests and Karate tests in the same workspace, refer to this post on Stack Overflow.

Run Configurations

IntelliJ run-configurations are useful for being able to re-run tests with specific parameters. All the typical Karate options you need are supported, including control over the JVM parameters and working directory.

Structure View

The IntelliJ structure view is supported so you can navigate large files with ease.

Code Formatting

Intellij code-formatting shortcuts work and even JSON within doc-string blocks will be formatted correctly.

Test Results

Test results integrate into the IntelliJ test-results view. The HTML report is one-click away.

 

When there are test errors - you can navigate directly to the feature file and line that failed by clicking on hyperlinks in the log.

Auto Complete

Besides the syntax validation, you have auto-complete for the most commonly used keywords.

Code Folding

You can collapse sections to make it easier to deal with long tests.

References

You can click to navigate to called files. Or hover to see context. Currently this is supported for the read() and Java.type() syntax. More coming soon, including auto-complete.

JSON Re-formatting

Place the cursor within JSON to see options to re-format it, you will see a "bulb" icon.

 

The following options are possible (depending on context):

  • Lenient - just like JS, where single-quotes are used and no quotes are needed for property keys
  • Strict - Strict JSON, using double-quotes
  • Make single Line - convert multi-line JSON to a single line
  • Make multi-line - convert a single line of JSON to multi-line, including triple-quotes

Run Folder

As a convenience, you can right-click and run a folder from the explorer view.

Debug

You can set break-points on Karate feature files in debug mode. The Karate debugger can even step-back and hot-reload simple edits to your test. Note that the options for "Hot Reload" and "Step Back" may be hidden away in some versions of the IntelliJ UI.

Debug Java from Karate

A Karate debug session will even stop at Java breakpoints.

Debug Karate from Java

You can also start a normal Java debug session that uses the Karate Runner Java API but still stop at Karate breakpoints. This requires you to be using Karate version 1.5.0.RC3 or greater.

Offline License

Important

The Offline License is a paid feature for enterprises. Please make sure you know who your designated admin is before you perform this step.

On the License Activation settings page, you should see a link called Offline License. When you click it you should see something like this.

A unique code for your system will be shown which you can cut and paste. In the example above, it is: DhHOFKHvd7XYTi+rQnNTJQ==

Send that unique code to your designated admin. You will be issued a license that is tied to this unique code. To apply the license, copy all the text from the license file (which should start with: -----BEGIN LICENSE FILE-----) and paste it into the text-area provided. Now you should see something like this.

Click [Apply] and you should a confirmation message and your license details.

intellij-plugin's People

Contributors

ptrthomas avatar

Stargazers

 avatar Marcin Kowalczyk avatar Graeme Holliday avatar jeff avatar Cleiber Rodrigues Reis avatar Anthony Staffier avatar Mark Diskin avatar

Watchers

Mark Diskin avatar  avatar  avatar  avatar

intellij-plugin's Issues

Plugin crashes when breakpoints are hit during debug

IntelliJ version: 2022.1.4 Ultimate
Plugin version: 1.5.0.196
Java version: 17.0.4 temurin
OS: Mac Monterey v12.2
Node version: 15.0.0
Karate version: 1.2.0

Whenever I try to debug a .feature file using breakpoints as soon as the running code hits it the plugin crashes with the following error:

java.lang.IllegalArgumentException: Argument for @NotNull parameter 'value' of com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.setPresentation must not be null
	at com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl.$$$reportNull$$$0(XValueNodeImpl.java)
	at com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl.setPresentation(XValueNodeImpl.java)
	at io.karatelabs.intellij.debug.KarateVariableValue.computePresentation(KarateVariableValue.java:28)
	at com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl.<init>(XValueNodeImpl.java:62)
	at com.intellij.xdebugger.impl.ui.tree.nodes.XValueContainerNode.lambda$addChildren$0(XValueContainerNode.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:200)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

The debugger of the IDE is also constantly showing 'Collecting data...'
Having checked the console the debug.DapServer is started on port 55763 with it shutting down fine at the end of the scenario I am trying to debug.
The breakpoint itself was on the following line:

    * def commitMetadataListAuthor = karate.jsonPath(response, "$.content[0:4].changes[*]..commitMetadata.author")

The goal being so I could figure out the value of this in the debugger without having to print it out, when the test finished I can confirm a value is assigned to this variable in case the mentioned not null error is about that. Or perhaps there is some incompatibility when jsonPath is being used?

Formatting is flattening JSON

When a Karate feature file gets formatted, all JSON is flattened. See examples below.
Unfortunately (well, fortunately, I guess), all of my projects rely on auto-formatting to keep things consistent.
Thus, any time I change a feature file, my JSON gets flattened and I can't undo it without turning off auto-format in the IDE settings.
I think this must be a Karate issue. This was not the behavior prior to the introduction of the Pro tier. Also, for a short while, I did not use the Karate plugin. I only started experiencing this with this version of the plugin. It is possible that the last released version works fine in this regard.

Before

    * def testData =
      """
        {
          agent: {
            lastName: '#(randomAlphabetic(5))',
            firstName: '#(randomAlphabetic(5))'
          },
          carrier: {
            name: 'Test Carrier'
          },
          individual: {
            lastName: '#("D" + randomAlphabetic(5))',
            firstName: '#("E" + randomAlphabetic(5))'
          },
          file: {
            name: 'payload.csv',
            type: 'csv'
          },
          importMap: {
            name: '#("Map " + randomAlphabetic(7))',
            file: 'payload.csv',
            numberOfSheets: 1,
            dataTabIndex: 1,
            firstDataRow: 2,
            sheetNames: null,
            autoUpdateEffectiveDate: true,
            fileColumnsFileName: 'field-mappings-minimum-fields.json'
          },
          policy: {
            policyNumber: 'P1',
            compPlanType: 'MA_PDP',
            effectiveDate: '2022-01-01',
            mapdpDetails: { enrollmentType: 'NEW' }
          },
          compPlan: {
            name: '#(randomAlphanumeric(8))',
            type: 'MA_PDP',
            schedule: [
              {
                beginYear: 1,
                endYear: 1,
                fee: 573,
                frequency: 'ONETIME',
              },
              {
                beginYear: 2,
                fee: 23.92,
                frequency: 'MONTHLY',
              }
            ]
          }
        }
      """

After

    * def testData =
      """
      {
      agent: {
      lastName: '#(randomAlphabetic(5))',
      firstName: '#(randomAlphabetic(5))'
      },
      carrier: {
      name: 'Test Carrier'
      },
      individual: {
      lastName: '#("D" + randomAlphabetic(5))',
      firstName: '#("E" + randomAlphabetic(5))'
      },
      file: {
      name: 'payload.csv',
      type: 'csv'
      },
      importMap: {
      name: '#("Map " + randomAlphabetic(7))',
      file: 'payload.csv',
      numberOfSheets: 1,
      dataTabIndex: 1,
      firstDataRow: 2,
      sheetNames: null,
      autoUpdateEffectiveDate: true,
      fileColumnsFileName: 'field-mappings-minimum-fields.json'
      },
      policy: {
      policyNumber: 'P1',
      compPlanType: 'PERCENTAGE_OF_PREMIUM',
      netPremium: 176.23,
      mode: 'MONTHLY',
      effectiveDate: '#(dateFirstOfYear(-1))',
      },
      otherComp: {
      compPlanType: 'PERCENTAGE_OF_PREMIUM',
      effectiveDate: '#(dateFirstOfYear(-1))',
      },
      compPlan: {
      name: '#(randomAlphanumeric(8))',
      type: 'PERCENTAGE_OF_PREMIUM',
      schedule: [
      {
      beginYear: 1,
      endYear: 1,
      commissionRate: 1,
      },
      {
      beginYear: 2,
      commissionRate: 0.010,
      }
      ]
      }
      }
      """

karate.filterKeys() is sometimes preventing the next Scenario from being executable from the gutter

Here is an example, where the 2nd scenario will have no gutter icon offered as a result of karate.filterKeys() (it will still run when you execute the whole feature):

Feature:

  Scenario: filterKeys
    * def test = { a: '1', b: '2' }
    * match karate.filterKeys(test, 'b') == { b: '2' }

  Scenario: this won't be recognized as a test!
    * print 'Hi'

Note: the karate.filterKeys() line tosses a "expected match operator" error, which may be playing into this...

Feature descriptions are tossing errors if certain characters/keywords are included

Here's a pretty good example:

Feature:

  Testing. <-- expecting newline; unresolved variable or type Testing because of the period
  
  Testing 123. <-- no issue, because the period came after the 2nd character string, not the 1st

  testing, <-- expecting newline or semicolon because of the comma
  
  testing, from feature function <-- all these keywords toss errors when placed after after a string followed by a comma or period

Karate plug-in no longer free?

Good day,

My team and been using Karate for the past two years and even start using the Karate plugin(On IntelliJ) with 1.4 version upgrade. As of today I see a paid subscription is require and I cannot find any post/article updating why sudden change. I will need to motivate for licenses as main reason for the team to accept Karate was it open-source.

Now it is paid , we would like to know the reason of the change and/or also is there an alternative? as I tried cucumber and it is not running even after associating *.feature file types nothing happens

JsonPath shortcut form expressions marked as syntax errors

According to manual, the JsonPath expression
get cat.kittens[*].id
can also be done as
get cat $.kittens[*].id
and also can be done in a "short cut" form of
$cat.kittens[*].id

However, the second and third forms are flagged as syntax errors with the tooltip:
'(', '.', '..', <*> or '[' expected for the first case
'.', '..', <*> or '[' expected, got 'cat' for the second case

The statements all work properly when run, but those two are flagged as errors. Seems to have to do with mis-parsing of the $ character.

image

Adjusting paths

It would be nice if the plugin adjusted paths when a feature file was moved. Ideally, this should apply to read and readonce calls.

For example, when I moved a feature file into a subdirectory, a path was broken:

  • This * call read('this:../user/register.reusable.feature')
  • Should have changed to this * call read('this:../../user/register.reusable.feature')

I usually just drag and drop files around in IntelliJ's Project Tree, but for this, I also tested Move (F6), and the result was the same.

Karate upgrade from 1.3.1 to 1.4.0 not working correctly with Karate plugin

Good day,

We fairly new to Karate and recently upgraded from a working version 1.3.1 to 1.4.0, since cucumber-java is not supported anymore or at least no longer able to run test with it locally on Intellij (Build #IU-221.5787.30, built on May 31, 2022) with cucumber ,the recommended solution is to use the Karate plugin as per documentation , however, I am experiencing couple of issues as follow:

NB: We testing both UI, API tests, and some database validations tests with extended js scripts

1.Performance issues with plug-in:

Tests are not running consistently when debugging, either they hang at "initialization", I then have to re-run them which it takes time to load then fails or they run and pass which I am not sure at what condition.
NB: I also noticed I had to select "Shorten the test name on command line"

  1. Code is not highlighted as it used to be before on 1.3.1:

image

  1. Test no longer run with chromedriver:
    driver config on Karate-config file:
    type: 'chromedriver',
    executable: 'src/test/java/chromedriver.exe',
    addOptions: ['--ignore-certificate-errors'],
    headless: false

karate-config.js.txt

NB: we had to use chromedriver temporarily after chrome upgrade broke tests, but I believe with 1.4.0 it has been resolved

  1. Remote test to grid no longer run if we change the environment variable on karate-config.js:
    Test run locally instead (if they run at all). see attached for karate-config.js file fo

NB: We need these tests to run remotely (In seleniumbox/Grid) when we run our code build pipeline

karate-config.js.txt

POM
pom.txt

Runner class
runner class.txt

Run config:

image

Dialog is improperly built

Missing textbox formatting for karate.options and JVM parameters. Also, tab only adds the spaces rather than moving from one field to another.

image

The plugin fails to add its internal jar when classpath is too long

When running a Karate feature file, the Karate plugin will automatically prepend its internal jar karate.jar to the classpath.
This seems to work well when the original classpath is short.
However when the original classpath is long, this doesn't happen and then it fails with an error:

Error: Could not find or load main class com.intuit.karate.Main
Caused by: java.lang.ClassNotFoundException: com.intuit.karate.Main

The same happens even if IntelliJ prompts for shortening the classpath - the resulting argfile will still be invalid.

The length of the failing classpath in my case was ~20000 chars.

Reproduced on Ubuntu 20, on a Java Gradle project, with IntelliJ 2022.2.3 (Ultimate Edition).

XPath/jsonPath appears to be causing problems with the "match" keyword

This will generate an "expected match" error before match as well as an "unexpected element" error after ==:

  Scenario:
    * def myXml = <testing>123</testing>
    * match myXml /testing == '123'

The same happens with pure jsonPath:

  Scenario:
    * def test = { testing: '123' }
    * match test $.testing == '123'

Feature Request: Option to add commas at the end of lists

Since the JSON parser is very forgiving, it would be great if there was a setting that would format this:

{
  schedule:
  [
    {
      beginYear: 1,
      endYear: 1,
      commissionRate: 50,
      annualizationRate: 100
    }
  ]
}

into this:

{
  schedule:
  [
    {
      beginYear: 1,
      endYear: 1,
      commissionRate: 50,
      annualizationRate: 100, // <--- new comma here
    }, // <--- new comma here
  ]
}

Simply put, add a comma after the last element of an array or after the last attribute of an object.
This allows for easy adding of additional elements.

Karate IntelliJ plugin parsing breaks after using karate.jsonPath in match statement

I created the scenario below to illustrate how parsing breaks after having a karate.jsonPath command in my match statement. These are tests that parsed fine before the use of the plugin when moving to Karate 1.4.0.

This makes it so that tests cannot be run individually after the command and would require us to update lots of tests to make the parser work correctly. I have some feature files where half the file is just grey text because it failed parsing the scenarios half way through.

Using Karate Plugin 1.7.4.325

image

Karate IntelliJ Plugin doesn't support code collapsing/folding

I just updated to Karate 1.4.0 from 1.3.1 and require the use of the IntelliJ plugin. Some what I thought was basic functionality is missing. One of those basic feature is being able to collapse code using the IDE folding options. I use that to quickly scan a file to review scenarios to find a case I'm looking for etc.

Is that supposed to be supporting in this plugin? I know that seems like a small issue but it's something that I use often and you only know how much you use it when it goes away.

Here is my feature file when I'm using the Karate 1.7.4.325 plugin:
image

Here is my feature file when I use the Gherkin plugin:
image

Scenario fails to run when starting line changes

Steps:

  1. Using scenario file 1 below, run the 2nd scenario.
    • This can be done with keyboard shortcuts, using the gutter shortcut or by right-clicking on the scenario and selecting "Run...".
  2. Scenario passes.
  3. Change the file in any way such that the 2nd scenario is on a different line number, higher or lower.
  4. ACTUAL: Scenario will not be found, and thus the test shows up as "Terminated".
    • EXPECTED: Scenario would be run by name, and thus would be found regardless of line number, as long as scenario name was unchanged.

Failure variation:

  1. Run first test as normal.
  2. Alter the file in such a way that the IntelliJ auto-formatter will alter the file.
    • Example: add 3 blank lines in between 1st and 2nd scenario.
  3. Run the 2nd scenario by gutter or keyboard shortcut or right-click.
  4. IntelliJ Karate Plugin is triggered to run based on current file conditions.
  5. When the Run window receives focus, the auto-formatter is triggered.
  6. The 2nd scenario moves up.
  7. ACTUAL: Scenario will not be found, and thus the test shows up as "Terminated".
    • EXPECTED: Scenario would be run by name, and thus would be found regardless of line number, as long as scenario name was unchanged.
Feature: A simple Karate test that always passes

  Scenario: Dummy Test

    * def foo = 1234
    * def bar = 1234
    * match foo == bar
# variations on this empty space will cause the issue
  Scenario: Line changing scenario # this line number must change

    * def foo = 1234
    * def bar = 1234
    * match foo == bar

Tests run from a Java class open in target

Steps:

  1. Create a directory.
  2. Add a Karate Feature file.
  3. Add a Java class that runs all Features in the current directory.
  4. From the Run Window, double-click on an individual Scenario.

Expected:

  • The IDE would open the Feature file from the src directory.

Actual:

  • The IDE opens the Feature file from the target directory.
  • This means that any changes we make to it will be silently overwritten.

Seems loosely related to #39.

Plugin flags error on method calls as method arguments

Example:

match karate.lowerCase(postResult.response.trim()) == "empty request"

is flagged as error with "Expected match operator"

However, the line and feature succeeds when run.

Workaround:

match karate.lowerCase(postResult.response).trim() == "empty request"

does not flag as error.

Screen Shot 2022-12-05 at 5 39 19 PM

Error highlighting appears incorrect

The first screenshot below is from Intellij Ultimate and suggests there are various issues with my test. The second screenshot shows the problems being reported. I assume they are coming from the Karate plugin and if so, they are incorrect. I uninstalled the Karate plugin and associated *.feature with cucumber an the problems go away so it does seem to be the Karate plugin.

Screenshot 2022-06-06 at 10 17 17
Screenshot 2022-06-06 at 12 11 17

Tagged scenarios are terminated if run from the gutter

Tagging a scenario prevents it from being run from the gutter. It can be any tag, too -- this does not appear to be an "@ignore" tag problem. (Although even with @ignore, I would expect to be able to run the test if manually running it from the gutter...)

At the feature level, this all works fine: tagged scenarios are executed along with everything else, unless the tag used is @ignore, in which case that scenario is skipped.

Errors generated after placeholder variables in angle brackets

Depending on how they're used, placeholder variables that are populated based on Examples table entries, and enclosed in angle brackets, generate various errors. The tests run fine, either way, though.

For instance, this will generate a , or ) expected error:

  Scenario Outline: 
    * def testing = read(<test>)
    
    Examples:
      | test      |
      | 'my.json' |

...and this will generate an Unexpected end of file error:

  Scenario Outline: 
    * def testing = <test>
    
    Examples:
      | test |
      | 123  |

v2.0.0 does not accept command line arguments

As stated here, I rely on command line arguments to enable/disable logging.

With the new test configuration, there is no place for command line arguments:
image

This is the result of the test run:
image

For reference, this is the logback configuration I use:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

    <logger name="com.intuit.karate" level="DEBUG"/>

    <if condition='property("consoleOutput").equals("true")'>
        <then>
            <include
                    resource="org/springframework/boot/logging/logback/console-appender.xml"/>

            <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
                <encoder>
                    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
                    </pattern>
                </encoder>
            </appender>

            <root level="INFO">
                <appender-ref ref="CONSOLE"/>
            </root>
        </then>
        <else>
            <property name="LOG_FILE" value="/var/log/agencycomp/tests.log"/>
            <include
                    resource="org/springframework/boot/logging/logback/file-appender.xml"/>

            <root level="INFO">
                <appender-ref ref="FILE"/>
            </root>
        </else>
    </if>
</configuration>

The "get" keyword is generating errors

The following scenario will have a few things flagged in the * def kitnums = line:
A newline or semicolon expected error after get
An expression expected error for [*]
A statement expected error for [*]

 Scenario:
   * def cat = 
  """
  {
    name: 'Billie',
    kittens: [
      { id: 23, name: 'Bob' },
      { id: 42, name: 'Wild' }
    ]
  }
  """
   * def kitnums = get cat.kittens[*].id

XML declarations are generating errors when included in multi-line doc strings

XML declarations included in multi-line doc strings are causing "declaration should precede all document content" errors. Here are a couple examples (one with and one without the error):

  Scenario: this is fine
    * request <?xml version='1.0' encoding='UTF-8'?><testing>123</testing>
    
  Scenario: this tosses an error
    * request 
    """
    <?xml version='1.0' encoding='UTF-8'?>
    <testing>123</testing>
    """

Issue in karate plugin on intellij

Exception in intellij ide while using karate plugin

image

Details here: (3 pages of exceptions added)

1 of 3

java.lang.IllegalArgumentException: Invalid range specified: (3, 0); 
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:231)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:226)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:222)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:41)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:30)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedTextRangeInElement(KarateMultilineStringImpl.kt:90)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedText(KarateMultilineStringImpl.kt:96)
	at io.karatelabs.intellij.lang.karate.psi.KarateWithValueExpression.findAssignmentValueType(KarateWithValueExpression.kt:27)
	at io.karatelabs.intellij.lang.karate.injector.KarateLanguageInjector.getLanguagesToInject(KarateLanguageInjector.kt:34)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:445)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUpInner(InjectedLanguageUtilBase.java:238)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.lambda$probeElementsUp$0(InjectedLanguageUtilBase.java:218)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction$lambda$0(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.allowProcessingContextInWriteAction(ReadMostlyRWLock.java:204)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:22)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:217)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:159)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.findInside(InjectedLanguageUtilBase.java:401)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.tryOffset(InjectedLanguageUtilBase.java:387)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.findInjectedElementNoCommit(InjectedLanguageUtilBase.java:360)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.findInjectedElementAt(InjectedLanguageManagerImpl.java:301)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.getInjectedFileIfAny(BackgroundHighlightingUtil.java:98)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.lambda$lookForInjectedFileInOtherThread$0(BackgroundHighlightingUtil.java:55)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:746)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:778)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:573)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:537)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:72)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:129)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:110)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$1(ProgressManager.java:70)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:70)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:107)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:72)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:537)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:444)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

2 of 3

java.lang.IllegalArgumentException: Invalid range specified: (3, 0); 
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:231)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:226)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:222)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:41)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:30)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedTextRangeInElement(KarateMultilineStringImpl.kt:90)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedText(KarateMultilineStringImpl.kt:96)
	at io.karatelabs.intellij.lang.karate.psi.KarateWithValueExpression.findAssignmentValueType(KarateWithValueExpression.kt:27)
	at io.karatelabs.intellij.lang.karate.injector.KarateLanguageInjector.getLanguagesToInject(KarateLanguageInjector.kt:34)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:445)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUpInner(InjectedLanguageUtilBase.java:238)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.lambda$probeElementsUp$0(InjectedLanguageUtilBase.java:218)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction$lambda$0(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.allowProcessingContextInWriteAction(ReadMostlyRWLock.java:204)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:22)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:217)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:159)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerateEx(InjectedLanguageManagerImpl.java:329)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryLineMarkersForInjected(LineMarkersPass.java:251)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:214)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:104)
	at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:95)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:99)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:382)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:374)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:373)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:349)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:229)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:187)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:347)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

3 of 3

java.lang.IllegalArgumentException: Invalid range specified: (3, 0); 
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:231)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:226)
	at com.intellij.openapi.util.TextRange.assertProperRange(TextRange.java:222)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:41)
	at com.intellij.openapi.util.TextRange.<init>(TextRange.java:30)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedTextRangeInElement(KarateMultilineStringImpl.kt:90)
	at io.karatelabs.intellij.lang.karate.psi.impl.KarateMultilineStringImpl.getUnquotedText(KarateMultilineStringImpl.kt:96)
	at io.karatelabs.intellij.lang.karate.psi.KarateWithValueExpression.findAssignmentValueType(KarateWithValueExpression.kt:27)
	at io.karatelabs.intellij.lang.karate.injector.KarateLanguageInjector.getLanguagesToInject(KarateLanguageInjector.kt:34)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:445)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUpInner(InjectedLanguageUtilBase.java:238)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.lambda$probeElementsUp$0(InjectedLanguageUtilBase.java:218)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml$allowInWriteAction$1.invoke(ReadActionCacheIml.kt:22)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction$lambda$0(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.allowProcessingContextInWriteAction(ReadMostlyRWLock.java:204)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:18)
	at com.intellij.openapi.application.impl.ReadActionCacheIml.allowInWriteAction(ReadActionCacheIml.kt:22)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:217)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:159)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.findInside(InjectedLanguageUtilBase.java:401)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.tryOffset(InjectedLanguageUtilBase.java:380)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.findInjectedElementNoCommit(InjectedLanguageUtilBase.java:360)
	at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.findInjectedElementAt(InjectedLanguageManagerImpl.java:301)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.getInjectedFileIfAny(BackgroundHighlightingUtil.java:98)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.lambda$lookForInjectedFileInOtherThread$0(BackgroundHighlightingUtil.java:55)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:746)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:778)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:573)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:537)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1102)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:72)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:129)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:110)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$1(ProgressManager.java:70)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:70)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:107)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:72)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:537)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:444)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

Intellij info:

IntelliJ IDEA 2023.1.2 (Community Edition)
Build #IC-231.9011.34, built on May 16, 2023
Runtime version: 17.0.6+10-b829.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2014M
Cores: 8
Non-Bundled Plugins:
    io.karatelabs.intellij (1.7.4.325)
    InnerBuilder (1.3.0)
    GrepConsole (12.18.211.6693.0)
    org.intellij.scala (2023.1.19)
    org.sonarlint.idea (8.4.0.73538)

Kotlin: 231-1.9.0-release-358-IJ8770.65

Run Configurations not using environment/VM options/arguments

Running tests using the plugin does not take any of these into account:
image

To confirm, I expanded the full command in the Run window, and searched for the missing parameter, and it was not anywhere in the command.

/bin/java
-javaagent:...
-Dfile.encoding=UTF-8
-Dsun.stdout.encoding=UTF-8
-Dsun.stderr.encoding=UTF-8
-classpath JARs.jar
com.intuit.karate.Main
-H com.intuit.karate.cli.IntellijHook
/project/feature.feature:222

This was working at least 2-3 weeks ago.

Feature request: allow debug breakpoints in java code using free plugin

Currently only the paid plugin allows any debugging/breakpoints.

The cucumber java plugin allows setting java breakpoints, so imo it's currently better than the free plugin.

Current behavior:

  • able to set breakpoints in feature files
  • debug feature fails with error that debugger support is a paid feature

Recommended behavior for free version:

  • setting breakpoints in feature files should fail with error that debugging support is a paid feature
  • running debug should ignore any feature file breakpoints

IntelliJ: JavaScript-style outline variables are not interpolated in scenario names

In IntelliJ IDEA, Build #IC-232.9921.47, built on September 12, 2023
with Karate (Freemium) plugin, Version 1.7.7.361-232:

while running tests in karate-core/src/test/java/com/intuit/karate/core/parser/test-outline-name-js.feature
the JS variable names are not interpolated and the cog wheels suggest tests to infinitely run, but they all are completed:
image

Karate reports show proper JS-expressions interpolation though:
image

karate.write throws FileNotFoundException

Might be related to #36.

01: karate.write(responseBytes, 'exports/' + filename)
<<<<
org.graalvm.polyglot.PolyglotException: java.io.FileNotFoundException: target/exports/export.xlsx (No such file or directory)
- com.intuit.karate.FileUtils.writeToFile(FileUtils.java:187)
- com.intuit.karate.core.ScenarioBridge.write(ScenarioBridge.java:1135)
- <js>.:program(Unnamed:1)

Again, this was working 2-3 weeks ago.

Variable references in JSON objects are being flagged with errors

This JSON blob:

* def someVar =
  """
  {
    "status": "status",
    "expiryDate": {
      "month": #(~~expiryMonth()),  <--- these two lines are the problem
      "year": #(~~expiryYear(2)).       <---
    }
  }
  """

... is getting flagged with the following errors:
value expected, got '#'
JSON standard does not allow such tokens
':' expected, got ','

Plugin is using non-existent Karate 1.5.0-SNAPSHOT instead of the version defined in pom.xml

Intellij version: 2023.2 Build #IC-232.8660.185, built on July 26, 2023
Plugin version: 1.7.7.361-232

Steps to reproduce:

  1. Create a new karate project using https://github.com/karatelabs/karate#quickstart command
  2. Navigate to examples/users/users.feature and click the Play button next to the first scenario
  3. Now, change the karate version in pom.xml to 0.9.6 and add karate-apache dependency
  4. Repeat step 2

Expected:
The plugin should use karate 0.9.6 to run the test

Actual:
The plugin uses Karate 1.5.0 - SNAPSHOT

karate.write() writes to the wrong project

Preface: I fully understand the warnings about using karate.write(), and anti-patterns associated with its use. Nonetheless, this is the route we have chosen.

Use case:

  1. Run "login" scenario, which saves authentication cookies.
  2. Run all test scenarios by reading authentication cookies from step 1 and submitting them with subsequent requests.

Sample project: karate-bug.zip

Problem:
The file written by Karate ends up in the wrong project's target directory.
I am 99% sure this started when I started using this plugin.
There could be other explanations, but this almost seems to be a different manifestation of the problem reported in here.

Expected:
I expect Karate to write the file to the Karate project's target directory.
This image shows the 2 projects, and the file in the wrong project's target directory.
image

IntelliJ project settings, to show how each project is set to output to its own target directory.
image
image

IntelliJ IDEA 2023.2 RC (232.8660.142) freezes on startup with Karate plug-in installed

Reported by a user to JetBrains support:

"Indexing" prio=0 tid=0x0 nid=0x0 runnable
     java.lang.Thread.State: RUNNABLE
	at io.karatelabs.intellij.lang.karate.psi._KarateLexerGen.advance(_KarateLexerGen.java:874)
	at com.intellij.lexer.FlexAdapter.locateToken(FlexAdapter.java:93)
	at com.intellij.lexer.FlexAdapter.getState(FlexAdapter.java:46)
	at com.intellij.lexer.LookAheadLexer.doLookAhead(LookAheadLexer.java:68)
	at com.intellij.lexer.LookAheadLexer.advance(LookAheadLexer.java:62)
	at com.intellij.lexer.MergingLexerAdapterBase.locateToken(MergingLexerAdapterBase.java:79)
	at com.intellij.lexer.MergingLexerAdapterBase.getTokenType(MergingLexerAdapterBase.java:48)
	at com.intellij.lang.cacheBuilder.DefaultWordsScanner.processWords(DefaultWordsScanner.java:106)
	at com.intellij.psi.impl.cache.impl.id.ScanningIdIndexer.map(ScanningIdIndexer.java:25)
	at com.intellij.psi.impl.cache.impl.id.ScanningIdIndexer.map(ScanningIdIndexer.java:15)
	at com.intellij.psi.impl.cache.impl.id.IdIndex$2.map(IdIndex.java:98)
	at com.intellij.psi.impl.cache.impl.id.IdIndex$2.map(IdIndex.java:69)
	at com.intellij.util.indexing.CompositeDataIndexer.map(CompositeDataIndexer.java:55)
	at com.intellij.util.indexing.CompositeDataIndexer.map(CompositeDataIndexer.java:19)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapByIndexer(MapReduceIndex.java:313)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:304)
	at com.intellij.util.indexing.impl.storage.VfsAwareMapReduceIndex.mapInput(VfsAwareMapReduceIndex.java:162)
	at com.intellij.util.indexing.impl.storage.VfsAwareMapReduceIndex.mapInput(VfsAwareMapReduceIndex.java:39)
	at com.intellij.util.indexing.impl.MapReduceIndex.mapInputAndPrepareUpdate(MapReduceIndex.java:249)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.updateBaseIndex(CompositeInvertedIndexBase.java:294)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:64)
	at com.intellij.indexing.composite.CompositeInvertedIndexBase.mapInputAndPrepareUpdate(CompositeInvertedIndexBase.java:30)
	at com.intellij.util.indexing.FileBasedIndexImpl.createSingleIndexValueApplier(FileBasedIndexImpl.java:1611)
	at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$25(FileBasedIndexImpl.java:1480)
	at com.intellij.util.indexing.FileBasedIndexImpl$$Lambda$8585/0x000000080345b788.run(Unknown Source)
	at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyWithProvidedValueIn(FileTypeManagerImpl.java:676)
	at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1432)
	at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1405)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner.lambda$indexOneFileOfJob$4(IndexUpdateRunner.java:322)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner$$Lambda$8584/0x000000080345b538.call(Unknown Source)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:832)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:864)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:602)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$4(NonBlockingReadActionImpl.java:565)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission$$Lambda$2030/0x0000000801519ea8.run(Unknown Source)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:76)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils$$Lambda$2031/0x000000080151a0f8.run(Unknown Source)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:133)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:114)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils$$Lambda$2033/0x000000080151a598.compute(Unknown Source)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
	at com.intellij.openapi.progress.ProgressManager$$Lambda$1470/0x000000080113ea88.run(Unknown Source)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda$1436/0x0000000801119520.run(Unknown Source)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda$1437/0x0000000801119770.compute(Unknown Source)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:111)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:76)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:565)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.executeSynchronously(NonBlockingReadActionImpl.java:492)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.executeSynchronously(NonBlockingReadActionImpl.java:222)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner.indexOneFileOfJob(IndexUpdateRunner.java:326)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner.lambda$indexJobsFairly$3(IndexUpdateRunner.java:248)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner$$Lambda$8568/0x00000008034586d0.run(Unknown Source)
	at com.intellij.openapi.progress.impl.ProgressSuspender.executeNonSuspendableSection(ProgressSuspender.java:89)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner.indexJobsFairly(IndexUpdateRunner.java:251)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner.lambda$doIndexFiles$2(IndexUpdateRunner.java:182)
	at com.intellij.util.indexing.contentQueue.IndexUpdateRunner$$Lambda$8566/0x0000000803458480.run(Unknown Source)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:24)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1$$Lambda$744/0x000000080088bbc8.run(Unknown Source)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:215)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at [email protected]/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at [email protected]/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:776)
	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:399)
	at [email protected]/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at [email protected]/java.lang.Thread.run(Thread.java:833)

Full dump: https://pastebin.com/yP22idiv

If you need help from JetBrains team, please file a request at https://youtrack.jetbrains.com/newIssue?project=IDEA

Cannot run tests within a folder

Steps to reproduce:

  1. Right-click on folder containing feature files.
    Screenshot 2023-08-11 at 2 47 56 PM
  2. Select "Run 'Tests in 'commission''".
    Screenshot 2023-08-11 at 2 48 55 PM
  3. Run dialog shows "No tests were found."
    Screenshot 2023-08-11 at 2 49 27 PM

All files are runnable. None are marked with @ignore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.