In cypress Is there any method to run 3 dependent forms individually? - cypress

I have 3 forms, and one form is depending on other 2 forms(Each form is in each test file), So my question is can i know is there any solution(method) to run those 3 forms individually?
(The purpose is i want to run each forms individually)
This is maker form
This is Category form
This is maker type form
These are the three forms which i have mentioned above.
Maker form, and Category form are depending on Maker type form, (The value i'm adding in maker and Category forms as above images, will have to choose from Maker type form)
So these Each three forms are in each test files.
When i run the test i can not run the maker type form individually, because its' maker and category values are taken by Maker form and Category form added values.

Your tests (e2e tests) should follow the user flow, so if one form requires another to complete the task, then that's how you test them.
BUT you can test forms independently using Component Testing. In this type of test you mount just one component (form) at a time and supply input values (normally coming from the other forms) via props.
Here is some info about it My Vision for Component Tests in Cypress

Related

Blazor Webassembly validation not support individual field validation

Blazor validation not support individual field validation, its only validate all fields at a time in context. if i load my page at once in separated tab or stepper, validate controls partially not all fields. Is it possible? Please give me the solution. But i achieved in jquery by $('#ShippingInfo').validate().element('#ShippingAddress_StateID');
But blazor validate all the fields when press the submit button.
eg.,
I have a module like wizard using stepper component(it may be 4 steps). Here First step having some set of controls like customer details and 2nd step having some set of controls like get contact details and so on. All the controls are corresponding to one model class with annotations but validation by step by step by Next button using stepper component. How do i achieve this?
Option 1
Divide your view model into several submodels "MySubmodel1", "MySubmodel2", etc.
Then in your wizard-like form, have multiple <EditForm> elements, each specifying the corresponding submodel, ie. in the first <EditForm> set Model=#MySubmodel1, in the second <EditForm> set Model=#MySubmodel2, etc.
Option 2
This option is based on conditional validation of your view model. You will use just 1 viewmodel for the complete wizard-like form. Add a property "StepNumber" to your view model that will identify current step (step 1, step 2, ...), and define conditional validation of corresponding fields based on the actual step.
This can be achieved eg.
by using the custom Validation attributes like "RequiredIf" discussed eg. here on StackOverflow
or
by implementing the IValidatableObject (discussed eg. here) - in the Validate() method, write a code that will yield return ValidationResult for view model fields that do not have actual state as required by current step.
Finally, in your form, adjust current step when handling your Previous/Next step buttons.

open multiple forms with main form

I have 5 forms:
Form 1
Form 2
From 3
Form 4
Form 5
Main form is “Form A”. All forms' buttons are pasted on “form A”.
Is it possible that I open all forms at same time and all are active for data input and other are minimized? All forms are developed in 6i.
There are several ways to "open" another form, by using the following built-ins:
CALL_FORM will run the indicated form and keep the parent form active
OPEN_FORM opens the indicated form; it is used to crate multiple-form application (i.e. the one that opens more than one form at the same time)
NEW_FORM exits the current form and runs the indicated form.
These are well described in Forms' Online Help system (navigate to "Help", perform search and read what's written in there). Then pick the option which suits you best.

ServiceNow Add a Form Section to multiple Configuration Items

I am currently working on a project in ServiceNow that requires me to configure around 500 descendants of the Configuration Item table by adding multiple form sections to the CI's with around 10-20 fields in each of these form sections. I currently am doing this by going into the Form Design for each CI, and manually adding these form section and fields for every CI individually, which takes far to long to do for 500 CI's.
Is there a way to add a form section to multiple CI's without having to go into the form design on every CI you want to change and adding it manually?
Technical answer: yes, because all of that form layout data is stored in tables (sys_ui_form_section, sys_ui_section, sys_ui_element, etc) that you could script to insert relevant records. However, due to the complexity (form sections, form elements, ordering) and the potential to run into conflicts (forms differ between tables), I would recommend this only as a last resort.
I think the real question is why is it required to have all of those fields displayed on the forms? If you're populating data from Discovery or a large import, can those fields just be visible by a list page, or just be available to use in filters? Will users actually be clicking to view a CI record and need to see that data on the form? The other part to consider is which view you are adding all of these form sections and fields to. As an example, a user won't see the data on a reference field hover if you're only making changes to the Default view, and won't see any of the fields on a mobile device if you don't add to the Mobile view.

Sitecore WFFM make 1 of 2 fields required

I'm trying to create a WFFM form and I need to set one of two fields to be required. Do I need to create custom fields? Or is this something that I can achieve with the module itself?
You could possibly use the Morph module, which you can download from the Sitecore Marketplace.
From it's description:
Selection-dependent inputs require users to enter additional
information related to an initial selection before they can complete a
form. In almost all cases, it allows making web forms simpler and more
responsive to user actions and personalizing forms depending on
visitors’ features.
If memory serves it uses the Sitecore Rules Engine to decide which fields to show/ hide based on inputs. However, I'm not 100% sure whether you can use the Required checkbox there, but worth a try.
No custom field types are needed. The WFFM Form Designer has a Required checkbox for each field row and most standard fields support this along with a custom validation message.

changing forms attribute in django formset

can anyone suggest me how to modify forms attribute of django formset, in a template?
my scenario:
i wanted to dynamically create more forms using javascript, than which is loaded from model_formset.
so, if i loaded 3 forms using model formset from server, then using javascript i created one more form and changed the TOTAL forms value in management formset.
problem:
i had to run for loop on formset.forms before and after creating the additional form using javascript.
but the loop runs only 3 times (when there are 4 now and after updating TOTAL forms value).
So, what should i change in management forms for the 'forms' attribute to know there are actually 4 forms now. because i will use the {{ formset.prefix }} in the loop. and i should have say, type-4 for the 4th form.
thanks!
EDIT: SOLVED! see comment.

Resources