Behat: How to correctly provide a data background for custom table in block plugin

Behat: How to correctly provide a data background for custom table in block plugin

by John Garcia -
Number of replies: 4
Hello,

I new to behat and moodle. I am tried to create a sample checklist plugin where we can add it to a course and each participants can mark each item in the checklist via checkbox as completed.

I am trying to create a behat test for this and I am getting the following error when I run the behat test:

 "block_ed_checklist" is not a known type of entity that can be generated.

and I have the following background in my feature file

Feature: Test if displaying the course checklist works correctly:
As a user I need to see the course checklist of a course.

Background:
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | CAT1 | topics |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| block_ed_checklist | Course | C1 | course-view-* | side-pre |
And the following "block_edv_checklist" exist: <<<----- here is the problematic step
| courseid | title |
| 1 | Requirement 1 |

Can someone please point out what I am doing wrong here? 
Is this something a generator should handle or we can use a pre-built step here?
Any answer will be greatly appreciated! 
TIA

Average of ratings: -
In reply to John Garcia

Re: Behat: How to correctly provide a data background for custom table in block plugin

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Could it be you are using two different spellings of the checklist name? block_ed_checklist and block_edv_checklist
In reply to AL Rachels

Re: Behat: How to correctly provide a data background for custom table in block plugin

by John Garcia -
Sorry was just a typo. I am using the same name
In reply to John Garcia

Re: Behat: How to correctly provide a data background for custom table in block plugin

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
What happens if you go to the page first?

Given I am on the "Course 1" course page logged in as teacher1
And the following "block_edv_checklist" exist: