Giter VIP home page Giter VIP logo

gauge-python's People

Contributors

apoorva-ga avatar cappumuc avatar chadlwilson avatar debashis9012 avatar dependabot-preview[bot] avatar dependabot[bot] avatar haroon-sheikh avatar hgsgtk avatar kashishm avatar killpanda avatar negidharmendra avatar nehashri avatar nivedhasenthil avatar riju91 avatar shubhamsc avatar sriv avatar surajbarkale avatar surevs avatar tjasinski avatar tobias-lehmann-aperto avatar zabil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gauge-python's Issues

Usage statistics should be displayed when step is implemented

From @sguptatw on April 20, 2018 1:47

Actual behavior
Statistics are not reflected after a change

07:14:07.195 --> notif: textDocument/didOpen: {"textDocument":{"uri":"file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py","languageId":"python","version":1,"text":"from getgauge.python import step, before_scenario, Messages\n\nvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\n\ndef number_of_vowels(word):\n    return len([elem for elem in list(word) if elem in vowels])\n\n\n# --------------------------\n# Gauge step implementations\n# --------------------------\n\n@step(\"The word \u003cword\u003e has \u003cnumber\u003e vowels.\")\ndef assert_no_of_vowels_in(word, number):\n    assert str(number) == str(number_of_vowels(word))\n\n\n@step(\"Vowels in English language \u003cvowels\u003e\")\ndef assert_default_vowels(given_vowels):\n\n    Messages.write_message(\"Given vowels are {0}\".format(given_vowels))\n    assert given_vowels == \"\".join(vowels)\n\n\n@step(\"Almost all words have vowels \u003ctable\u003e\")\ndef assert_words_vowel_count(table):\n    actual = [str(number_of_vowels(word)) for word in table.get_column_values_with_name(\"Word\")]\n    expected = [str(count) for count in table.get_column_values_with_name(\"Vowel Count\")]\n    assert expected == actual\n\n\n# ---------------\n# Execution Hooks\n# ---------------\n\n@before_scenario()\ndef before_scenario_hook():\n    assert \"\".join(vowels) == \"aeiou\"\n\n@step(\"some\")\ndef some():\n    assert False, \"Add implementation code\"\n\n@step(\"something\")\ndef something():\n    assert False, \"Add implementation code\"\n\n@step(\"aaa\")\ndef aaa():\n    assert False, \"Add implementation code\"\n"}}
07:14:07.544 <-- notif: textDocument/publishDiagnostics: {"uri":"file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/specs/some.spec","diagnostics":[{"range":{"start":{"line":5,"character":0},"end":{"line":5,"character":16}},"severity":1,"code":"@step(\"implement step\")\ndef implement_step():\n    assert False, \"Add implementation code\"\n","message":"Step implementation not found"}]}
07:14:08.160 --> request #24: textDocument/codeLens: {"textDocument":{"uri":"file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py"}}
07:14:08.160 --> notif: $/cancelRequest: {"id":24}
07:14:08.290 <-- result #24: textDocument/codeLens: [{"range":{"start":{"line":13,"character":0},"end":{"line":13,"character":14}},"command":{"title":"0 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":13,"character":0},"The word {} has {} vowels."]}},{"range":{"start":{"line":18,"character":0},"end":{"line":18,"character":14}},"command":{"title":"0 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":18,"character":0},"Vowels in English language {}"]}},{"range":{"start":{"line":25,"character":0},"end":{"line":25,"character":14}},"command":{"title":"0 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":25,"character":0},"Almost all words have vowels {}"]}},{"range":{"start":{"line":40,"character":0},"end":{"line":40,"character":14}},"command":{"title":"0 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":40,"character":0},"some"]}},{"range":{"start":{"line":44,"character":0},"end":{"line":44,"character":14}},"command":{"title":"1 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":44,"character":0},"something"]}},{"range":{"start":{"line":48,"character":0},"end":{"line":48,"character":14}},"command":{"title":"1 reference(s)","command":"gauge.showReferences","arguments":["file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py",{"line":48,"character":0},"aaa"]}}]
07:14:08.471 --> notif: textDocument/didChange: {"textDocument":{"uri":"file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py","version":2},"contentChanges":[{"text":"from getgauge.python import step, before_scenario, Messages\n\nvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\n\ndef number_of_vowels(word):\n    return len([elem for elem in list(word) if elem in vowels])\n\n\n# --------------------------\n# Gauge step implementations\n# --------------------------\n\n@step(\"The word \u003cword\u003e has \u003cnumber\u003e vowels.\")\ndef assert_no_of_vowels_in(word, number):\n    assert str(number) == str(number_of_vowels(word))\n\n\n@step(\"Vowels in English language \u003cvowels\u003e\")\ndef assert_default_vowels(given_vowels):\n\n    Messages.write_message(\"Given vowels are {0}\".format(given_vowels))\n    assert given_vowels == \"\".join(vowels)\n\n\n@step(\"Almost all words have vowels \u003ctable\u003e\")\ndef assert_words_vowel_count(table):\n    actual = [str(number_of_vowels(word)) for word in table.get_column_values_with_name(\"Word\")]\n    expected = [str(count) for count in table.get_column_values_with_name(\"Vowel Count\")]\n    assert expected == actual\n\n\n# ---------------\n# Execution Hooks\n# ---------------\n\n@before_scenario()\ndef before_scenario_hook():\n    assert \"\".join(vowels) == \"aeiou\"\n\n@step(\"some\")\ndef some():\n    assert False, \"Add implementation code\"\n\n@step(\"something\")\ndef something():\n    assert False, \"Add implementation code\"\n\n@step(\"aaa\")\ndef aaa():\n    assert False, \"Add implementation code\"\n\n@step(\"implement step\")\ndef implement_step():\n    assert False, \"Add implementation code\"\n"}]}
07:14:08.472 --> request #25: textDocument/codeLens: {"textDocument":{"uri":"file:///c%!A(MISSING)/work/testFolder/pythonexamples/basic1/step_impl/step_impl.py"}}
07:14:08.673 <-- result #25: textDocument/codeLens: null

Steps to replicate

  • Create a gauge-python project
  • Open a implementation file, statistics are reflected
  • Generate a stub implementation, statistics are not displayed

Version

Gauge version: 0.9.8.nightly-2018-04-19
Commit Hash: 58298e2

Plugins
-------
python (0.3.0.nightly-2018-04-18)

Copied from original issue: getgauge/gauge#1014

Remove the property PYTHONUNBUFFERED

Expected behavior
Remove the unused property

