-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIVIC-1493] Updated webform templates and test.
- Loading branch information
1 parent
a1cf1e6
commit 4bf3817
Showing
11 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@p0 @civictheme @webform @test | ||
Feature: Webform render | ||
|
||
@api @javascript | ||
Scenario: Form inputs are correctly validated | ||
Given I am an anonymous user | ||
When I visit "/form/civictheme-feedback" | ||
And I should see 3 ".progress-step" elements | ||
And I should see the text "Personal information" | ||
And I should see the text "Additional information" | ||
And I should see an "[name='name']" element | ||
And I should see an "[name='email']" element | ||
And I should see an "[name='message']" element | ||
And I fill in "Your Name" with "[TEST] Name" | ||
And I fill in "Your Email" with "test@email.com" | ||
And I fill in "edit-message" with "[TEST] Message" | ||
And I should see the button "Next" | ||
And I should not see the "Previous" button | ||
And I press the "Next" button | ||
And I should not see an "[name='name']" element | ||
And I should not see an "[name='email']" element | ||
And I should not see an "[name='message']" element | ||
And I should see an "[name='reason']" element | ||
And I should see the text "Reason for Contacting" | ||
And I should see the text "Subscribe to Newsletter" | ||
And I should see the text "Preferred Contact Method" | ||
And I should not see the "Next" button | ||
And I should see the button "Previous" | ||
Then I select "support" from "reason" | ||
And I should see an "[name='support_ticket_number']" element | ||
And I should not see a visible "[name='how_did_you_hear']" element | ||
Then I select "general" from "reason" | ||
And I should not see a visible "[name='support_ticket_number']" element | ||
And I should see an "[name='how_did_you_hear']" element | ||
And I should see the button "Submit" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
web/themes/contrib/civictheme/config/install/webform.webform.civictheme_feedback.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
langcode: en | ||
status: open | ||
dependencies: { } | ||
weight: 0 | ||
open: null | ||
close: null | ||
uid: null | ||
template: false | ||
archive: false | ||
id: civictheme_feedback | ||
title: 'General form' | ||
description: 'A simple multi-step form.' | ||
categories: { } | ||
elements: |- | ||
personal_information: | ||
'#type': webform_wizard_page | ||
'#title': 'Personal information' | ||
'#prev_button_label': Previous | ||
'#next_button_label': Next | ||
name: | ||
'#type': textfield | ||
'#title': 'Your Name' | ||
'#required': true | ||
email: | ||
'#type': email | ||
'#title': 'Your Email' | ||
'#required': true | ||
message: | ||
'#type': textarea | ||
'#title': 'Your Message' | ||
'#rows': 5 | ||
'#required': true | ||
additional_information: | ||
'#type': webform_wizard_page | ||
'#title': 'Additional information' | ||
reason: | ||
'#type': select | ||
'#title': 'Reason for Contacting' | ||
'#options': | ||
general: 'General Inquiry' | ||
support: 'Technical Support' | ||
feedback: Feedback | ||
'#required': true | ||
support_ticket_number: | ||
'#type': textfield | ||
'#title': 'Support Ticket Number' | ||
'#states': | ||
visible: | ||
':input[name="reason"]': | ||
value: support | ||
'#required_states': | ||
visible: | ||
':input[name="reason"]': | ||
value: support | ||
how_did_you_hear: | ||
'#type': textfield | ||
'#title': 'How did you hear about us?' | ||
'#states': | ||
visible: | ||
':input[name="reason"]': | ||
value: general | ||
subscription: | ||
'#type': checkboxes | ||
'#title': 'Subscribe to Newsletter' | ||
'#options': | ||
newsletter: Newsletter | ||
promotions: Promotions | ||
preferred_contact_method: | ||
'#type': radios | ||
'#title': 'Preferred Contact Method' | ||
'#options': | ||
email: Email | ||
phone: Phone | ||
mail: Mail | ||
css: '' | ||
javascript: '' | ||
settings: { } | ||
access: { } | ||
handlers: { } | ||
variants: { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters