cancel
Showing results for 
Search instead for 
Did you mean: 

How do I ignore a piece of data in a feature cucumber file?

SOLVED
Highlighted
New Contributor

How do I ignore a piece of data in a feature cucumber file?

English: How do I ignore a piece of data in a feature cucumber file?

Russian: Как в feature файле cucumber сделать игнорирование части данных?

 

Example:

English:  I want the test to work positively. The text "ignoring_String" must be ignored.

Russian: Я хочу, чтобы тест отработал положительно. Текст «ignoring_String» должен быть игнорирован.

 

Feature file:

 

        When compare text with reference

            |Stream launched 2019-10-2315:40 by admin|

            |Stream launched ignoring_String by admin|

 

java class:

import io.cucumber.java.en.When;

import java.util.List;

import static org.junit.Assert.assertTrue;

 

public class MyTestStepdefs {

    @When("compare text with reference")

    public void compareTextWithReference(io.cucumber.datatable.DataTable dataTable) {

        List<List<String>> rows = dataTable.asLists(String.class);

        String text = "Stream launched 2019-10-2315:40 by admin";

        assertTrue(text.equals(rows.get(0).get(0)));

        assertTrue(text.equals(rows.get(1).get(0)));

    }

}

 

Added a link to the repository - https://github.com/gitosic/gradest.git

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: How do I ignore a piece of data in a feature cucumber file?

@Vitaliu2000 we don't yet have a dedicated Cucumber Community, but you can always address your question to the Cucumber Slack channel. Details here.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

6 REPLIES 6
Highlighted
Community Hero

Re: How do I ignore a piece of data in a feature cucumber file?

Is this being executed in TestComplete?  


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: How do I ignore a piece of data in a feature cucumber file?

Hi @Vitaliu2000, did you figure out the solution?

If not, let's keep working on it here. Please provide more details about your case starting with what tristaanogre is asking - are you executing this in TestComplete? This will help get the investigation going, thank you!


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
New Contributor

Re: How do I ignore a piece of data in a feature cucumber file?

Hello @sonya_m  and @tristaanogre and maybe someone who knows the solution 🙂 

I added the project to github at https://github.com/gitosic/gradest, to show the essence of the problem in more detail.

True, I found an alternative solution, but I'm not sure if this is the best option - https://github.com/gitosic/gradest/blob/18a076a55a0e3741cd42e28b4e859cf450b0b973/src/test/java/com/e...

 

Once again, I will outline the problem.

On the https://github.com/gitosic/gradest/blob/18a076a55a0e3741cd42e28b4e859cf450b0b973/src/test/java/com/e... line you need to check that there would be a positive check result.

 

Run test:

RunCucumberTest

 

Highlighted
Community Hero

Re: How do I ignore a piece of data in a feature cucumber file?

Hi,

 

I skimmed through the project in github and saw nothing related to TestComplete. Thus I assume that your question is not TestComplete-specific and you are just looking for Cucumber-specific one. Am I correct?

Also, all comments in github are in Russian which means an extermely low chances to get assistance from other but Russian-speaking part of this and github community.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
New Contributor

Re: How do I ignore a piece of data in a feature cucumber file?

Hello @AlexKaras !

Yes you are right. My question does not apply to TestComplete. It turns out that I incorrectly chose the resource where I wrote the question. Ready to delete the question, so as not to violate the policy of posting questions. I apologize! Yes, I'm from Russia and looking for an answer on foreign resources)) it seems like it's normal practice))

Highlighted
Community Manager

Re: How do I ignore a piece of data in a feature cucumber file?

@Vitaliu2000 we don't yet have a dedicated Cucumber Community, but you can always address your question to the Cucumber Slack channel. Details here.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!