Actual behavior
In a newly created python project, python.properties has a property PYTHONUNBUFFERED. This is an unused property

Steps to replicate

  • Create a python project
  • Open the python.properties in the env/default folder

Version

Gauge version: 0.9.8.nightly-2018-03-06
Commit Hash: 4f23723

Plugins
-------
python (0.2.4.nightly-2018-03-06)

IDE features should work as expected

Actual behavior
The IDE features are not working as expected

  • Find usage statistics are not displayed
  • All steps in specification are marked as unimplemented

Steps to replicate

  • Open a gauge-python project

IDE features are not available

Version

Gauge version: 0.9.8
Commit Hash: 61d692c

Plugins
-------
python (0.3.0.nightly-2018-04-13)

Pip Version

Name: getgauge
Version: 0.3.0.dev20180413
Summary: Enables Python support for Gauge
Home-page: https://github.com/getgauge/gauge-python
Author: Gauge Team
Author-email: [email protected]
License: MIT
Location: /Users/sswaroop/Library/Python/2.7/lib/python/site-packages
Requires: protobuf, redBaron, ptvsd, grpcio

CPU usage should be acceptable

Actual behavior
The CPU usage on starting a gauge-python project is almost 100%

Steps to replicate

  • Open a gauge-python project

Note the CPU usage

Getting error when Debug option is used consecutively

Expected behavior
Should be able to debug without getting an error

Actual behavior
Getting the following errors
debuggerterminatedunexpectedly
debuggerconnectionrefused

Steps to replicate

  • On a gauge-python project.
  • Apply breakpoint.
  • Start debugging. once the debugging is complete. Restart the debugging process.

The above error was observed on Windows.

Version

Gauge version: 0.9.8.nightly-2018-02-28
Commit Hash: d997b9a

Plugins
-------
python (0.2.4.nightly-2018-02-28)

Bug on story #33

Unable to run specs

Expected behavior
Should be able to run specs

Actual behavior
Getting the following error

Traceback (most recent call last):
  File "start.py", line 6, in <module>
    from getgauge import api
ModuleNotFoundError: No module named 'getgauge'
Failed to start gauge API: Runner with pid 12876 quit unexpectedly(exit status 1).

Steps to replicate

  • gauge init python
    Downloading python.zip
    ...
    Copying Gauge template python to current directory ...
    Successfully initialized the project. Run specifications with "gauge run specs/".
  • gauge run specs
    Getting the above error

Version
python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32

Gauge version: 0.9.8.nightly-2018-01-19
Commit Hash: 0c66ca4

Plugins
----------
python (0.2.3)

Should not list _init_.py in the file list to generate step implementation

Expected behavior
The init.py files are required to make Python treat the directories as containing packages; This should not be listed for where to generate the step implementation.

Actual behavior
The init.py is being listed in the file list suggestions

Steps to replicate

  • Open VSCode
  • Add an unimplemented step
  • Ctrl+. on the step
  • Choose Create step implementation

In the list of files that come up, init.py is shown. This should not be in the list

Version

Gauge version: 0.9.8

Plugins
-------
csharp (0.10.2.nightly-2018-03-27)
email-report (0.0.1)
html-report (4.0.4.nightly-2018-03-28)
java (0.6.7.nightly-2018-03-16)
js (2.2.0.nightly-2018-03-29)
python (0.2.5)
report-seed (0.0.1)
ruby (0.4.3.nightly-2018-03-16)
screenshot (0.0.1)
xml-report (0.2.1.nightly-2018-03-28)

pip show getgauge

Name: getgauge
Version: 0.2.5
Summary: Enables Python support for Gauge
Home-page: https://github.com/getgauge/gauge-python
Author: Gauge Team
Author-email: [email protected]
License: MIT
Location: c:\python36\lib\site-packages
Requires: protobuf, redBaron, ptvsd
You are using pip version 9.0.2, however version 9.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

@before_step, @after_step execution hooks do not work (gauge 0.9.0, gauge-python 0.2.0)

Description

Running the example test after gauge init python (0.9.0) with an empty @before_step() or @after_step() hook results in an error. This problem does not occur e.g. with the Ruby language runner using gauge init ruby.

Expected behavior: no error, all tests run and pass OK

Actual behavior:

$ gauge run
Python: 3.6.1
Exception occurred while loading step implementations from file: step_impl\step_impl.py.
Traceback (most recent call last):
  File "C:\conda3\lib\site-packages\getgauge\impl_loader.py", line 50, in import_file
    importlib.import_module(os.path.splitext(rel_path.replace(os.path.sep, '.'))[0])
  File "C:\conda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "C:\bdd-demo\test\step_impl\step_impl.py", line 40, in <module>
    @before_step()
TypeError: before_step() missing 1 required positional argument: 'obj'

# Specification Heading
  ## Vowel counts in single word         P P
  ## Vowel counts in multiple word       P P

Successfully generated html-report to => C:\bdd-demo\test\reports\html-report
Specifications: 1 executed      1 passed        0 failed        0 skipped
Scenarios:      2 executed      2 passed        0 failed        0 skipped

Total time taken: 140ms

Steps to reproduce

  1. Create a directory, run gauge init python in it
  2. Append to step_impl/step_impl.py:
@before_step()
def before_step_hook():
	pass
  1. Run example test using gauge run

Version Information

  • Gauge version: 0.9.0
  • Gauge Python plugin version: 0.2.0
  • Python version: 3.6.1 (anaconda)
  • getgauge package version: 0.2.0
  • OS information: Windows 7 x64

Example fails with python 3.6.4

Description

I have Windows 10 and Python 3.6.4 installed.

When I run the gauge init python example the following error occurs

Traceback (most recent call last):
  File "start.py", line 4, in <module>
    from colorama import Style, init
ModuleNotFoundError: No module named 'colorama'
Failed to start gauge API: Runner with pid 6576 quit unexpectedly(exit status 1).

I would assume with a fresh gauge python project, running the example would simply work

Steps to reproduce

  1. Install Python 3.6.4
  2. Create example project gauge init python
  3. Call gauge run

Information that will help us debug

Gauge version: 0.9.7
Commit Hash: bc9784c

Plugins
-------
gauge-jira (0.0.1)
html-report (4.0.3)
java (0.6.6)
js (2.1.0)
report-seed (0.0.1)
screenshot (0.0.1)
spectacle (0.1.2)
xml-report (0.2.0)
  • python 3.6.4

Generate step implementation gives script error

Expected behavior
Should be able to run spec after generating the step from spec

Actual behavior
from getgauge. python import step is added after the step definitions. So getting TypeError: 'NoneType' object is not callable

Steps to replicate

  • Create a gauge-python project
  • Add a new step in spec
  • Generate step implementation
  • Run the specs

The type error is displayed

Version

Gauge version: 0.9.8.nightly-2018-04-26
Commit Hash: 5bd699e

Plugins
-------
python (0.3.0.nightly-2018-04-25)

Related to issue getgauge/gauge-vscode#119

On successful refactor, files should get refreshed

From @sguptatw on February 12, 2018 10:43

Actual behavior
Refactoring is successful, but the specification file starts showing parse errors for the refactored step.

Steps to replicate

  • Create a gauge-python project
  • In the IDE, refactor The word "gauge" has "3" vowels. to The word "gauge" has "3" vowels something
  • The refactored step shows in the spec file as an unimplemented step

Note: The implementation file and specification file have changed. The refactoring is successful. But the newly refactored step is shown as undefined.

Version

Gauge version: 0.9.8.nightly-2018-02-02
Commit Hash: bff4f46

Plugins
-------
python (0.2.4.nightly-2018-02-11)

Bug on story - getgauge/gauge-vscode#81

Copied from original issue: getgauge/gauge-vscode#137

Renaming a impl file gives duplicate step implementation

Expected behavior
Duplicate step implementation should be given only when current impl files have duplicate implementations

Actual behavior
Renaming an impl file gives duplicate step implementation

Steps to replicate

  • Create a new gauge-python project
  • Rename impl file
  • Open Specification file

Duplicate step implementations given in diagnostics

Version

Gauge version: 0.9.8.nightly-2018-04-26
Commit Hash: 5bd699e

Plugins
-------
csharp (0.10.3.nightly-2018-04-11)
html-report (4.0.4.nightly-2018-04-11)
java (0.6.7.nightly-2018-04-24)
js (2.2.0.nightly-2018-04-20)
python (0.3.0.nightly-2018-04-26)
ruby (0.5.0.nightly-2018-04-16)
screenshot (0.0.1)
xml-report (0.2.1.nightly-2018-04-05)

Failed to initialize project, exit status 1, using python 2.7 on last 2 releases

On both 0.1.3 and 0.1.2 versions of the plugin, I am getting this error when trying to initialize a new project:

Traceback (most recent call last):
File "./start.py", line 5, in
from getgauge.impl_loader import load_impls, copy_skel_files
ImportError: cannot import name copy_skel_files
Failed to initialize project. exit status 1

System Info:
MacOS 10.11.3
Python 2.7.12
getgauge 0.0.4
Gauge 0.5.0

I've successfully installed the python plugin version 0.1.1 and it initializes the project just fine. It's only the last 2 versions that aren't working for me.

Connection refused

Expected behavior
gauge run should work seamlessly

Actual behavior
Getting Connection refused error

Failed Step: Execute the spec "basic context execution" and ensure failure
        Specification: specs/terminologies/context_execution.spec:85
        Error Message: java.lang.AssertionError: [Execute : gauge run --simple-console --verbose specs/basic context execution.spec] 
        Command "run --simple-console --verbose specs/basic context execution.spec" did not complete successfully.
        STDOUT:
        Python: 3.6.4
        Traceback (most recent call last):
          File "start.py", line 36, in <module>
            main()
          File "start.py", line 19, in main
            s = connection.connect()
          File "/Users/vagrant/Library/Python/3.6/lib/python/site-packages/getgauge/connection.py", line 10, in connect
            s.connect(('127.0.0.1', int(os.environ['GAUGE_INTERNAL_PORT'])))
        ConnectionRefusedError: [Errno 61] Connection refused
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:4 Connection closed [127.0.0.1:65486] cause: EOF => 'First context'
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:5 write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection => 'Second context'
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:9 write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection => 'First Scenario step'
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:13 write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection => 'Second Scenario step'
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:18 write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection => 'Normal step3'
        [ValidationError] /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/specs/basic context execution.spec:19 write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection => 'Normal step4'
          Failed to initialize suite datastore. Error: write tcp 127.0.0.1:65500->127.0.0.1:65486: use of closed network connection
        Successfully generated html-report to => /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/context_exec87_883696489502404363/reports/html-report/index.html
        Specifications:	0 executed	0 passed	0 failed	0 skipped
        Scenarios:	0 executed	0 passed	0 failed	0 skipped

        Total time taken: 42ms

        STDERR:

        Stacktrace: 
        org.assertj.core.api.AbstractAssert.failWithMessage(AbstractAssert.java:112)
        com.thoughtworks.gauge.test.common.ExecutionSummaryAssert.hasSuccess(ExecutionSummaryAssert.java:122)
        com.thoughtworks.gauge.test.implementation.Execution.assertOn(Execution.java:109)
        com.thoughtworks.gauge.test.implementation.Execution.executeSpecAndEnsureFailure(Execution.java:94)

Observed on

DataStoreFactory.scenario_data_store().get("MyKey") returns keyerror

Description

At the scenario level, the DataStoreFactory get command fails and returns a keyerror instead of the value previously entered.

Steps to reproduce

  1. put a value in the Scenario level DatastoreFactory (DataStoreFactory.scenario_data_store().put(key, value)) as part of execution of a step
  2. retrieve a value from the scenario level DataStoreFactory as part of a following step in the scenario (DataStoreFactory.scenario_data_store().get(key))

Information that will help us debug

  • Gauge version: 0.9.4
  • Gauge Python plugin version (0.2.2)
  • Python version 2.7.13
  • getgauge package version, run pip3 show getgauge to get it: Version: 0.2.1
  • OS information: OS X El Capitan 10.11.6

Add a webdriver template to gauge-python

Actual behavior
Only the basic template is available

Proposed behavior

  • Have a template python-selenium for initializing a project with webdriver.

Version

Gauge version: 0.9.8.nightly-2018-03-05
Commit Hash: 63aeb3b

Plugins
-------
python (0.2.4.nightly-2018-02-28)

Failed to take screenshot using gauge_screenshot.

Expected behavior
Should capture screenshot on failure

Actual behavior
Getting Failed to take screenshot using gauge_screenshot.

Steps to replicate

  • Create a new gauge-python project
  • edit the example spec to have the following content
Specification Heading
=====================

This is an executable specification file. This file follows markdown syntax.
Every heading in this file denotes a scenario. Every bulleted point denotes a step.

To execute this specification, run

    gauge specs


* Vowels in English language are "aeiu".

Vowel counts in single word
---------------------------

tags: single word

* The word "gauge" has "3" vowels.


