Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage statistics should be displayed when step is implemented #1014

Closed
sswaroopgupta opened this issue Apr 20, 2018 · 1 comment
Closed

Usage statistics should be displayed when step is implemented #1014

sswaroopgupta opened this issue Apr 20, 2018 · 1 comment
Labels

Comments

@sswaroopgupta
Copy link
Contributor

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)
@nehashri
Copy link
Contributor

This issue was moved to getgauge/gauge-python#56

@ghost ghost removed the ready label Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants