Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-10089: Putting cypress event form conditional test back in #15626

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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