Vowel counts in multiple word
-----------------------------

This is the second scenario in this specification

Here's a step that takes a table

* Almost all words have vowels
     |Word  |Vowel Count|
     |------|-----------|
     |Gauge |3          |
     |Mingle|2          |
     |Snap  |1          |
     |GoCD  |1          |
     |Rhythm|0          |
  • Getting the following message when the specs are run
Failed to take screenshot using gauge_screenshot.
[Errno 2] No such file or directory

Version

Gauge version: 0.9.8.nightly-2018-02-26
Commit Hash: 77c642d

Plugins
-------
dotnet (0.0.1.nightly-2018-02-14)
html-report (4.0.4.nightly-2018-01-11)
java (0.6.7.nightly-2018-02-23)
js (2.1.1.nightly-2018-02-27)
python (0.2.4.nightly-2018-02-27)
ruby (0.4.3.nightly-2018-02-13)
spectacle (0.1.3.nightly-2017-10-26)

Gauge messages in hooks are not displayed

Expected behavior
The messages in hooks should be displayed

Actual behavior
The message from step hooks are displayed but others are not

Steps to replicate

  • Create a gauge-python project
  • Add hook messages

@before_scenario()
def before_scenario_hook():
    assert "".join(vowels) == "aeiou"
    Messages.write_message("before scenario")

@before_step
def before_step_hook():
    Messages.write_message("before step hook")

@after_step
def after_step_hook():
    Messages.write_message("after step hook")

@before_scenario
def before_scenario_hook1():
    Messages.write_message("before scenario hook")

@after_scenario
def after_scenario_hook():
    Messages.write_message("after scenario hook")

@before_spec
def before_spec_hook():
    Messages.write_message("before spec hook")

@after_spec
def after_spec_hook():
    Messages.write_message("after spec hook")

@before_suite
def before_suite_hook():
    Messages.write_message("before suite hook")

@after_suite
def after_spec_hook1():
    Messages.write_message("after suite hook")
  • Run the specs

In the html-report, only step hooks are displayed

Version

Gauge version: 0.9.8.nightly-2018-04-19
Commit Hash: 58298e2

Plugins
-------
html-report (4.0.4.nightly-2018-04-11)
java (0.6.7.nightly-2018-04-19)
python (0.3.0.nightly-2018-04-18)
ruby (0.5.0.nightly-2018-04-16)
xml-report (0.2.1.nightly-2018-04-05)
PS <user>> pip show getgauge
Name: getgauge
Version: 0.3.0.dev20180418
Summary: Enables Python support for Gauge
Home-page: https://github.com/getgauge/gauge-python
Author: Gauge Team
Author-email: [email protected]
License: MIT
Location: c:\python36\lib\site-packages
Requires: protobuf, redBaron, ptvsd, grpcio
You are using pip version 9.0.2, however version 10.0.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Provide a mechanism where users can specify the python version which will be used to run the specs

From @galacticgumshoe

In order to use Python 3 on mac, I have to use 'python3' command. Otherwise, if I just run 'python' command it runs as Python 2(default version). Getgauge package uses python command to run the tests, So it uses python 2 and mac doesn't recommend to change the default python to python3 because many Apple- or third-party software are dependent on that(https://docs.python.org/3/using/mac.html).

There should be a mechanism where users can specify the python version which will be used to run the specs. For more details refer #5.

Unable to install pip gauge for nightly

Expected behavior
If python nightly is python (0.2.5.nightly-2018-03-20), then the user should be able to install
pip install --pre getgauge==0.2.5.dev.20180320

Actual behavior
Getting the error

  Could not find a version that satisfies the requirement getgauge==0.2.5.dev.20180320 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4.dev20180207, 0.2.4.dev20180208, 0.2.4.dev20180209, 0.2.4.dev20180211, 0.2.4.dev20180215, 0.2.4.dev20180216, 0.2.4.dev20180220, 0.2.4.dev20180223, 0.2.4.dev20180227, 0.2.4.dev20180228, 0.2.4.dev20180302, 0.2.4.dev20180306, 0.2.4.dev20180307, 0.2.4.dev20180308, 0.2.4.dev20180312, 0.2.4.dev20180316, 0.2.5.dev20180319, 0.2.5)
No matching distribution found for getgauge==0.2.5.dev.20180320

Steps to replicate

  • install python nightly-0.2.5 2018/03/20
  • pip install --pre getgauge==0.2.5.dev.20180320

Getting the above error

A new user should be able to run specs after project initialization

Current behavior
pip install getgauge is required

Proposed behavior
A user with only gauge installed should be able to work after initializing a project

Steps to replicate

  • Ensure getgauge is not installed/uninstalled in pip
  • Ensure python is not installed/uninstalled
  • Create a new gauge-python project from VSCode.
  • gauge run specs gives Failed to start gauge API

gauge-python plugin is installed but getgauge is not installed on pip

Version

Gauge version: 0.9.8.nightly-2018-04-19
Commit Hash: 58298e2

Plugins
-------
html-report (4.0.4.nightly-2018-04-11)
python (0.3.0.nightly-2018-04-18)

Related to getgauge/gauge-vscode#211

Installation issue - Missing api.py

Description

Every time we set up a new machine to run the gauge python, I run into issue where
from getgauge import api
step fails.
We have to remove , reinstall and somehow it comes. Or manually get the getgauge files and put it there from other machine.

We follow the instructions given here : http://gauge-python.readthedocs.io/en/latest/installation.html

and always used pip to install the getgauge

Steps to reproduce

  1. Install getgauge
  2. Install gauge python plugin
  3. Run spec file

Information that will help us debug

  • Gauge version 0.7.0
  • Gauge Python plugin version 0.1.7
  • Python version 2.7.10
  • getgauge package version, run pip3 show getgauge to get it : 0.1.7
  • OS information Mac OS Sierra

Cant seem to get python project to initiailise

Hi I keep getting

Plugin python 0.0.2 is already installed.
Philip-Beadle-MacBook-Pro:specs philipbeadle$ gauge --init python
 create  manifest.json
 create  specs
 create  specs/example.spec
 create  env
 create  env/default
 create  env/default/default.properties
Traceback (most recent call last):
  File "./start.py", line 4, in <module>
    from getgauge import connection, processor
ImportError: No module named getgauge
Failed to initialize. exit status 1

and theres no steps file created either.

Use of network connection closed

Getting the network connection closed

