You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 |
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;
}
}
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
Version
The text was updated successfully, but these errors were encountered: