@Then the :label field should be marked as required

Checks to see if the field is marked as required when editing.
488296
public function seeRequiredFieldtOfType($label)
    {
        if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
            $fieldManager = $this->getFieldTypeManager();
            // $type = ...
            //$name = $fieldManager->getThisFieldTypeName();

            $verification = new WebAssert($this->getSession());
            //$verification->elementTextContains('css', $this->getEditLabelCss($type, $name), $label . '*');.
            $verification->elementTextContains('css', '.ez-fielddefinition-name', $label . '*');
        } else {
            throw new \Exception('Cannot publish content, application in wrong state');
        }
    }
725252
function shouldValidate (ctx, model) {
  // when an immediate/initial validation is needed and wasn't done before.
  if (!ctx._ignoreImmediate && ctx.immediate) {
    return true;
  }

  // when the value changes for whatever reason.
  if (ctx.value !== model.value) {
    return true;
  }

  // when it needs validation due to props/cross-fields changes.
  if (ctx._needsValidation) {
    return true;
  }

  // when the initial value is undefined and the field wasn't rendered yet.
  if (!ctx.initialized && model.value === undefined) {
    return true;
  }

  return false;
}
1110333
private function AddRequiredField()
    {
        $field = new Fields\Checkbox('Required', '1', $this->checkbox->GetRequired());
        $this->AddField($field);
    }
1263436
protected function validateEditField()
    {
        $this->setSubmitted('field');
        $this->setSubmitted('update', $this->data_field);

        $this->validateComponent('field');

        return !$this->hasErrors();
    }
265028
function _checkAnnotation (op) {
      switch (op.type) {
        case 'create':
        case 'delete': {
          let node = op.val
          if (node.hasOwnProperty('start') && node.start.path) {
            updated[getKeyForPath(node.start.path)] = true
          }
          if (node.hasOwnProperty('end') && node.end.path) {
            updated[getKeyForPath(node.end.path)] = true
          }
          break
        }
        case 'update':
        case 'set': {
          // HACK: detecting annotation changes in an opportunistic way
          let node = doc.get(op.path[0])
          if (node) {
            if (node.isPropertyAnnotation()) {
              updated[getKeyForPath(node.start.path)] = true
            } else if (node.isContainerAnnotation()) {
              affectedContainerAnnos.push(node)
            }
          }
          break
        }
        default:
          /* istanbul ignore next */
          // NOP
      }
    }
474589
function( label )
		{
			var styleDefinition = this._.definition,
				html = [],
				elementName = styleDefinition.element;

			// Avoid <bdo> in the preview.
			if ( elementName == 'bdo' )
				elementName = 'span';

			html = [ '<', elementName ];

			// Assign all defined attributes.
			var attribs	= styleDefinition.attributes;
			if ( attribs )
			{
				for ( var att in attribs )
				{
					html.push( ' ', att, '="', attribs[ att ], '"' );
				}
			}

			// Assign the style attribute.
			var cssStyle = CKEDITOR.style.getStyleText( styleDefinition );
			if ( cssStyle )
				html.push( ' style="', cssStyle, '"' );

			html.push( '>', ( label || styleDefinition.name ), '</', elementName, '>' );

			return html.join( '' );
		}
349113
public function getRenderLabel($field_key, $required_mark = ' <span class="required">*</span>')
    {
        return sprintf(
            '<label for="%s">%s%s</label>',
            $field_key,
            $this->getLabelText($field_key),
            ($required_mark && $this->isRequired($field_key)) ? $required_mark : null
        );
    }
363104
protected function validateEditProductClassField()
    {
        $this->setSubmitted('product_class');
        $this->setSubmitted('product_class_id', $this->data_product_class['product_class_id']);

        $this->validateComponent('product_class_field');

        return !$this->hasErrors(false);
    }
736566
@Override
    public boolean validateLabel(String label) {
        Objects.requireNonNull(label, "label cannot be null");
        // check label is in set
        return !labels.contains(label);
    }
1301688
private TextField buildField(String label, CmsAccountInfo info) {

        TextField field = (TextField)m_binder.buildAndBind(label, info);
        field.setConverter(new CmsNullToEmptyConverter());
        field.setWidth("100%");
        boolean editable = (m_editLevel == EditLevel.all)
            || (info.isEditable() && (m_editLevel == EditLevel.configured));
        field.setEnabled(editable);
        if (editable) {
            field.addValidator(new FieldValidator(info.getField()));
        }
        field.setImmediate(true);
        return field;
    }
1300936
function() {
        var that = this,
            constraints_id = lang_util.isPlainObject(that.constraints) && Object.keys(that.constraints)[0];

        return constraints_id ? that.constraints[constraints_id].label : '';
    }
212964
public function edit_field_set_required($mform) {
        global $USER;
        if ($this->is_required() && ($this->userid == $USER->id || isguestuser())) {
            $mform->addRule($this->inputname, get_string('required'), 'required', null, 'client');
        }
    }
847249
protected function submitEditField()
    {
        if ($this->isPosted('delete')) {
            $this->deleteField();
        } else if ($this->isPosted('save') && $this->validateEditField()) {
            if (isset($this->data_field['field_id'])) {
                $this->updateField();
            } else {
                $this->addField();
            }
        }
    }
1001985
protected void markInvalid()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"markInvalid");
      invalid = true;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"markInvalid");
   }
1232230
function () {
            var elt = this._getInputMarkupDomElt();
            if (elt) {
                this._initInputMarkup(elt);
            }
            var lbl = this._getInputLabelMarkupDomElt();
            if (lbl) {
                this._initLabelMarkup(lbl);
            }
        }
198588
protected function validateWidgetField()
    {
        $field = 'widget';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Widget');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        $types = $this->field->getWidgetTypes();

        if (empty($types[$value])) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
875225
protected function validateEditFieldValue()
    {
        $this->setSubmitted('field_value');
        $this->setSubmitted('update', $this->data_field_value);
        $this->setSubmitted('field_id', $this->data_field['field_id']);

        $this->validateComponent('field_value');

        return !$this->hasErrors();
    }