Traceback (most recent call last):
  File "start.py", line 26, in <module>
    main()
  File "start.py", line 22, in main
    processor.dispatch_messages(s)
  File "C:\Python36\lib\site-packages\getgauge\processor.py", line 215, in dispatch_messages
    processors[request.messageType](request, response, socket)
  File "C:\Python36\lib\site-packages\getgauge\processor.py", line 144, in _cache_file
    reload_steps(request.cacheFileRequest.content, request.cacheFileRequest.filePath)
  File "C:\Python36\lib\site-packages\getgauge\static_loader.py", line 26, in reload_steps
    load_steps(content, file_name)
  File "C:\Python36\lib\site-packages\getgauge\static_loader.py", line 13, in load_steps
    red = RedBaron(content)
  File "C:\Python36\lib\site-packages\redbaron\redbaron.py", line 36, in __init__
    self.node_list = base_nodes.NodeList.from_fst(baron.parse(source_code), parent=self, on_attribute="root")
  File "C:\Python36\lib\site-packages\baron\baron.py", line 49, in parse
    tokens = tokenize(source_code, False)
  File "C:\Python36\lib\site-packages\baron\baron.py", line 70, in tokenize
    return mark_indentation(inner_group(space_group(_tokenize(group(split(pouet)), print_function))))
  File "C:\Python36\lib\site-packages\baron\indentation_marker.py", line 24, in mark_indentation
    return list(mark_indentation_generator(sequence))
  File "C:\Python36\lib\site-packages\baron\indentation_marker.py", line 85, in mark_indentation_generator
    the_indentation_level_changed = get_space(current) is None or get_space(current) != indentations[-1]
  File "C:\Python36\lib\site-packages\baron\indentation_marker.py", line 38, in get_space
    if len(node) < 3 or len(node[3]) == 0:

Clicking on the stacktrace takes to the next line

Expected behavior
Clicking on the stacktrace should take the user to the code line with the issue

Actual behavior
It takes the user to the next line of the code with the issue

Steps to replicate

  • Create a new gauge-python project
  • Add a new step. Generate stub implementation
  • Run the specs
  • On VSCode console click on the stacktrace with the error in impl file

The user is taken to the next line where the error occurred.

Version

Gauge version: 0.9.8.nightly-2018-04-26
Commit Hash: 5bd699e

Plugins
-------
python (0.3.0.nightly-2018-04-26)

Step is not found when the py script with @step function is imported by another script

Hi,
I was running my gauge python code, and I found a problem.
Let's say there is an a.py, it has an @step decorator like below:

from getgauge.python import step


@step('run a')
def this_is_a():
    print('running a')


def this_is_another_a():
    print('running another a')

And there is another script, let's say b.py that imports a.py as below:

from step_impl.ZeusLibrary import a
from getgauge.python import step


@step('run b')
def this_is_b():
    a.this_is_another_a()

Now let's run the gauge spec as below shows:

Spec
=====================


Case
------------------
* run a
* run b

, it will throw ValidationError because it cannot find @step('run a').

The workaround is if I want to use the function in a.py, I must import it inside a function in b.py instead of importing it globally.

Console output as below:
Python: 3.5.2
[ValidationError] /Users/xxx/Documents/xxx/specs/1.spec:7: 1 => 'run a'

Tagged execution hooks not working (gauge-python 0.3.6, getgauge 0.2.0, gauge 0.8.5)

Description

Creating tagged execution hooks does not work for specs (untested with scenarios).

The table of values referenced in this issue:

    | search_terms                              |
    | MKS Instruments                           | 
    | RF Power Generator                        |
    | PECVD plasma enhanced vapour deposition   |

Having a table of values at the specification level causes tags to be lost/ignored within the execution context. This can be verified by using the following execution hooks:

# ---------------
# Execution Hooks
# ---------------

@before_spec()
def before_spec(exec_cxt):
    print("\nbefore_scenario_hook: websearch\n")
    print(exec_cxt)
    context.driver = webdriver.Chrome()
    context.driver.implicitly_wait(10)

@after_spec()
def after_spec(exec_cxt):
    print("\nafter_scenario_hook: websearch\n")
    print(exec_cxt)
    context.driver.quit()

This produces output like:

$ gauge --tags "websearch" specs
Python: 3.6.1
# Web Search

before_scenario_hook: websearch

ExecutionInfo: { Specification: { name: Web Search, is_failing: False, tags: , file_name: C:\test\gauge\specs\websearch.spec }, Scenario: { name: , is_failing: False, tags:  }, Step: { text: , is_failing: False } }
  ## User visits google.com      P P P P

     |search_terms   |
     |---------------|
     |MKS Instruments|
  ## User searches using google.com      P P P P

     |search_terms      |
     |------------------|
     |RF Power Generator|
  ## User searches using google.com      P P P P

     |search_terms                           |
     |---------------------------------------|
     |PECVD plasma enhanced vapour deposition|
  ## User searches using google.com      P P P P

after_scenario_hook: websearch

ExecutionInfo: { Specification: { name: Web Search, is_failing: False, tags: , file_name: C:\test\gauge\specs\websearch.spec }, Scenario: { name: User searches using google.com, is_failing: False, tags: google search }, Step: { text: Element "//div[@id='resultStats']" appears within "5" seconds, is_failing: False } }

Successfully generated html-report to => C:\test\gauge\reports\html-report
Specifications: 1 executed      1 passed        0 failed        0 skipped
Scenarios:      2 executed      2 passed        0 failed        0 skipped

Total time taken: 14.827s

In particular, notice that ExecutionInfo['Specification']['tags'] is EMPTY.

Removing the table of values and any scenarios that use <search_terms> results in ExecutionInfo['Specification']['tags'] being populated correctly. Instructions for doing this are provided in the Workarounds section under Steps to Reproduce.

Output when spec-level tables and scenarios that use them are removed:

$ gauge --tags "websearch" specs
Python: 3.6.1
# Web Search

before_scenario_hook: websearch

ExecutionInfo: { Specification: { name: Web Search, is_failing: False, tags: websearch, file_name: C:\test\gauge\specs\websearch.spec }, Scenario: { name: , is_failing: False, tags:  }, Step: { text: , is_failing: False } }
  ## User visits google.com      P P P P

after_scenario_hook: websearch

ExecutionInfo: { Specification: { name: Web Search, is_failing: False, tags: websearch, file_name: C:\test\gauge\specs\websearch.spec }, Scenario: { name: User visits google.com, is_failing: False, tags: visit google }, Step: { text: Look for "//input[@value='Google Search']", is_failing: False } }

Successfully generated html-report to => C:\test\gauge\reports\html-report
Specifications: 1 executed      1 passed        0 failed        0 skipped
Scenarios:      1 executed      1 passed        0 failed        0 skipped

Total time taken: 8.986s

In particular, notice that ExecutionInfo['Specification']['tags'] is NOT EMPTY.

This behavior may be a bug with Gauge itself.

Steps to reproduce

  1. Install selenium. Install Chrome webdriver to PATH.

  2. step_impl/websearch.py

Note that the @before_spec and @after_spec hooks are tagged with websearch

from getgauge.python import *
# step, after_suite, Messages, DataStoreFactory

from selenium import webdriver
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0

# ---------------
# Execution Hooks
# ---------------

@before_spec("<websearch>")
def before_spec():
    context.driver = webdriver.Chrome()
    context.driver.implicitly_wait(10)

@after_spec("<websearch>")
def after_spec():
    context.driver.quit()

class Context(object):
    pass

context = Context()

# --------------------------
# Gauge step implementations
# --------------------------

@step('Visit <url>')
def test_visit_url(url):
    if not (url.startswith("http://") or url.startswith("https://")):
        context.driver.get("http://"+ url)
    else:
        context.driver.get(url)
    assert url in context.driver.current_url

@step('Look for <xpath>')
def test_find_element(xpath):
    try:
        e = context.driver.find_element_by_xpath(xpath)
    except:
        Messages.write_message('Could not find element with xpath "%s"' % xpath)
    assert isinstance(e, WebElement) is True
    return e

@step('Element <xpath> appears within <wait_time> seconds')
def test_wait_and_find_element(xpath, wait_time):
    try:
        e = WebDriverWait(context.driver, float(wait_time)).until(EC.presence_of_element_located((By.XPATH, xpath)))
    except:
        Messages.write_message('Could not find element with xpath "%s"' % xpath)
    assert isinstance(e, WebElement) is True
    return e


@step('Enter <search_terms> into <xpath>')
def test_enter_data_into_element(search_terms, xpath):
    e = test_find_element(xpath)
    e.send_keys(search_terms)
    assert e.get_attribute('value') == search_terms

@step('Click <xpath>')
def test_click_element(xpath):
    e = test_find_element(xpath)
    e.click()
  1. specs/websearch.spec
# Web Search

Tags: websearch

    | search_terms                              |
    | MKS Instruments                           | 
    | RF Power Generator                        |
    | PECVD plasma enhanced vapour deposition   |

This is a demo specification for puppeting a Google Chrome instance which is used to search the web.

To execute this specification, run

    gauge specs

## User visits google.com

Tags: visit google

In this scenario, the user visits google.com and sees: the google logo (img), a search box (input), and a search button (input).

* Visit "google.com"
* Look for "//img[@alt='Google']"
* Look for "//input[@name='q' and @value='']"
* Look for "//input[@value='Google Search']"

## User searches using google.com

Tags: google search

In this scenario, the user navigates to google.com and performs a few searches.

* Visit "google.com"
* Enter <search_terms> into "//input[@name='q']"
* Click "//button[@value='Search' and @aria-label='Google Search']"
* Element "//div[@id='resultStats']" appears within "5" seconds
  1. Run gauge

gauge --tags "websearch" specs

Expected behaviour:
The before_spec and after_spec hooks are executed, correctly instantiating the Selenium webdriver at the start of the spec and then closing the browser at the end of the spec.

Actual behaviour:
None of the tagged-execution hooks are run.

Workarounds:

  1. Remove <search_terms> table at specification level. Remove any scenarios that use <search_terms>.

Updated specs/websearch.spec

# Web Search

Tags: websearch

This is a demo specification for puppeting a Google Chrome instance which is used to search the web.

To execute this specification, run

    gauge specs

## User visits google.com

Tags: visit google

In this scenario, the user visits google.com and sees: the google logo (img), a search box (input), and a search button (input).

* Visit "google.com"
* Look for "//img[@alt='Google']"
* Look for "//input[@name='q' and @value='']"
* Look for "//input[@value='Google Search']"

This is undesirable because it requires removing tests, or defining them in an inconvenient manner (e.g. hardcoded values instead of dynamic values from table).

  1. Use untagged execution hooks:
# ---------------
# Execution Hooks
# ---------------

@before_spec()
def before_spec():
    context.driver = webdriver.Chrome()
    context.driver.implicitly_wait(10)

@after_spec()
def after_spec():
    context.driver.quit()

Unfortunately, now the before_spec and after_spec hooks will be run for ALL specs (undesirable for suites containing multiple disparate specs).

Version Information

  • Gauge version: 0.8.5
  • Gauge Python plugin version: 0.3.6
  • Python version: 3.6.1 (conda env)
  • getgauge package version, run pip3 show getgauge to get it: 0.2.0
  • OS information: Windows 7 x64

Goto definition of another step after generate stub gives error

Expected behavior
Should not get use of closed network connection

Actual behavior
Getting the error

Steps to replicate

  • Create a gauge init python
  • add an unimplemented step
  • Generate stub for this step - copy the implementation
  • Now try goto definition of step * The word "gauge" has "3" vowels.

Note: We get the error - use of closed network connection Code: 0

Version

Gauge version: 0.9.8.nightly-2018-02-15
Commit Hash: dfbaee0

Plugins
-------
python (0.2.4.nightly-2018-02-16)

Bug on story #19

Starting relative directory is always ~/.gauge/plugins/python/<version> and isn't being changed when specifying '--dir .'

I have initialized my gauge project at ~/GitHub/sceo-test-suite on my local system. I have a docker compose file which I am running to simulate my testing environment, and I placed that in a new directory called ~/GitHub/sceo-test-suite/compose/message-pull-producer. So far I've had to "hard code" an absolute path to this file in my Python code (/Users/myuser/GitHub/sceo-test-suite/compose/message-pull-producer), which won't work if any of my other co-workers wants to clone this project and run it on their systems. I also need to promote this to a Ubuntu OpenStack server in my CICD environment to automate the system tests. So I really need relative pathing to work. For example, if I am currently in ~/GitHub/sceo-test-suite and I run 'gauge --dir . specs' I get this error when my Python code is using os.getcwd():

.IOError: [Errno 2] No such file or directory: '/Users/myuser/.gauge/plugins/python/0.1.3/compose/message-pull-producer-environment/docker-compose.yml'

You can see that my present working directory has somehow shifted from where I executed the gauge command to start in ~/.gauge/plugins/python/0.1.3. It expects then that I essentially have initialized my project in the plugin subdirectory and will always be working from there. Effectively ignoring the '--dir .' I passed in at runtime.

Should be able to work seamlessly with workspaces

