✅ Data

Bạn đang xem: Datatable hỗ trợ gì cho người sử dụng

Tables trong Cucumber là gì?✅ Viết demo cases Gherkin tất cả chứa Data
Tables✅ xử trí Data
Tables trong code auto test

✅ Data
Tables trong Cucumber là gì?

Data
Table
trong Cucumber là 1 trong những bảng dữ liệu được kèm theo với một step trong ngữ điệu Gherkin của một Scenario. Data
Table khá thú vui và rất có thể được sử dụng để thực thi data theo khá nhiều cách.Data
Tables cũng khá được sử dụng để giải pháp xử lý lượng lớn tài liệu (nhiều rows). Chúng rất mạnh nhưng cũng cần phải chút thời gian nghiên cứu khi sử dụng vì bạn cần phải xử lý danh sách các key mapping với nhau trong code tự động hóa test sau đó.Hầu hết mọi fan bị nhầm lẫn thân Data
Table
cùng Scenario Outline, nhưng lại hai giải pháp này hoạt động hoàn toàn khác nhau.Ví dụ Data
Table trong Cucumber:

Feature: Handle Data
Table Scenario: Data
Table sample Given user on the login page When user enter valid credentials lớn login | username | password | | user
example.com | 123456 | Then user should be redirected to the admin page

✅ Viết demo cases Gherkin tất cả chứa Data

Xem thêm: Top 5 những cuốn sách sinh viên đại học harvard đọc sách gì nhiều nhất?

Tables

Feature: Login CMS
Invalid
Login
Scenario: Invalid Login Given user on the login page When user enter an invalid username or password và click on the login button Then user should see an error message and stay on the login page
Invalid
Login
Multiple
Scenario: Invalid Login with multiple tài khoản Given user on the login page When user enter valid credentials khổng lồ login | username | password | | user
example.com | 123456 | Then user should see an error message và stay on the login page 

Feature: địa chỉ Category Background: Login as Admin role Given user logged in as an admin Scenario: địa chỉ a new category Given user on the category page When user click on the showroom Category button & user enter the category information và user click on the Save button Then user should see a success message and the new category should be displayed on the category page
Add
Category
Multiple Scenario: địa chỉ cửa hàng multi category Given user on the category page When the user adds some categories below | category_name | order_number | meta_title | description | | Computer 1 | 1 | Computer 1 | Build PC | | Computer 2 | 2 | Computer 2 | Build PC | Then the new category should be displayed on the category page | category_name | order_number | meta_title | mô tả tìm kiếm | | Computer 1 | 1 | Computer 1 | Build PC | | Computer 2 | 2 | Computer 2 | Build PC |

✅ cách xử trí Data
Tables trong code tự động hóa test

Để cách xử lý Data
Table trường đoản cú Gherkin truyền vào code auto test thì chúng ta có 2 bí quyết thiết kế: