getgauge / Intellij-Plugin

Gauge IntelliJ IDEA plugin
Apache License 2.0
44 stars 28 forks source link

External dependency issue when not using IntelliJ TestRunner #363

Closed pvskarps closed 5 years ago

pvskarps commented 5 years ago

My previous issue was closed saying to use the latest version of the IntelliJ plugin. Sorry if my description was not clear but I am using the latest IntelliJ Gauge plugin version (0.3.14). In fact this issue appears to have been introduced in version 0.3.13 and newer as the issue does not exist in 0.3.12.

I'm seeing what appears to be classpath issues with Gauge when I try to run a spec in IntelliJ when the IntellIJ Gauge plugin is set to NOT use the IntelliJ test runner. If we run through the test runner then everything is fine.

We are experiencing this with our Gradle gauge project and I've been able to reproduce it on the getgauge-examples/java-gradle-selenium project (https://github.com/getgauge-examples/java-gradle-selenium)

Expected behavior

Spec runs as expected

Actual behavior

Specs fail to execute due to classpath issues with external dependencies when no running through the IntelliJ test runner. The following is a shortened version of the output from the getgauge-examples/java-gradle-selenium project when running user.spec through the IntelliJ TestRunner is disabled:

C:\Users\MTQA\GaugeExe\gauge.exe run --simple-console C:/Users/MTQA/GaugeTest/java-gradle-selenium/specs/user.spec src\main\java\com\thoughtworks\gauge\example\pages\CreateProductPage.java:3: error: package org.openqa.selenium does not exist import org.openqa.selenium.WebElement; ^ src\main\java\com\thoughtworks\gauge\example\pages\CreateProductPage.java:8: error: cannot find symbol public WebElement product_title; ^ symbol: class WebElement location: class CreateProductPage src\main\java\com\thoughtworks\gauge\example\pages\CreateProductPage.java:10: error: cannot find symbol public WebElement product_description; ^ symbol: class WebElement location: class CreateProductPage src\main\java\com\thoughtworks\gauge\example\pages\CreateProductPage.java:12: error: cannot find symbol public WebElement product_author; ^ symbol: class WebElement location: class CreateProductPage

Steps to reproduce

  1. Use IntelliJ 2018.3 and Gauge Intellij Plugin 0.3.14
  2. Clone getgauge-examples/java-gradle-selenium project (I know it is deptricated but it does a good job of showing the issue).
  3. Open the project in IntelliJ
  4. Open File-Settings->Tools->Gauge and uncheck "Use IntelliJ test runner UI for execution"
  5. Run user.spec and you will see the external dependency issues

Version information

Plugins

html-report (4.0.6) java (0.6.9) screenshot (0.0.1) xml-report (0.2.0)

negiDharmendra commented 5 years ago

@pvskarps I was able to replicate this issue.

gaugebot[bot] commented 5 years ago

The fix should be available in nightly >= 10-12-2018

pvskarps commented 5 years ago

Thanks for the quick fix. I have verified the issues is fixed in the nightly build.