Actual behavior
IDE features stops working after a couple of projects are added to the workspaces

Steps to replicate

  • Create a gauge-python project
  • Add it to the workspace
  • Reload the project
  • Double click and Open an example.spec file from the project (so that the file remains open even after Goto definition)
  • Goto definition on a step.
  • Keep adding more projects.

Note: Currently I am able to work with 2 projects in workspace. For the third project, IDE features do not work as expected. This may be a performance issue. The number of projects to be added to replicate the issue can differ.

Version

Gauge version: 0.9.8
Commit Hash: 8166611

Plugins
-------
python (0.2.4.nightly-2018-02-11)

Gauge Screenshots Fail

Description

When I run tests in Gauge and they fail, I expect Gauge to take screenshots and put them into the fancy html report. Currently they do not, we see "Failed to take screenshot using gauge screenshot"

Steps to reproduce

  1. Given you have tests written using Gauge
  2. When you execute those tests
  3. And one or more fail
  4. Then you see the error message about failed screenshots

Information that will help us debug

  • Gauge: 0.9.4
  • Gauge Python plugin version: 0.2.2
  • Python version: 2.7.14
  • getgauge : 0.2.2
  • OS information: OS X El Capitan 10.11.6

Upgrade Issue

Description

Error in running gauge python suite after latest update.

Steps to reproduce

  1. Update gauge and related plugins

Steps Tried

Remove all and reinstall from scratch
update getgauge to latest 0.2.2/0.2.3 [both tried]
Same configuration on another machine with High Sierra works fine.

Error

Getting error while running the default project -

gauge run specs/
TEST: opening 'start'
Python: 2.7.10
[ValidationError] /Users/ets-qa-macmini/Documents/tesproj/specs/example.spec:12 Step implementation not found => 'Vowels in English language are "aeiou".'

api.log shows below

19:36:41.518 Sending API response: messageType:UnsupportedApiMessageResponse messageId:42 unsupportedApiMessageResponse:<>
10:33:18.465 Api Request Received: messageType:GetStepValueResponse messageId:165 stepValueRequest:<stepText:"The word has vowels." >

Information that will help us debug

  • Gauge version: 0.9.6
    Plugins
    html-report (4.0.2)
    java (0.6.5)
    python (0.2.3)
    screenshot (0.0.1)
    xml-report (0.2.0)
  • Python version 2.7
  • getgauge package version, run pip show getgauge to get it
    Name: getgauge
    Version: 0.2.0
    Summary: Enables Python support for Gauge
    Home-page: https://github.com/kashishm/gauge-python
    Author: Kashish Munjal
    Author-email: [email protected]
    License: MIT
    Location: /usr/local/lib/python2.7/site-packages
    Requires: protobuf, redBaron, colorama
  • OS information - Mac OS Sierra 10.12.6

Failed to take screenshot using gauge_screenshot

Expected behavior
If screenshot is not installed, it should be installed and screenshot should be captured

Actual behavior
Getting the error

Failed to take screenshot using gauge_screenshot.
[WinError 2] The system cannot find the file specified

Steps to replicate

  • Ensure screenshot is uninstalled/not installed.
  • Create a gauge-python project
  • Add a hook
@before_suite
def before_suite_hook():
    assert 1==2
    Messages.write_message("before suite hook")
  • Run the specs

The above errors is displayed

The parameter names in signature should be independent of parameter values

Expected behavior
The parameter names in signature should be independent of parameter values

Actual behavior
The names generated for the parameter is based on the parameter value

Steps to replicate

  • Create a gauge-python project
  • Create a step Upload file <file:specs/something.txt>
  • Generate the implementation

The implementation has the file path mentioned in the annotation text
@step("Upload file:specs/something.txt")
def upload(file:specs/something.txt):
assert False, "Add implementation code"

Version

Gauge version: 0.9.8.nightly-2018-03-29
Commit Hash: b79de74

Plugins
-------
html-report (4.0.4.nightly-2018-03-28)
python (0.2.6.nightly-2018-03-26)
screenshot (0.0.1)

Failed to read execution status

Expected behavior
Should be able to execute specs

Actual behavior

[Error - 11:20:58] Failed to read execution status information. Reason: File /Users/sswaroop/work/python/basic/.gauge/executionStatus.json doesn't exist.
[Info  - 11:20:58] Connection to server got closed. Server will restart.

Steps to replicate

  • Create a new js project
  • Open the project
  • Run all specifications

Version

Gauge version: 0.9.8.nightly-2018-02-13
Commit Hash: 7d3dc0a

Plugins
-------
python (0.2.4.nightly-2018-02-11)

Python process is not killed after shutdown/exit call

Expected behavior
When a shutdown/exit call is made by the client, the Python orphan process should be killed

Actual behavior
The Python orphan process is not killed

Steps to replicate

  • Run LSP tests using --env=python-wd
  • On OSx top -u -s5

There are orphan Python processes.

Version

Gauge version: 0.9.8
Commit Hash: 61d692c

Plugins
-------
python (0.3.0.nightly-2018-04-13)

Failed to initialize project. exit status 127

I'm getting an error running gauge --init python. I have installed getgauge-0.1.1.

Please advise.
Thanks, Bernd

$ gauge --init python

 create  manifest.json
 create  specs
 create  specs/example.spec
 create  env
 create  env/default
 create  env/default/default.properties
/usr/bin/env: python -u: No such file or directory

$ gauge -v

Gauge version: 0.4.0

Plugins
-------
html-report (2.1.0)
java (0.3.4)
python (0.1.1)

Rename module and package

Description

Change the package name and structure so that it's

from gauge import step, before_scenario, Messages

Maintain backward compatibility by adding deprecations in the old style i.e

from getgauge.python import step, before_scenario, Messages

Debug adapter process has terminated unexpectedly

Expected behavior
Should be able to debug seamlessly

Actual behavior
Debug adapter process has terminated unexpectedly

Steps to replicate

  • Create a gauge-python project
  • Debug Spec
  • Debug Scenario
  • Debug Spec

The message appears Debug adapter process has terminated unexpectedly

Version

Gauge version: 0.9.8.nightly-2018-04-26
Commit Hash: 5bd699e

Plugins
-------
python (0.3.0.nightly-2018-04-26)

Runner should log to log files when started gauge is started as daemon

Runner console logs should be logged to the log file when started as daemon.
When gauge is running as lsp server, runner console should be redirected to lsp.log.
When gauge is running as api daemon, runner console should be redirected to api.log.
In the above two cases, runner should log to the log files with proper formatting. Current log file format for gauge is 'HH:MM:ss.l'. (eg :- 12:50:11.221)

