Skip to content

Commit ec6eb4c

Browse files
committed
Ad FormField to README
1 parent b6a7c15 commit ec6eb4c

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

README.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ modules:
4242
```
4343

4444
### Usage
45+
4546
Run drush config import and store output.
47+
4648
`$output = $i->runDrush('cim -y');`
49+
4750
Get one-time login url.
48-
`$uri = $i->getLoginUri('userName');`
4951

52+
`$uri = $i->getLoginUri('userName');`
5053

5154
## Drupal Entity
5255

@@ -69,16 +72,27 @@ modules:
6972
```
7073

7174
### Usage
75+
7276
Create entities.
77+
7378
`$node = $i->createEntity('title => 'My node');`
79+
7480
`$term = $i->createEntity('name => 'My term', 'taxonomy_term');`
81+
7582
Delete all stored test entities.
83+
7684
`$i->doEntityCleanup();`
85+
7786
Register test entity.
87+
7888
`$i->registerTestEntity('node', '99');`
89+
7990
Register test entity by url.
91+
8092
`$i->registerTestEntityByUrl($i->grabFromCurrentUrl());`
93+
8194
Get entity by url.
95+
8296
`$entity = $i->getEntityFromUrl($i->grabFromCurrentUrl());`
8397

8498
## Drupal User
@@ -108,11 +122,17 @@ modules:
108122
```
109123

110124
### Usage
125+
111126
Create test user with specified roles.
127+
112128
`$user = $i->createUserWithRoles(['editor', 'authenticated'], 'password');`
129+
113130
Log in user by username.
131+
114132
`$i->loginAs('userName');`
133+
115134
Create new user with certain role and login.
135+
116136
`$i->logInWithRole('administrator');`
117137

118138

@@ -135,7 +155,41 @@ modules:
135155
```
136156

137157
### Usage
158+
138159
Clean logs.
160+
139161
`$i->prepareLogWatch();`
162+
140163
Check logs.
141-
`$i->checkLogs();`
164+
165+
`$i->checkLogs();`
166+
167+
## Drupal Fields Utility
168+
169+
Provides xpath builder object for drupal specific form field xpath retrieval.
170+
171+
Includes:
172+
- FormField: Fields that can be set to cardinality unlimited
173+
- MTOFormField: Single value fields.
174+
- ParagraphFormField: Paragraph form fields.
175+
176+
### Usage
177+
178+
Create paragraph field with machine name field_page_elements.
179+
180+
`$page_elements = ParagraphFormField:field_page_elements();`
181+
182+
Get nex paragraph.
183+
184+
`$page_elements->next();`
185+
186+
Fill title field value from field page elements.
187+
188+
`$i->fillField(FormField::title($page_elements)->value);`
189+
190+
Add new paragraph of type liftup_element.
191+
192+
```
193+
$i->click($page_elements->addMore('liftup_element'));
194+
$i->waitForElementVisible($page_elements->getCurrent('Subform'));
195+
```

0 commit comments

Comments
 (0)