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

On clicking anything but the 1st data row of the unimplemented specs gives no details of scenarios #90

Closed
sswaroopgupta opened this issue Aug 29, 2016 · 2 comments
Labels

Comments

@sswaroopgupta
Copy link

Expected behavior
On clicking any data row of the unimplemented specs should give details of scenarios.

Actual behavior
On clicking anything but the 1st data row of the unimplemented specs gives no details of scenarios.

Steps to replicate

  1. Create a spec
Specification Heading
=====================

     |VowelCount|
     |----------|
     |1         |
     |2         |
     |3         |
     |4         |


werewr
------
* Vowels being "aeiou"1

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

tags: single word
* Vowels being "aeiou"1
* The word "gauge" has <VowelCount> vowels.

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

This is the second scenario in this specification

Here's a step that takes a table
* Vowels being "aeiou"2
* Almost all words have vowels<VowelCount> 

     |Word  |Vowel Count|
     |------|-----------|
     |Gauge |3          |
     |Mingle|2          |
     |Snap  |1          |
     |GoCD  |1          |
     |Rhythm|0          |
  1. Create an implementation
import com.thoughtworks.gauge.Step;
import com.thoughtworks.gauge.Table;
import com.thoughtworks.gauge.TableRow;
import java.util.HashSet;
import static org.junit.Assert.assertEquals;

public class StepImplementation {

    private HashSet<Character> vowels;

    @Step("Vowels being <vowelString>")
    public void setLanguageVowels(String vowelString) {
        vowels = new HashSet();
        for (char ch : vowelString.toCharArray()) {
            vowels.add(ch);
        }
    }

    @Step("The word <word> has <expectedCount> vowels.")
    public void verifyVowelsCountInWord(String word, int expectedCount) {
        int actualCount = countVowels(word);
        assertEquals(expectedCount, actualCount);
    }

    @Step("Almost all words have vowels<VowelCount> <wordsTable>")
    public void verifyVowelsCountInMultipleWords(int argVowelcount, Table wordsTable) throws Exception {
//        if(argVowelcount==3)
//            throw new Exception("sdfsdfsdf");
        for (TableRow row : wordsTable.getTableRows()) {
            String word = row.getCell("Word");
            int expectedCount = Integer.parseInt(row.getCell("Vowel Count"));
            int actualCount = countVowels(word);
            assertEquals(expectedCount, actualCount);
        }
    }

    private int countVowels(String word) {
        int count = 0;
        for (char ch : word.toCharArray()) {
            if (vowels.contains(ch)) {
                count++;
            }
        }
        return count;
    }
}

Version

Gauge version: 0.6.2.nightly-2016-08-05

Plugins
-------
csharp (0.9.1.nightly-2016-08-12)
html-report (2.2.0.nightly-2016-08-28)
java (0.5.1.nightly-2016-08-18)
ruby (0.3.2.nightly-2016-08-22)
spectacle (0.0.1)
xml-report (0.1.4.nightly-2016-07-25)
@mahendrakariya
Copy link
Contributor

Dev notes:

We will have to change Gauge core to send back unexecuted table row details as a part of SuiteResult object. Can be fixed along with #108.

@zabil
Copy link
Member

zabil commented Jul 21, 2020

Closing this as an old issue. This may be fixed in the newer releases.
Will reopen if it still needs fixing.

@zabil zabil closed this as completed Jul 21, 2020
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

3 participants