When gauge is started in CLI, console should be the standard output. It should not log with timestamp.

problem when running the sample

I installed gauge-python with gauge --install python, made the init gauge --init python then tried to run it with gauge specs/example.spec but the result is not really what I expected :).
Did I missed something?

gauge specs/example.spec
# Specification Heading
  ## Vowel counts in single word    Traceback (most recent call last):
  File "./start.py", line 18, in <module>
    main()
  File "./start.py", line 14, in main
    processor.dispatch_messages(s)
  File "/usr/local/lib/python2.7/site-packages/getgauge/processor.py", line 142, in dispatch_messages
    processors[request.messageType](request, response, socket)
  File "/usr/local/lib/python2.7/site-packages/getgauge/processor.py", line 75, in _execute_before_scenario_hook
    run_hook(request, response, registry.before_scenario(tags), execution_info)
  File "/usr/local/lib/python2.7/site-packages/getgauge/executor.py", line 24, in run_hook
    if len(inspect.signature(hook).parameters) == 0:
AttributeError: 'module' object has no attribute 'signature'
    Error Message: Connection closed [127.0.0.1:63970] cause: EOF
    Stacktrace:

    Error Message: write tcp 127.0.0.1:63969->127.0.0.1:63970: use of closed network connection
    Stacktrace:


  Failed to initialize scenario datastore. Error: write tcp 127.0.0.1:63969->127.0.0.1:63970: use of closed network connection
  write tcp 127.0.0.1:63969->127.0.0.1:63970: use of closed network connection
  Error Message: write tcp 127.0.0.1:63969->127.0.0.1:63970: use of closed network connection
  Stacktrace:


  Error Message: write tcp 127.0.0.1:63969->127.0.0.1:63970: use of closed network connection
  Stacktrace:

Unable to connect to plugin Html Report 2.1.0. proto: required field "SuiteExecutionResult.SuiteResult.SpecResults.ProtoSpec.PreHookFailure.StackTrace" not set

Specifications: 1 executed  0 passed    1 failed    0 skipped
Scenarios:  1 executed  1 passed    0 failed    1 skipped

Total time taken: 233ms
  • Mac 10.11.3
  • python 2.7.11
  • gauge 0.4.0
  • gauge-python 0.1.2

After refactoring, find-usage statistics and step implementation recognition should work

Actual behavior
The parameter name in the generated annotation after refactoring takes the value given in the text as the parameter name.
Find usages do not work and step implementation is not recognized

Steps to replicate

  • In a gauge-python project
  • Refactor Vowels in English language are "aeiou" to Vowels in English language are "aeiou" something else "" and "ddd"

Version

auge version: 0.9.8.nightly-2018-02-15
Commit Hash: dfbaee0

Plugins
-------
python (0.2.4.nightly-2018-02-16)

pip version

Name: getgauge
Version: 0.2.4.dev20180216
Summary: Enables Python support for Gauge
Home-page: https://github.com/getgauge/gauge-python
Author: Gauge Team
Author-email: [email protected]
License: MIT
Location: /Library/Python/2.7/site-packages
Requires: protobuf, redBaron

Bug on story - getgauge/gauge-vscode#81

Gauge API failed to start - Connection issue: GAUGE_INTERNAL_PORT

Description

Add the expected behavior/issue description/Actual behavior here
My gauge installation stopped working. It is throwing the following error message:
Traceback (most recent call last):
File "start.py", line 25, in
main()
File "start.py", line 17, in main
s = connection.connect()
File "/usr/local/lib/python3.5/site-packages/getgauge/connection.py", line 10, in connect
s.connect(('localhost', int(os.environ['GAUGE_INTERNAL_PORT'])))
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
Failed to start gauge API: Runner with pid 20637 quit unexpectedly(exit status 1).

Steps to reproduce

  1. Install gauge on MAC OSX Sierra 10.12.6 via the terminal using:
    a. brew update
    b. brew install gauge
    c. gauge install python
  2. Ensure you have python3 installed and run the following:
    a. pip3 install getgauge
    b. pip3 list <-- verify if it got installed
  3. Create an empty folder in your home folder
    a. mkdir temp
    b. cd temp
  4. Initialize the project
    a. gauge init python
  5. Update env/default/python.properties to use python3 instead
  6. Execute the dummy test case that comes with gauge:
    a. gauge run specs
  7. Verify the error message you get. Verify if you see any error message pertaining to GAUGE_INTERNAL_PORT and that the Gauge API failed to start.

Information that will help us debug

  • Gauge version

  • Gauge Python plugin version: getgauge (0.2.2)

  • Python version: 3.5.2

  • PIP3 version: pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5)

  • getgauge package version, run pip3 show getgauge to get it
    Name: getgauge
    Version: 0.2.2
    Summary: Enables Python support for Gauge
    Home-page: https://github.com/kashishm/gauge-python
    Author: Kashish Munjal
    Author-email: [email protected]
    License: MIT
    Location: /usr/local/lib/python3.5/site-packages
    Requires: protobuf, redBaron, colorama

  • OS information
    MAC OSX 10.12.6 Sierra using both the built-in terminal and iTerm2 3.1.2

Exception when project is opened in VSCode

Expected behavior
The IDE behavior should be available for python features

Actual behavior
The IDE features are not available

15:02:43.793 --> result #0: client/registerCapability: null
Traceback (most recent call last):
  File "start.py", line 36, in <module>
    main()
  File "start.py", line 25, in main
    processor.dispatch_messages(s)
  File "/Users/sswaroop/Library/Python/2.7/lib/python/site-packages/getgauge/processor.py", line 218, in dispatch_messages
    processors[request.messageType](request, response, socket)
KeyError: 31
15:02:43.925 notif #0: initialized: Connection closed [127.0.0.1:49653] cause: EOF

Steps to replicate

  • Open the gauge-python project in VSCode

The above exception occurs

Version

auge version: 0.9.8.nightly-2018-04-05
Commit Hash: 51a094a

Plugins
-------
html-report (4.0.4.nightly-2018-03-30)
java (0.6.7.nightly-2018-04-05)
js (2.2.0.nightly-2018-03-29)
python (0.2.6.nightly-2018-03-28)

pip show getgauge

Name: getgauge
Version: 0.2.6.dev20180328
Summary: Enables Python support for Gauge
Home-page: https://github.com/getgauge/gauge-python
Author: Gauge Team
Author-email: [email protected]
License: MIT
Location: /.../Python/2.7/lib/python/site-packages
Requires: protobuf, redBaron, ptvsd
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

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.