duykhoa
duykhoa

Reputation: 2302

What is a good way to test with Cucumber

I start learning to write Cucumber test, and now I can write the test, but my test is too silly; I don't know I should focus what and ignore what. I always ask my co.op how to write a good test with Cucumber, and they give me some advices, but I feel not satisfy enough. So, please tell me about your opinion and give me some examples, thanks so much!

EDIT

I had an index page with a table, and 3 buttons(edit, detail, delete) in the last column each row of the table and 1 button Create below the table, and the nav bar has a login form

So what thing I should check?

In my opinion, I think we shouldn't check login function and the content of the nav bar, because every page in this controller has the same layout Maybe we should check total columns, total rows, the title, the icon css, the content of button, the css of whole page (border of table, width, height, font-family) ... Is this true?

Upvotes: 0

Views: 122

Answers (1)

sameera207
sameera207

Reputation: 16619

I think you should prioritise the elements in your page, and check them.

As an example, when you test the login page:

Important elements of the login page

  • user name, password text boxes
  • login button

Not important elements (This all depends on your business requirement)

  • cancel button
  • other fancy text
  • etc..

and then in your Cucumber test, make sure you check the availability of user name, password text boxes and login button. The rest of the elements you can ignore. Otherwise you will be spending unnecessary time on testing non-important things.

Again, the priorities of your given page is depending on the business requirements of your project.

Upvotes: 1

Related Questions