Skip to content

Commit

Permalink
VACMS-10089: Putting cypress event form conditional test back in
Browse files Browse the repository at this point in the history
  • Loading branch information
chri5tia committed Oct 10, 2023
1 parent 6c9c3d8 commit 7f69d28
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tests/cypress/integration/features/content_type/event.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,65 @@ Feature: Content Type: Event
When I select the "Online" radio button
Then an element with the selector "#edit-field-url-of-an-online-event-0-uri" should be empty

Scenario: Confirm that the default time zone when creating an event is set explicitly to Eastern.
Given I am logged in as a user with the "content_admin" role
When I am at "node/add/event"
Then the element with selector "#edit-field-datetime-range-timezone-0-timezone" should contain "New York"

Scenario: Confirm that the event form conditional elements are shown or hidden appropriately
Given I am logged in as a user with the "content_admin" role
And I am at "node/add/event"

And I select the "At a VA facility" radio button
Then I should see "Facility location"
And I should see "Building, floor, or room"
And I should not see "Street address"
And I should not see an element with the selector "#edit-field-address-0-address-locality"
And I should not see an element with the selector "#edit-field-address-0-address-administrative-area"
And I should not see "Country"
And I should not see an element with the selector "#edit-field-url-of-an-online-event-0-uri"

When I select the "At a non-VA location" radio button
Then I should not see "Facility location"
And I should see "Building, floor, or room"
And I should see "Street address"
And I should see an element with the selector "#edit-field-address-0-address-locality"
And I should see an element with the selector "#edit-field-address-0-address-administrative-area"
And I should see "Country"
And I should not see an element with the selector "#edit-field-url-of-an-online-event-0-uri"

When I select the "Online" radio button
Then I should not see "Facility location"
And I should not see "Building, floor, or room"
And I should not see "Street address"
And I should not see an element with the selector "#edit-field-address-0-address-locality"
And I should not see an element with the selector "#edit-field-address-0-address-administrative-area"
And I should not see "Country"
And I should see an element with the selector "#edit-field-url-of-an-online-event-0-uri"

# Registration checkbox reveals conditional form elements
When I check the "Include registration information" checkbox
Then "Cost" should be visible
And I should see "Registration is required for this event"
And "Call to action" should be visible

When I select option "Register" from dropdown "Call to action"
Then I should see an element with the selector "#edit-field-link-0-uri"
And I select option "Apply" from dropdown "Call to action"
Then I should see an element with the selector "#edit-field-link-0-uri"
And I select option "RSVP" from dropdown "Call to action"
Then I should see an element with the selector "#edit-field-link-0-uri"
And I select option "More Details" from dropdown "Call to action"
Then I should see an element with the selector "#edit-field-link-0-uri"
And I select option "- None -" from dropdown "Call to action"
Then I should not see an element with the selector "#edit-field-link-0-uri"

When I uncheck the "Include registration information" checkbox
Then I should not see "Cost"
And I should not see "Registration is required for this event"
And I should not see "Call to action"
And I should not see an element with the selector "#edit-field-link-0-uri"

Scenario: Users who can only publish to National Outreach Calendar do not see the "Publish to the National Outreach Calendar" checkbox
Given I am logged in as a user with the "administrator" role
When I set the "feature_event_outreach_checkbox" feature toggle to "on"
Expand Down

0 comments on commit 7f69d28

Please sign in to comment.