From aaf3adb5e7ddad3456d4e1e5da5654a5e2627ff7 Mon Sep 17 00:00:00 2001 From: Brandon Bruce Date: Fri, 2 Feb 2024 13:37:01 -0500 Subject: [PATCH 1/9] DRPLA-8 - New autoutomation for Events - Modified existing test cases based on changes to functions.js --- test/e2e/fixtures/eventsNew.json | 861 ++++++++++++++++++ .../specs/smoke/tc1.basic-page.errors.cy.js | 2 +- test/e2e/specs/smoke/tc2.wysiwyg.cy.js | 2 +- test/e2e/specs/smoke/tc6.events.errors.cy.js | 66 ++ test/e2e/specs/smoke/tc6.events.new.cy.js | 228 +++++ test/e2e/support/functions.js | 61 +- 6 files changed, 1200 insertions(+), 20 deletions(-) create mode 100644 test/e2e/fixtures/eventsNew.json create mode 100755 test/e2e/specs/smoke/tc6.events.errors.cy.js create mode 100755 test/e2e/specs/smoke/tc6.events.new.cy.js diff --git a/test/e2e/fixtures/eventsNew.json b/test/e2e/fixtures/eventsNew.json new file mode 100644 index 0000000000..41592ce055 --- /dev/null +++ b/test/e2e/fixtures/eventsNew.json @@ -0,0 +1,861 @@ +{ + "testCaseName":"TC6 - Events", + "contentType":"Event", + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-title", + "itemName": "Title", + "fields":[ + {"fieldName":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "This is a test event title", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldName":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".field--type-smartdate", + "itemName": "Date", + "fields":[ + {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 1}, + {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 360000, "fieldDefault": "", "fieldIndex": 1} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".field--name-field-deadline", + "itemName": "Registration Deadline", + "fields":[ + {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--type-address", + "itemName": "Location", + "fields":[ + {"fieldName":".address-line1","fieldType": "text", "fieldValue": "109 TW Alexander Dr", "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".address-line2","fieldType": "text", "fieldValue": "EPA Building", "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".locality","fieldType": "text", "fieldValue": "Durham", "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".administrative-area","fieldType": "select", "fieldValue": "North Carolina", "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".postal-code","fieldType": "text", "fieldValue": "27709", "fieldDefault": "", "fieldIndex": 0} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-event-host", + "itemName": "Event Host", + "fields":[ + {"fieldName":".js-text-full","fieldType": "text", "fieldValue": "Nature Conservancy", "fieldDefault": "", "fieldIndex": 0} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": "[id=field-links-values]", + "itemName": "Links", + "fields":[ + {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "Event Links", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".field--name-field-keywords", + "itemName": "Keywords", + "fields":[{"fieldName": "[id=edit-field-keywords-target-id]", + "fieldType": "text", + "fieldValue": "blood lead testing (331587), drupal (332750)", + "fieldDefault": ""}], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-event-type", + "itemName":"Event Type", + "fields":[{"fieldName": "select", "fieldType": "select", "fieldValue": "Job Fair", "fieldDefault": 0}], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldName": "[id=edit-field-type]", + "fieldType": "select", + "fieldValue": "News Release", + "fieldDefault": 0 + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--from-library", + "itemName": "From library", + "fields": + [ + { + "fieldName":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "subFields":[ + {"fieldName":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldName":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + ] + } + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required.", + "Reusable paragraph field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--card-group", + "itemName": "Card Group", + "fields":[ + {"fieldName":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldName":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldName":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldName":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Body field is required.", + "URL field is required.","Link text field is required.", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--header", + "itemName": "Header", + "fields":[ + {"fieldName": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Level field is required.", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--link-list", + "itemName": "Link List", + "fields":[ + {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "URL field is required.", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--slideshow", + "itemName": "Slideshow", + "fields":[ + {"fieldName": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldName": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 0, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 1, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 2, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 3, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 4, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ] + , + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 5, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 6, + "fields":[ + {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 0, + "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldName": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldName": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldName": "a:contains(\"Primary Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": "[id=edit-field-channel-wrapper]", + "itemName": "Channel", + "fields":[{"fieldName": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldName": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": + [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldName": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + }, + { + "section": "", + "itemId": ".field--name-field-event-cancellation", + "itemName": "Canceled", + "fields": + [ + { + "fieldName": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false + } + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a test event title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Date and Time\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"Registration Deadline\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Location\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 7 + }, + { + "section": "article", + "itemId": ".address-line1", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "109 TW Alexander Dr"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".address-line2", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "EPA Building"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".locality", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Durham"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".administrative-area", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "NC"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".postal-code", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "27709"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".country", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "United States"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Host\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Nature Conservancy"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Type\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Job Fair"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Event Links\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Canceled:"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js b/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js index beaa85275b..cb9425f298 100755 --- a/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js +++ b/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js @@ -44,7 +44,7 @@ describe('TC1 - Basic Page: SuperUser', () => { }); it(`${currentItem.section} - ${currentItem.itemName} - Remove the section`, () => { - removePageSection(currentItem, 0); + removePageSection(currentItem); }); }); diff --git a/test/e2e/specs/smoke/tc2.wysiwyg.cy.js b/test/e2e/specs/smoke/tc2.wysiwyg.cy.js index a2f44a605c..409dd47b7e 100755 --- a/test/e2e/specs/smoke/tc2.wysiwyg.cy.js +++ b/test/e2e/specs/smoke/tc2.wysiwyg.cy.js @@ -5,7 +5,7 @@ import { const formatFile = require('../../fixtures/wysiwyg.json'); -// TODO: Add this back to JSON file when definitions is working. currently does not bring up data +// TODO: Add this back to JSON file when definitions is working. currently does not bring up data /* { diff --git a/test/e2e/specs/smoke/tc6.events.errors.cy.js b/test/e2e/specs/smoke/tc6.events.errors.cy.js new file mode 100755 index 0000000000..dee72f8953 --- /dev/null +++ b/test/e2e/specs/smoke/tc6.events.errors.cy.js @@ -0,0 +1,66 @@ +import { + addPageSection, + findStringInArray, + getErrorMessages, loginToDrupal, removePageSection, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/eventsNew.json'); + +describe('TC6 - Events - errors', () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + cy.get('body').then(() => { + loginToDrupal('first'); + }).then(() => { + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + }).then(() => { + cy.contains('a', 'Add new content').click(); + }) + .then(() => { + cy.get('.admin-list').contains('a', 'Event').click(); + }) + .then(() => { + cy.get('.page-title').should('contain.text', 'Add Web Area: Group node (Event)'); + }); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`${currentItem.section} - ${currentItem.itemName} - Saving without required information shows errors`, () => { + cy.get('body').then(() => { + addPageSection(currentItem); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + }) + .then(() => { + const errors = []; + cy.task('log', `expected: ${JSON.stringify(currentItem.errors)} - actual: ${JSON.stringify(getErrorMessages())}`); + + cy.wrap(currentItem.errors).each((currentError) => { + if (!findStringInArray(getErrorMessages(), currentError)) { + errors.push(currentError); + } + }); + cy.task('log', `errors: ${JSON.stringify(errors)}`); + cy.wrap(errors).should('have.length', 0); + cy.wrap(getErrorMessages()).should('have.length', currentItem.errors.length); + }); + }); + + it(`${currentItem.section} - ${currentItem.itemName} - Remove the section`, () => { + removePageSection(currentItem); + }); + }); + + it('Description only allows 256 characters', () => { + cy.get('body').then(() => { + cy.get('.field--name-field-description').find('textarea').type('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.'); + }).then(() => { + cy.get('[id=edit-field-description-0-value]').should('have.value', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. \n Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed'); + }); + }); +}); diff --git a/test/e2e/specs/smoke/tc6.events.new.cy.js b/test/e2e/specs/smoke/tc6.events.new.cy.js new file mode 100755 index 0000000000..3551854d04 --- /dev/null +++ b/test/e2e/specs/smoke/tc6.events.new.cy.js @@ -0,0 +1,228 @@ +import { + addPageSection, + duplicatePageSection, + getPageFields, getTodayDate, loginToDrupal, setPageFields, verifyPageElements, verifyPageSource, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/eventsNew.json'); + +let pageTitle = 'old news'; + +describe('TC6 - Events', () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + loginToDrupal('first'); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + cy.wrap(pageTitle).as('pageTitle'); + }); + + it(`Add New ${formatFile.contentType}`, () => { + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + cy.contains('a', 'Add new content').click(); + cy.get('.admin-list').contains('a', formatFile.contentType).click(); + cy.get('.page-title').should('contain.text', `Add Web Area: Group node (${formatFile.contentType})`); + }); + + it(`Add New ${formatFile.contentType} - defaults`, () => { + cy.get('.paragraphs-subform').should('have.length', 1); + cy.contains('a', 'Web Guide').should('exist'); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Add Item - ${currentItem.section} - ${currentItem.itemName}`, () => { + addPageSection(currentItem); + }); + + it(`Default Value - ${currentItem.section} - ${currentItem.itemName}`, () => { + getPageFields(currentItem); + }); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Set Fields - ${currentItem.section} - ${currentItem.itemName}`, () => { + setPageFields(currentItem); + }); + }); + + it('Duplicate HTML Section', () => { + duplicatePageSection('Body', '.paragraph-type--html', 0); + cy.wait(2000); + }); + + it('Save after entering all required information', () => { + cy.get('body').then(() => { + cy.get('.field--name-title').find('input').then((titleField) => { + // pageTitle = titleField.val().trim(); + pageTitle = 'This is a test event title'; + cy.wrap(pageTitle).as('pageTitle'); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click({force: true}); + }).then(() => { + cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been created.`); + }); + }); + + it('Set State to Draft Approved State', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Draft, approved'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Approved the draft'); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + }); + }); + + it('View the webpage', () => { + cy.get('body').then(() => { + cy.get('a:contains("View"):visible').first().click(); + }).then(() => { + cy.wait(2000); + verifyPageElements(formatFile.expected); + }); + }); + + it('Verify Dates in Page Source', () => { + verifyPageSource('DC.date.created', getTodayDate('yyyy-MM-dd')); + verifyPageSource('DC.date.modified', getTodayDate('yyyy-MM-dd')); + verifyPageSource('DC.date.reviewed', getTodayDate('yyyy-MM-dd'), (60000 * 60 * 24 * 90)); + }); + + + it(`Edit ${formatFile.contentType}`, () => { + cy.get('body').then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.wrap(formatFile.editedItems).each((currentEdit) => { + setPageFields(currentEdit); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been updated.`); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Publish the page', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Published'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Published the page'); + cy.get('[id=edit-workflow-508-compliant]').check({force: true}); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Published'); + }); + }); + + it('Revisions tab shows the latest revision as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Currently published revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + }); + }); + + it('Published Content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + }); + }); + + it('Clone the page', () => { + cy.get('body').then(() => { + cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get('a:contains("Clone"):visible').first().click(); + cy.get('[value="Clone"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The entity ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + + it('Cloned page shows on Latest Revisions tab', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Current revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the cloned page as Draft', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + }); + }); + + it('Published Content tab does not show the cloned page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).should('not.exist'); + }); + }); + + it('Return to View Page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Latest Revisions")').click(); + }).then(() => { + cy.get('.views-table').find('tbody').find(`a:contains("${pageTitle}")`).click(); + }).then(() => { + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Delete a cloned Event', () => { + cy.get('body').then(() => { + cy.get('nav').find('a:contains("My Web Areas")').first().click(); + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + cy.get(`a:contains("Cloned: ${pageTitle}"):visible`).first().click(); + cy.get('a:contains("Delete"):visible').first().click(); + cy.get('[value="Delete"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The Event Cloned: ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'has been deleted.'); + }); + }); + + it('Delete an Event', () => { + cy.get('body').then(() => { + cy.get('nav').find('a:contains("My Web Areas")').first().click(); + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get('a:contains("Delete"):visible').first().click(); + cy.get('[value="Delete"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The Event ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'has been deleted.'); + }); + }); +}); + + diff --git a/test/e2e/support/functions.js b/test/e2e/support/functions.js index 8c7c09c9b5..de337636ab 100755 --- a/test/e2e/support/functions.js +++ b/test/e2e/support/functions.js @@ -169,6 +169,28 @@ export function logout(logoutMethod) { } //* **********************************New Content methods*************************************************** */ +export function verifyPageSource(searchTerm, expectedTerm) { + const errors = []; + cy.url().then((currentUrl) => { + cy.request(currentUrl).its('body').then((content) => { + const contentArray = content.split('\n'); + // cy.task('log',JSON.stringify(contentArray)); + const newarray = contentArray.filter(res => res.includes(searchTerm)); + cy.task('log', `\n${newarray}`); + cy.wrap(newarray).each((currentItem) => { + if (!currentItem.includes(expectedTerm)) { + const errorJson = {}; + errorJson.expected = expectedTerm; + errorJson.actual = currentItem; + errors.push(errorJson); + } + }); + cy.task('log', `errors: ${errors}`); + cy.wrap(errors).should('contain.have.length', 0); + }); + }); +} + export function getErrorMessages() { const actualErrors = []; @@ -192,10 +214,8 @@ export function addPageSection(currentItem) { } if (actualCount < expectedCount) { if (['Body', 'Sidebar'].includes(currentItem.section)) { - let beforeLabels = getElementCount(currentItem.itemId, currentItem.section); - let afterLabels = []; + const beforeLabels = getElementCount(currentItem.itemId, currentItem.section); cy.get('body').then(() => { - beforeLabels = getElementCount(currentItem.itemId, currentItem.section); cy.get(`.placeholder:contains("${currentItem.section}"):visible`).parent().last().scrollIntoView(); }).then(() => { cy.get(`.placeholder:contains("${currentItem.section}"):visible`).parent().then((addToSection) => { @@ -206,19 +226,24 @@ export function addPageSection(currentItem) { }).then(() => { cy.get(`.placeholder:contains("${currentItem.section}"):visible`).parent().find(`[value="Add ${currentItem.itemName}"]:visible`).first() .click(); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(5000); + cy.wait(2000); }) .then(() => { - afterLabels = getElementCount(currentItem.itemId, currentItem.section); - }) - .then(() => { - cy.wrap(afterLabels).should('eq', beforeLabels + 1); + verifyElementCount(currentItem.itemId, currentItem.section, beforeLabels + 1); }); } } } +export function verifyElementCount(currentElement, section, expectedCount) { + if (['Body', 'Sidebar'].includes(section)) { + cy.get(`table:contains("${section}")`).find(currentElement, {timeout: 60000}).should('have.length', expectedCount); + } else { + cy.get(currentElement).should('have.length', expectedCount); + } +} + + export function getElementCount(currentElement, section) { let elementCount = 0; if (['Body', 'Sidebar'].includes(section)) { @@ -226,6 +251,7 @@ export function getElementCount(currentElement, section) { } else { elementCount = Cypress.$(currentElement).length; } + cy.task('log', `Elements Found: ${elementCount}`); return elementCount; } @@ -244,20 +270,18 @@ export function duplicatePageSection(currentSection, currentItem, itemIndex = 0) } else { cy.get(currentItem).eq(itemIndex).find('.paragraphs-dropdown-toggle').click(); cy.get(currentItem).eq(itemIndex).find('[value="Duplicate"]').click(); + cy.wait(2000); } }).then(() => { - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(200000); - }) - .then(() => { - cy.wrap(getElementCount(currentItem, currentSection)).should('eq', beforeLabels + 1); - }); + // verifyElementCount(currentItem,currentSection,beforeLabels + 1); + }); } -export function removePageSection(currentItem, itemIndex) { - if (typeof itemIndex === 'undefined') { - itemIndex = 0; +export function removePageSection(currentItem) { + cy.task('log', `Removing ${currentItem.section} - ${currentItem.itemId}`); + if (typeof currentItem.itemIndex === 'undefined') { + currentItem.itemIndex = 0; } if ((typeof currentItem.section !== 'undefined') && (['Body', 'Sidebar'].includes(currentItem.section))) { const beforeLabels = getElementCount(currentItem.itemId, currentItem.section); @@ -417,6 +441,7 @@ export function setupDialog(dialogObject) { dialogObject.dialogId = '.ui-dialog'; } cy.get('body').then(() => { + cy.wait(2000); if (dialogObject.subFields.length > 0) { cy.wrap(dialogObject.subFields).each((currentSetting) => { cy.get(dialogObject.dialogId).then((currentDialog) => { From f09f466359cfe78ca39c6a0a6459a84c4b846281 Mon Sep 17 00:00:00 2001 From: Brandon Bruce Date: Thu, 8 Feb 2024 15:00:43 -0500 Subject: [PATCH 2/9] DRPLA-8 --- test/e2e/fixtures/eventsNew.json | 5 +- test/e2e/specs/smoke/tc6.events.errors.cy.js | 2 +- test/e2e/specs/smoke/tc6.events.new.cy.js | 46 +++++------ test/e2e/support/functions.js | 82 ++++++++++++++++---- 4 files changed, 91 insertions(+), 44 deletions(-) diff --git a/test/e2e/fixtures/eventsNew.json b/test/e2e/fixtures/eventsNew.json index 41592ce055..030ab2e52e 100644 --- a/test/e2e/fixtures/eventsNew.json +++ b/test/e2e/fixtures/eventsNew.json @@ -1,6 +1,7 @@ { "testCaseName":"TC6 - Events", "contentType":"Event", + "pageTitle": "Test Event One", "formatItems": [ { @@ -8,7 +9,7 @@ "itemId": ".field--name-title", "itemName": "Title", "fields":[ - {"fieldName":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "This is a test event title", "fieldDefault": ""} + {"fieldName":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "Test Event One", "fieldDefault": ""} ], "errors": [ "Title field is required.", @@ -656,7 +657,7 @@ [ {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, - {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a test event title"} + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Test Event One"} ], "expectedCount": 1 }, diff --git a/test/e2e/specs/smoke/tc6.events.errors.cy.js b/test/e2e/specs/smoke/tc6.events.errors.cy.js index dee72f8953..a43acc063b 100755 --- a/test/e2e/specs/smoke/tc6.events.errors.cy.js +++ b/test/e2e/specs/smoke/tc6.events.errors.cy.js @@ -45,7 +45,7 @@ describe('TC6 - Events - errors', () => { errors.push(currentError); } }); - cy.task('log', `errors: ${JSON.stringify(errors)}`); + // cy.task('log', `errors: ${JSON.stringify(errors)}`); cy.wrap(errors).should('have.length', 0); cy.wrap(getErrorMessages()).should('have.length', currentItem.errors.length); }); diff --git a/test/e2e/specs/smoke/tc6.events.new.cy.js b/test/e2e/specs/smoke/tc6.events.new.cy.js index 3551854d04..cbed6f2d10 100755 --- a/test/e2e/specs/smoke/tc6.events.new.cy.js +++ b/test/e2e/specs/smoke/tc6.events.new.cy.js @@ -6,8 +6,6 @@ import { const formatFile = require('../../fixtures/eventsNew.json'); -let pageTitle = 'old news'; - describe('TC6 - Events', () => { Cypress.on('uncaught:exception', (_err, _runnable) => false); before(() => { @@ -16,7 +14,6 @@ describe('TC6 - Events', () => { beforeEach(() => { cy.preserveAllCookiesOnce(); - cy.wrap(pageTitle).as('pageTitle'); }); it(`Add New ${formatFile.contentType}`, () => { @@ -49,21 +46,13 @@ describe('TC6 - Events', () => { it('Duplicate HTML Section', () => { duplicatePageSection('Body', '.paragraph-type--html', 0); - cy.wait(2000); }); it('Save after entering all required information', () => { cy.get('body').then(() => { - cy.get('.field--name-title').find('input').then((titleField) => { - // pageTitle = titleField.val().trim(); - pageTitle = 'This is a test event title'; - cy.wrap(pageTitle).as('pageTitle'); - }); - }).then(() => { - cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() - .click({force: true}); + cy.get('[data-drupal-selector="edit-actions"]').find('input').first().click({force: true}); }).then(() => { - cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been created.`); + cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been created.`); }); }); @@ -81,6 +70,7 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("View"):visible').first().click(); }).then(() => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); verifyPageElements(formatFile.expected); }); @@ -92,7 +82,6 @@ describe('TC6 - Events', () => { verifyPageSource('DC.date.reviewed', getTodayDate('yyyy-MM-dd'), (60000 * 60 * 24 * 90)); }); - it(`Edit ${formatFile.contentType}`, () => { cy.get('body').then(() => { cy.get('a:contains("Edit"):visible').first().click(); @@ -103,7 +92,7 @@ describe('TC6 - Events', () => { }).then(() => { cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() .click(); - cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been updated.`); + cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been updated.`); verifyPageElements(formatFile.expectedEdited); }); }); @@ -133,8 +122,8 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("Group Dashboard"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); }); }); @@ -142,17 +131,17 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("Published Content"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); }); }); it('Clone the page', () => { cy.get('body').then(() => { - cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get(`a:contains("${formatFile.pageTitle}"):visible`).first().click(); cy.get('a:contains("Clone"):visible').first().click(); cy.get('[value="Clone"]').first().click(); }).then(() => { - cy.get('.usa-alert__text').should('contain.text', `The entity ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', `The entity ${formatFile.pageTitle}`); cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); verifyPageElements(formatFile.expected); @@ -174,8 +163,8 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("Group Dashboard"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); }); }); @@ -183,7 +172,7 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("Published Content"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).should('not.exist'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).should('not.exist'); }); }); @@ -191,7 +180,8 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('a:contains("Latest Revisions")').click(); }).then(() => { - cy.get('.views-table').find('tbody').find(`a:contains("${pageTitle}")`).click(); + cy.get('.views-table').find('tbody').find(`a:contains("${formatFile.pageTitle}")`).first() + .click(); }).then(() => { verifyPageElements(formatFile.expected); verifyPageElements(formatFile.expectedEdited); @@ -202,11 +192,11 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('nav').find('a:contains("My Web Areas")').first().click(); cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); - cy.get(`a:contains("Cloned: ${pageTitle}"):visible`).first().click(); + cy.get(`a:contains("Cloned: ${formatFile.pageTitle}"):visible`).first().click(); cy.get('a:contains("Delete"):visible').first().click(); cy.get('[value="Delete"]').first().click(); }).then(() => { - cy.get('.usa-alert__text').should('contain.text', `The Event Cloned: ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', `The Event Cloned: ${formatFile.pageTitle}`); cy.get('.usa-alert__text').should('contain.text', 'has been deleted.'); }); }); @@ -215,11 +205,11 @@ describe('TC6 - Events', () => { cy.get('body').then(() => { cy.get('nav').find('a:contains("My Web Areas")').first().click(); cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); - cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get(`a:contains("${formatFile.pageTitle}"):visible`).first().click(); cy.get('a:contains("Delete"):visible').first().click(); cy.get('[value="Delete"]').first().click(); }).then(() => { - cy.get('.usa-alert__text').should('contain.text', `The Event ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', `The Event ${formatFile.pageTitle}`); cy.get('.usa-alert__text').should('contain.text', 'has been deleted.'); }); }); diff --git a/test/e2e/support/functions.js b/test/e2e/support/functions.js index de337636ab..f14a6b2275 100755 --- a/test/e2e/support/functions.js +++ b/test/e2e/support/functions.js @@ -169,6 +169,17 @@ export function logout(logoutMethod) { } //* **********************************New Content methods*************************************************** */ +export function navigateToWebArea(webArea) { + cy.get('nav').find('a:contains("My Web Areas")').first().click(); + cy.get('.block:contains("My Web Areas")').find(`a:contains("${webArea}"):visible`).first().click(); +} + +export function addContent(contentType) { + cy.contains('a', 'Add new content').click(); + cy.get('.admin-list').contains('a', contentType).click(); + cy.get('.page-title').should('contain.text', `Add Web Area: Group node (${contentType})`); +} + export function verifyPageSource(searchTerm, expectedTerm) { const errors = []; cy.url().then((currentUrl) => { @@ -186,7 +197,7 @@ export function verifyPageSource(searchTerm, expectedTerm) { } }); cy.task('log', `errors: ${errors}`); - cy.wrap(errors).should('contain.have.length', 0); + cy.wrap(errors).should('have.length', 0); }); }); } @@ -226,6 +237,7 @@ export function addPageSection(currentItem) { }).then(() => { cy.get(`.placeholder:contains("${currentItem.section}"):visible`).parent().find(`[value="Add ${currentItem.itemName}"]:visible`).first() .click(); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); }) .then(() => { @@ -256,25 +268,25 @@ export function getElementCount(currentElement, section) { } export function duplicatePageSection(currentSection, currentItem, itemIndex = 0) { - let beforeLabels = 0; - cy.get('body').then(() => { - beforeLabels = getElementCount(currentItem, currentSection); - }).then(() => { - if ((typeof currentSection !== 'undefined') && (['Body', 'Sidebar'].includes(currentSection))) { + if ((typeof currentSection !== 'undefined') && (['Body', 'Sidebar'].includes(currentSection))) { + let beforeLabels = 0; + cy.get('body').then(() => { + beforeLabels = getElementCount(currentItem, currentSection); + }).then(() => { cy.get(`.field-label:contains("${currentSection}")`).parents('table').find(currentItem).eq(itemIndex) .find('.paragraphs-dropdown-toggle') .click(); + }).then(() => { cy.get(`.field-label:contains("${currentSection}")`).parents('table').find(currentItem).eq(itemIndex) .find('[value="Duplicate"]') .click(); - } else { - cy.get(currentItem).eq(itemIndex).find('.paragraphs-dropdown-toggle').click(); - cy.get(currentItem).eq(itemIndex).find('[value="Duplicate"]').click(); + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); - } - }).then(() => { - // verifyElementCount(currentItem,currentSection,beforeLabels + 1); - }); + }) + .then(() => { + verifyElementCount(currentItem, currentSection, beforeLabels + 1); + }); + } } @@ -361,6 +373,47 @@ export function setPageFields(currentItem) { } } +export function addWebformElements(webformElements) { + cy.get('body').then(() => { + cy.wrap(webformElements).each((currentElement) => { + cy.get('a:contains("Add element")').click(); + cy.get(`tr:contains("${currentElement.elementType}")`).first().find('a:contains("Add element")').click(); + setWebformFields(currentElement); + }); + }).then(() => { + cy.get('[value="Save elements"]').click(); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); + }); +} + +export function setWebformFields(webformFields) { + cy.wrap(webformFields.elementDetails).each((currentTab) => { + cy.get('body').then(() => { + cy.get('.webform-tabs-item-list').find(`a:contains("${currentTab.tabName}")`).click(); + }).then(() => { + cy.wrap(currentTab.sections).each((currentSection) => { + let currentElement = currentTab.tabId; + if ((typeof currentSection.sectionId !== 'undefined') && (currentSection.sectionId.length !== 0)) { + currentElement = currentSection.sectionId; + cy.get(currentSection.sectionId).click(); + } + cy.wrap(currentSection.fields).each((currentField) => { + if (typeof currentField.fieldIndex === 'undefined') { + currentField.fieldIndex = 0; + } + cy.get(currentElement).then((fieldElement) => { + setFieldValue(fieldElement, currentField); + }); + }); + }); + }).then(() => { + cy.get('[id=drupal-off-canvas]').find('[data-drupal-selector=edit-submit]').click(); + cy.get(`tr:contains("${webformFields.elementName}")`).should('exist'); + }); + }); +} + export function setFieldValue(currentElement, currentField) { cy.wrap(currentElement).find(currentField.fieldName).eq(currentField.fieldIndex).then((currentItem) => { switch (currentField.fieldType) { @@ -430,6 +483,8 @@ export function setFieldValue(currentElement, currentField) { cy.wrap(currentItem).click(); }).then(() => { cy.wrap(currentItem).type(currentField.fieldValue); + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(2000); }); break; } @@ -441,6 +496,7 @@ export function setupDialog(dialogObject) { dialogObject.dialogId = '.ui-dialog'; } cy.get('body').then(() => { + // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); if (dialogObject.subFields.length > 0) { cy.wrap(dialogObject.subFields).each((currentSetting) => { From 2222343cb094af4a248e40080ad35230ba7ed2af Mon Sep 17 00:00:00 2001 From: Brandon Bruce Date: Thu, 15 Feb 2024 16:05:08 -0500 Subject: [PATCH 3/9] DRPLA-8 Events --- test/e2e/fixtures/eventsNew.json | 146 +++++++++--------- test/e2e/specs/smoke/tc6.events.errors.cy.js | 1 - test/e2e/specs/smoke/tc6.events.new.cy.js | 4 +- test/e2e/support/functions.js | 151 +++++++++++++------ 4 files changed, 178 insertions(+), 124 deletions(-) diff --git a/test/e2e/fixtures/eventsNew.json b/test/e2e/fixtures/eventsNew.json index 030ab2e52e..a0042a8c32 100644 --- a/test/e2e/fixtures/eventsNew.json +++ b/test/e2e/fixtures/eventsNew.json @@ -9,7 +9,7 @@ "itemId": ".field--name-title", "itemName": "Title", "fields":[ - {"fieldName":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "Test Event One", "fieldDefault": ""} + {"fieldId":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "Test Event One", "fieldDefault": ""} ], "errors": [ "Title field is required.", @@ -25,7 +25,7 @@ "section": "", "itemId": ".field--name-field-description", "itemName": "Description", - "fields":[{"fieldName":"[id=edit-field-description-0-value]","fieldType": "text", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", "fieldDefault": "" }], @@ -45,10 +45,10 @@ "itemId": ".field--type-smartdate", "itemName": "Date", "fields":[ - {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 1}, - {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 360000, "fieldDefault": "", "fieldIndex": 1} + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 1}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 360000, "fieldDefault": "", "fieldIndex": 1} ], "errors": [ "Title field is required.", @@ -66,8 +66,8 @@ "itemId": ".field--name-field-deadline", "itemName": "Registration Deadline", "fields":[ - {"fieldName":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} ], "errors": [ @@ -85,11 +85,11 @@ "itemId": ".field--type-address", "itemName": "Location", "fields":[ - {"fieldName":".address-line1","fieldType": "text", "fieldValue": "109 TW Alexander Dr", "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".address-line2","fieldType": "text", "fieldValue": "EPA Building", "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".locality","fieldType": "text", "fieldValue": "Durham", "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".administrative-area","fieldType": "select", "fieldValue": "North Carolina", "fieldDefault": "", "fieldIndex": 0}, - {"fieldName":".postal-code","fieldType": "text", "fieldValue": "27709", "fieldDefault": "", "fieldIndex": 0} + {"fieldId":".address-line1","fieldType": "text", "fieldValue": "109 TW Alexander Dr", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".address-line2","fieldType": "text", "fieldValue": "EPA Building", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".locality","fieldType": "text", "fieldValue": "Durham", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".administrative-area","fieldType": "select", "fieldValue": "North Carolina", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".postal-code","fieldType": "text", "fieldValue": "27709", "fieldDefault": "", "fieldIndex": 0} ], "errors": [ "Title field is required.", @@ -106,7 +106,7 @@ "itemId": ".field--name-field-event-host", "itemName": "Event Host", "fields":[ - {"fieldName":".js-text-full","fieldType": "text", "fieldValue": "Nature Conservancy", "fieldDefault": "", "fieldIndex": 0} + {"fieldId":".js-text-full","fieldType": "text", "fieldValue": "Nature Conservancy", "fieldDefault": "", "fieldIndex": 0} ], "errors": [ "Title field is required.", @@ -123,8 +123,8 @@ "itemId": "[id=field-links-values]", "itemName": "Links", "fields":[ - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "Event Links", "fieldDefault": ""} + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "Event Links", "fieldDefault": ""} ], "errors": [ "Title field is required.", @@ -141,7 +141,7 @@ "section": "", "itemId": ".field--name-field-keywords", "itemName": "Keywords", - "fields":[{"fieldName": "[id=edit-field-keywords-target-id]", + "fields":[{"fieldId": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""}], @@ -159,7 +159,7 @@ "section": "", "itemId": ".field--name-field-event-type", "itemName":"Event Type", - "fields":[{"fieldName": "select", "fieldType": "select", "fieldValue": "Job Fair", "fieldDefault": 0}], + "fields":[{"fieldId": "select", "fieldType": "select", "fieldValue": "Job Fair", "fieldDefault": 0}], "errors": [ "Title field is required.", "The Start date is required. Please enter a date in the format", @@ -174,7 +174,7 @@ "section": "", "itemId": ".field--name-field-type", "itemName":"Type", - "fields":[{"fieldName": "[id=edit-field-type]", + "fields":[{"fieldId": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0 @@ -197,10 +197,10 @@ "fields": [ { - "fieldName":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", "subFields":[ - {"fieldName":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, - {"fieldName":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} ] } ], @@ -220,10 +220,10 @@ "itemId": ".paragraph-type--card-group", "itemName": "Card Group", "fields":[ - {"fieldName":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, - {"fieldName":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, - {"fieldName":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, - {"fieldName":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} ], "errors": [ "Title field is required.", @@ -242,8 +242,8 @@ "itemId": ".paragraph-type--header", "itemName": "Header", "fields":[ - {"fieldName": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], "errors": [ "Title field is required.", @@ -261,8 +261,8 @@ "itemId": ".paragraph-type--link-list", "itemName": "Link List", "fields":[ - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} ], "errors": [ @@ -282,9 +282,9 @@ "itemId": ".paragraph-type--slideshow", "itemName": "Slideshow", "fields":[ - {"fieldName": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, - {"fieldName": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], "errors": [ "Title field is required.", @@ -303,10 +303,10 @@ "itemName": "Dynamic List", "itemIndex": 0, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -325,10 +325,10 @@ "itemName": "Dynamic List", "itemIndex": 1, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -348,10 +348,10 @@ "itemName": "Dynamic List", "itemIndex": 2, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -371,10 +371,10 @@ "itemName": "Dynamic List", "itemIndex": 3, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -394,10 +394,10 @@ "itemName": "Dynamic List", "itemIndex": 4, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ] , "errors": @@ -418,10 +418,10 @@ "itemName": "Dynamic List", "itemIndex": 5, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -440,10 +440,10 @@ "itemName": "Dynamic List", "itemIndex": 6, "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, - {"fieldName": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, - {"fieldName":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, - {"fieldName": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} ], "errors": [ @@ -461,7 +461,7 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 0, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], "errors": [ "Title field is required.", @@ -478,7 +478,7 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 1, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], "errors": [ "Title field is required.", @@ -497,7 +497,7 @@ "itemIndex": 0, "fields": [ - {"fieldName": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} ], "errors": [ @@ -517,7 +517,7 @@ "itemIndex": 0, "fields": [ - {"fieldName": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", "fieldValue" : ["", "", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "webform": + [ + { + "elementType": "Checkbox", + "elementName": "This is a checkbox", + "elementDetails": + [ + { + "tabId": "[id=webform-tab--general]", + + "tabName":"General", + "sections": + [ + { + "sectionId": "", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"This is a checkbox"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-element-description]", + "fields": + [ + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"This is a checkbox description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-help]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Checkbox Help Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Checkbox Help description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-more]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Checkbox More Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Checkbox More description"} + ] + } + + ] + } + ] + }, + { + "elementType": "Name", + "elementName": "Hello. My name is", + "elementDetails": + [ + { + "tabId": "[id=webform-tab--general]", + "tabName":"General", + "sections": + [ + { + "sectionId": "", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Hello. My name is"} + ] + }, + { + "sectionId": "", + "fields": + [ + {"fieldId":"[data-drupal-selector=edit-properties-first-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true}, + {"fieldId":"[data-drupal-selector=edit-properties-middle-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true}, + {"fieldId":"[data-drupal-selector=edit-properties-last-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-element-description]", + "fields": + [ + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"This is a name description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-more]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Name More Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Name More description"} + ] + } + + ] + } + ] + } + ], + "webformEdited": + [ + { + "elementType": "Checkbox", + "elementName": "This is a checkbox", + "elementAction": "edit", + "elementDetails": + [ + { + "tabId": "[id=webform-tab--general]", + "tabName":"General", + "sections": + [ + { + "sectionId": "[data-drupal-selector=edit-element-description]", + "fields": + [ + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Edited description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-validation]", + "fields": + [ + {"fieldId":"[data-drupal-selector=edit-properties-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true} + ] + } + ] + } + ] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Test Form One"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 6 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"This is a checkbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a checkbox"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".js-webform-element-help", + "expectedProperties": + [ + {"expectedPropertyName": "ariaLabel", "expectedPropertyValue": "Checkbox Help Title"}, + {"expectedPropertyName": "outerHTML", "expectedPropertyValue": "Checkbox Help description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-description:contains(\"checkbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a checkbox description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--link:contains(\"heckbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Checkbox More Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--content:contains(\"heckbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Checkbox More description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "legend:contains(\"Hello\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Hello. My name is"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-description:contains(\"name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a name description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--link:contains(\"Name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Name More Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--content:contains(\"Name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Name More description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-composite-visible-title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue":"Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "select:contains(\"Mrs\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "- None -MissMsMrMrsDrOther…"}, + {"expectedPropertyName": "class", "exists":false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"First\")", + "itemId": "label:contains(\"First\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"First\")", + "itemId": "input:visible", + "itemIndex": 2, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"Middle\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"Middle\")", + "itemId": "input:visible", + "itemIndex": 3, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"Last\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"Last\")", + "itemId": "input:visible", + "itemIndex": 4, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"Suffix\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"Suffix\")", + "itemId": "input:visible", + "itemIndex": 5, + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "is-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"Degree\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": ".js-form-type-textfield:contains(\"Degree\")", + "itemId": "input:visible", + "itemIndex": 5, + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "is-required"} + ], + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/frequentQuestionsNew.json b/test/e2e/fixtures/frequentQuestionsNew.json new file mode 100644 index 0000000000..f0e8e9379f --- /dev/null +++ b/test/e2e/fixtures/frequentQuestionsNew.json @@ -0,0 +1,189 @@ +{ + "testCaseName":"TC8 - Frequent Questions", + "contentType":"Frequent Question", + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-field-question", + "itemName": "Question", + "fields":[ + {"fieldId":"textarea","fieldType": "text", "fieldValue": "What is the airspeed velocity of an unladen swallow? ", "fieldDefault": ""}, + {"fieldId":"textarea","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":"textarea","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ] + }, + { + "section": "", + "itemId": ".field--name-body", + "itemName": "Answer", + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "roughly 20.1 miles per hour", "fieldDefault": ""}] + }, + { + "section": "", + "itemId": ".field--name-field-faq-taxonomy-topics", + "itemName":"Topics", + "fields":[ + {"fieldId":"a:contains(\"Add another item\")","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"a:contains(\"Add another item\")","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": "Asbestos","fieldDefault": 0,"fieldIndex":0}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": 1,"fieldDefault": 0,"fieldIndex":1}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": "Lead","fieldDefault": 0,"fieldIndex":2}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": 1,"fieldDefault": 0,"fieldIndex":3}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": 2,"fieldDefault": 0,"fieldIndex":4}, + {"fieldId": "select:visible","fieldType": "select","fieldValue": 1,"fieldDefault": 0,"fieldIndex":5} + ], + "errors": ["Channel field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-related-questions", + "itemName":"Related Questions", + "fields":[ + {"fieldId":"[value=\"Add another item\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Add another item\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId": ".form-autocomplete:visible","fieldType": "autocomplete", "fieldIndex": 0, "fieldValue" : "Where", "fieldDefault": ""}, + {"fieldId": ".form-autocomplete:visible","fieldType": "autocomplete", "fieldIndex": 1, "fieldValue" : "When", "fieldDefault": ""}, + {"fieldId": ".form-autocomplete:visible","fieldType": "autocomplete", "fieldIndex": 2, "fieldValue" : "What", "fieldDefault": ""} + ] + }, + { + "section": "", + "itemId": "[id=edit-field-channel-wrapper]", + "itemName": "Channel", + "fields":[{"fieldId": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldId": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "editedItems": + [ + { + "section": "", + "itemId": ".field--name-body", + "itemName": "Answer", + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : " - edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "What is the airspeed velocity of an unladen swallow?"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"roughly 20.1 miles per hour\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Related\")", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Questions"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Where\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"when\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"What\")", + "expectedCount": 1 + } + + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"edited\")", + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/media.json b/test/e2e/fixtures/media.json new file mode 100644 index 0000000000..48530da384 --- /dev/null +++ b/test/e2e/fixtures/media.json @@ -0,0 +1,798 @@ +{ + + "testCaseName":"TC4 - Files", + "contentType":"Files", + "pageTitle": "", + "searches": + [ + { + "section": "", + "itemId": ".view-filters", + "itemName": "Filter By Name", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "Introduction", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-name-1", "fieldValue":"Introduction"} + ] + }, + { + "section": "", + "itemId": ".view-filters", + "itemName": "Filter By Web Area", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-gid]","fieldType": "autocomplete", "fieldValue": "Web Guide", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-web-area-name", "fieldValue":"Web Guide"} + ] + },{ + "section": "", + "itemId": ".view-filters", + "itemName": "Filter by Author", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-gid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-uid]","fieldType": "autocomplete", "fieldValue": "testtwo_drupal", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-name-1", "fieldValue":"Introduction"} + ] + },{ + "section": "", + "itemId": ".view-filters", + "itemName": "Filter by Type", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-gid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-uid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-bundle]","fieldType": "select", "fieldValue": "Image", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-name-1", "fieldValue":"Introduction"} + ] + },{ + "section": "", + "itemId": ".view-filters", + "itemName": "Filter by Web area filter", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-gid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-uid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-bundle]","fieldType": "select", "fieldValue": "Image", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-users-in-groups]","fieldType": "select", "fieldValue": "Limit to my Web Areas", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-name-1", "fieldValue":"Introduction"} + ] + },{ + "section": "", + "itemId": ".view-filters", + "itemName": "Filter by Usage Restrictions", + "fields":[ + {"fieldId":"[data-drupal-selector=edit-search-api-fulltext]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-gid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-uid]","fieldType": "text", "fieldValue": "", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-bundle]","fieldType": "select", "fieldValue": "Image", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-users-in-groups]","fieldType": "select", "fieldValue": "Limit to my Web Areas", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-field-banner-image-restricted]","fieldType": "select", "fieldValue": "Restricted", "fieldDefault": ""}, + {"fieldId":"[data-drupal-selector=edit-submit-media-search-api]","fieldType": "button", "fieldValue": "", "fieldDefault": ""} + ], + "verify": + [ + {"fieldId":".views-field-name-1", "fieldValue":"Introduction"} + ] + } + ], + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-title", + "itemName": "Title", + "fields":[ + {"fieldId":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "Test Form One", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldId": "[id=edit-field-type]", + "fieldType": "select", + "fieldValue": "News Release", + "fieldDefault": 0 + }], + "errors": ["Channel field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--from-library", + "itemName": "From library", + "fields": + [ + { + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "subFields":[ + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + ] + } + ], + "errors": ["Channel field is required.", "Reusable paragraph field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--card-group", + "itemName": "Card Group", + "fields":[ + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required.","Title field is required.", + "Body field is required.", "Link text field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--header", + "itemName": "Header", + "fields":[ + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--link-list", + "itemName": "Link List", + "fields":[ + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--slideshow", + "itemName": "Slideshow", + "fields":[ + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 0, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 1, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 2, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 3, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 4, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ] + , + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 5, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 6, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 0, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "webform": + [ + { + "elementType": "Checkbox", + "elementName": "This is a checkbox", + "elementDetails": + [ + { + "tabId": "[id=webform-tab--general]", + + "tabName":"General", + "sections": + [ + { + "sectionId": "", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"This is a checkbox"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-element-description]", + "fields": + [ + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"This is a checkbox description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-help]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Checkbox Help Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Checkbox Help description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-more]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Checkbox More Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Checkbox More description"} + ] + } + + ] + } + ] + }, + { + "elementType": "Name", + "elementName": "Hello. My name is", + "elementDetails": + [ + { + "tabId": "[id=webform-tab--general]", + "tabName":"General", + "sections": + [ + { + "sectionId": "", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Hello. My name is"} + ] + }, + { + "sectionId": "", + "fields": + [ + {"fieldId":"[data-drupal-selector=edit-properties-first-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true}, + {"fieldId":"[data-drupal-selector=edit-properties-middle-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true}, + {"fieldId":"[data-drupal-selector=edit-properties-last-required]", "fieldIndex":0, "fieldType":"checkbox","fieldValue":true} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-element-description]", + "fields": + [ + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"This is a name description"} + ] + }, + { + "sectionId": "[data-drupal-selector=edit-more]", + "fields": + [ + {"fieldId":"input:visible", "fieldIndex":0, "fieldType":"text","fieldValue":"Name More Title"}, + {"fieldId":".cke_wysiwyg_frame", "fieldIndex":0, "fieldType":"iframe","fieldValue":"Name More description"} + ] + } + + ] + } + ] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Test Form One"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 7 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "label:contains(\"This is a checkbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a checkbox"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".js-webform-element-help", + "expectedProperties": + [ + {"expectedPropertyName": "ariaLabel", "expectedPropertyValue": "Checkbox Help Title"}, + {"expectedPropertyName": "outerHTML", "expectedPropertyValue": "Checkbox Help description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-description:contains(\"checkbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a checkbox description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--link:contains(\"heckbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Checkbox More Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--content:contains(\"heckbox\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Checkbox More description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "legend", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Hello. My name is"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-description:contains(\"name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a name description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--link:contains(\"name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Name More Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-element-more--content:contains(\"name\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Name More description"} + ], + "expectedCount": 1 + }, + + { + "section": "article", + "itemId": ".webform-composite-visible-title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Name More description"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".webform-composite-visible-title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue":"Title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "select:contains(\"Mrs\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "- None -MissMsMrMrsDrOther…"}, + {"expectedPropertyName": "class", "exists":false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".label:contains(\"First\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "input:visible", + "itemIndex": 1, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 9 + }, + { + "section": "article", + "itemId": ".label:contains(\"Middle\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "input:visible", + "itemIndex": 2, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 9 + }, + { + "section": "article", + "itemId": ".label:contains(\"Last\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "input:visible", + "itemIndex": 3, + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue": "is-required"} + ], + "expectedCount": 9 + }, + { + "section": "article", + "itemId": ".label:contains(\"Suffix\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "input:visible", + "itemIndex": 4, + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "is-required"} + ], + "expectedCount": 9 + }, + { + "section": "article", + "itemId": ".label:contains(\"Degree\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "js-form-required"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "input:visible", + "itemIndex": 5, + "expectedProperties": + [ + {"expectedPropertyName": "class", "exists": false, "expectedPropertyValue": "is-required"} + ], + "expectedCount": 9 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/newsReleaseNew.json b/test/e2e/fixtures/newsReleaseNew.json new file mode 100644 index 0000000000..175eebc69f --- /dev/null +++ b/test/e2e/fixtures/newsReleaseNew.json @@ -0,0 +1,611 @@ +{ + "testCaseName":"TC9 - News Releases", + "contentType":"News Release", + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-field-event-cancellation", + "itemName": "Canceled", + "fields": + [ + { + "fieldId": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false + } + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-title", + "itemName": "Title", + "fields":[ + {"fieldId":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "This is a test News Release title", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".field--type-smartdate", + "itemName": "Date", + "fields":[ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 1}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 360000, "fieldDefault": "", "fieldIndex": 1} + ], + "errors": [ + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + + { + "section": "", + "itemId": ".field--name-field-deadline", + "itemName": "Registration Deadline", + "fields":[ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + + ], + "errors": [ + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--type-address", + "itemName": "Location", + "fields":[ + {"fieldId":".address-line1","fieldType": "text", "fieldValue": "109 TW Alexander Dr", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".address-line2","fieldType": "text", "fieldValue": "EPA Building", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".locality","fieldType": "text", "fieldValue": "Durham", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".administrative-area","fieldType": "select", "fieldValue": "North Carolina", "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".postal-code","fieldType": "text", "fieldValue": "27709", "fieldDefault": "", "fieldIndex": 0} + ], + "errors": [ + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-event-host", + "itemName": "Event Host", + "fields":[ + {"fieldId":".js-text-full","fieldType": "text", "fieldValue": "Nature Conservancy", "fieldDefault": "", "fieldIndex": 0} + ], + "errors": [ + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": "[id=field-links-values]", + "itemName": "Links", + "fields":[ + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "Event Links", "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".field--name-field-keywords", + "itemName": "Keywords", + "fields":[{"fieldId": "[id=edit-field-keywords-target-id]", + "fieldType": "text", + "fieldValue": "blood lead testing (331587), drupal (332750)", + "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-event-type", + "itemName":"Event Type", + "fields":[{"fieldId": "select", "fieldType": "select", "fieldValue": "Job Fair", "fieldDefault": 0}], + "errors": ["Channel field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldId": "[id=edit-field-type]", + "fieldType": "select", + "fieldValue": "News Release", + "fieldDefault": 0 + }], + "errors": ["Channel field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--from-library", + "itemName": "From library", + "fields": + [ + { + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "subFields":[ + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + ] + } + ], + "errors": ["Channel field is required.", "Reusable paragraph field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--card-group", + "itemName": "Card Group", + "fields":[ + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required.","Title field is required.", + "Body field is required.", "Link text field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--header", + "itemName": "Header", + "fields":[ + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--link-list", + "itemName": "Link List", + "fields":[ + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--slideshow", + "itemName": "Slideshow", + "fields":[ + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 0, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 1, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 2, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 3, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 4, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ] + , + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 5, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 6, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 0, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Canceled:"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a test event title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Date and Time\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"Registration Deadline\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Location\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 7 + }, + + + + + { + "section": "article", + "itemId": ".address-line1", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "109 TW Alexander Dr"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".address-line2", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "EPA Building"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".locality", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Durham"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".administrative-area", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "NC"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".postal-code", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "27709"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".country", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "United States"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Host\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Nature Conservancy"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Type\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Job Fair"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Event Links\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/performanceUrls full.json b/test/e2e/fixtures/performanceUrls full.json new file mode 100755 index 0000000000..c9e32c98ac --- /dev/null +++ b/test/e2e/fixtures/performanceUrls full.json @@ -0,0 +1,24 @@ +{ + "urls": [ + { + "name": "home", + "url": "/", + "expectedLoadTime": 5000 + }, + { + "name": "urban parks", + "url": "/perspectives/celebrating-urban-parks-during-national-park-week", + "expectedLoadTime": 5000 + }, + { + "name": "epa protect", + "url": "/perspectives/5-ways-epa-protecting-people-and-planet", + "expectedLoadTime": 5000 + }, + { + "name": "epa protect2", + "url": "/perspectives/5-ways-epa-protecting-people-and-planet", + "expectedLoadTime": 5000 + } + ] + } \ No newline at end of file diff --git a/test/e2e/fixtures/publicNoticesNew.json b/test/e2e/fixtures/publicNoticesNew.json new file mode 100644 index 0000000000..eb539fb4c5 --- /dev/null +++ b/test/e2e/fixtures/publicNoticesNew.json @@ -0,0 +1,501 @@ +{ + + "testCaseName":"TC10 - Public Notice", + "contentType":"Public Notice", + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-title", + "itemName": "Title", + "fields":[ + {"fieldId":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "This is a test Public Notice title", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldId": "[id=edit-field-type]", + "fieldType": "select", + "fieldValue": "News Release", + "fieldDefault": 0 + }], + "errors": ["Channel field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--from-library", + "itemName": "From library", + "fields": + [ + { + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "subFields":[ + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + ] + } + ], + "errors": ["Channel field is required.", "Reusable paragraph field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--card-group", + "itemName": "Card Group", + "fields":[ + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required.","Title field is required.", + "Body field is required.", "Link text field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--header", + "itemName": "Header", + "fields":[ + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--link-list", + "itemName": "Link List", + "fields":[ + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--slideshow", + "itemName": "Slideshow", + "fields":[ + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 0, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 1, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 2, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 3, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 4, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ] + , + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 5, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 6, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 0, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Canceled:"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a test event title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Date and Time\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"Registration Deadline\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Location\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 7 + }, + + + + + { + "section": "article", + "itemId": ".address-line1", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "109 TW Alexander Dr"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".address-line2", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "EPA Building"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".locality", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Durham"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".administrative-area", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "NC"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".postal-code", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "27709"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".country", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "United States"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Host\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Nature Conservancy"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Type\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Job Fair"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Event Links\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/regulationsNew.json b/test/e2e/fixtures/regulationsNew.json new file mode 100644 index 0000000000..80651cc629 --- /dev/null +++ b/test/e2e/fixtures/regulationsNew.json @@ -0,0 +1,501 @@ +{ + + "testCaseName":"TC8 - Regulation", + "contentType":"Regulation", + "formatItems": + [ + { + "section": "", + "itemId": ".field--name-title", + "itemName": "Title", + "fields":[ + {"fieldId":"[id=edit-title-0-value]","fieldType": "text", "fieldValue": "This is a test Regulation title", "fieldDefault": ""} + ], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Description field is required.", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-description", + "itemName": "Description", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", + "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", + "fieldDefault": "" + }], + "errors": [ + "Title field is required.", + "The Start date is required. Please enter a date in the format", + "The End date is required. Please enter a date in the format", + "Event Type field is required.", + "Type field is required.", + "Channel field is required." + ] + }, + { + "section": "", + "itemId": ".field--name-field-type", + "itemName":"Type", + "fields":[{"fieldId": "[id=edit-field-type]", + "fieldType": "select", + "fieldValue": "News Release", + "fieldDefault": 0 + }], + "errors": ["Channel field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--from-library", + "itemName": "From library", + "fields": + [ + { + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "subFields":[ + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + ] + } + ], + "errors": ["Channel field is required.", "Reusable paragraph field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--card-group", + "itemName": "Card Group", + "fields":[ + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required.","Title field is required.", + "Body field is required.", "Link text field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--header", + "itemName": "Header", + "fields":[ + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--link-list", + "itemName": "Link List", + "fields":[ + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--slideshow", + "itemName": "Slideshow", + "fields":[ + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 0, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: All Content", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 1, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Events", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Content", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 2, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Frequent Questions", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Frequent Questions", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 3, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Perspectives", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 4, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Speeches and Remarks", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Speeches and Remarks", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ] + , + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 5, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: News Releases", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "News Releases", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + + { + "section": "Body", + "itemId": ".paragraph-type--dynamic-list", + "itemName": "Dynamic List", + "itemIndex": 6, + "fields":[ + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Public Notices", "fieldDefault": ""}, + {"fieldId": "select","fieldType": "select", "fieldIndex": 1, "fieldValue" : "Public Notices", "fieldDefault": ""}, + {"fieldId":"summary","fieldType":"button","fieldIndex":0,"fieldDefault":""}, + {"fieldId": ".form-type-checkbox:contains(\"pagination\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 0, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Page Javascript\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".vertical-tabs__panes", + "itemName": "Page Javascript", + "itemIndex": 0, + "fields": + [ + {"fieldId": "[id=edit-field-page-head-0-value]","fieldType": "javascript", + "fieldValue" : + ["", + ""], + "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + + { + "section": "", + "itemId": ".vertical-tabs__menu", + "itemName": "Tabs", + "itemIndex": 0, + "fields": + [ + {"fieldId": "a:contains(\"Other Metadata\")","fieldType": "button", "fieldValue" : true, "fieldDefault": ""} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + }, + { + "section": "", + "itemId": ".field--name-field-publish-date", + "itemName": "Publish Date", + "itemIndex": 0, + "fields": + [ + {"fieldId":".form-date","fieldType": "date", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0}, + {"fieldId":".form-time","fieldType": "time", "fieldValue": "yyyy-MM-dd HH:mm:ss", "offset": 60000, "fieldDefault": "", "fieldIndex": 0} + ], + "errors": ["Channel field is required.","Event Type field is required.","Type field is required."] + } + ], + "editedItems": + [ + { + "section": "Body", + "itemId": ".paragraph-type--html", + "itemName": "HTML", + "itemIndex": 1, + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + } + ], + "expected": + [ + { + "section": "article", + "itemId": ".page-title", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"page-title"}, + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h1"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Canceled:"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "This is a test event title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Date and Time\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"Registration Deadline\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h2:contains(\"Location\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-collection", + "expectedCount": 7 + }, + + + + + { + "section": "article", + "itemId": ".address-line1", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "109 TW Alexander Dr"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".address-line2", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "EPA Building"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".locality", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Durham"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".administrative-area", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "NC"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".postal-code", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "27709"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".country", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "United States"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Host\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Nature Conservancy"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "div:contains(\"Event Type\")", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Job Fair"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"first html in body section\")", + "expectedCount": 2 + }, + { + "section": "article", + "itemId": ".box__title", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Related Information"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__heading", + "expectedProperties": + [ + {"expectedPropertyName": "tagName", "expectedPropertyValue": "h2"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".usa-card__body", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Card 1 Body"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Let me google\")", + "expectedProperties": + [ + {"expectedPropertyName": "class", "expectedPropertyValue":"usa-button"}, + {"expectedPropertyName": "href", "expectedPropertyValue": "google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Let me google that!"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "h3:contains(\"main header title\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Search for stuff\")", + "expectedProperties": + [ + {"expectedPropertyName": "href", "expectedPropertyValue":"google.com"}, + {"expectedPropertyName": "textContent", "expectedPropertyValue": "Search for stuff"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": ".image-gallery__title", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slideshow title"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "figcaption", + "expectedProperties": + [ + {"expectedPropertyName": "textContent", "expectedPropertyValue": "main slide caption"} + ], + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "a:contains(\"Event Links\")", + "expectedCount": 1 + }, + { + "section": "article", + "itemId": "p:contains(\"second body html -new\")", + "expectedCount": 1 + } + ], + "expectedEdited": + [ + { + "section": "article", + "itemId": "p:contains(\"second body html -edited\")", + "expectedCount": 1 + } + ] +} \ No newline at end of file diff --git a/test/e2e/fixtures/revisions.json b/test/e2e/fixtures/revisions.json index 0e0dd63cf1..856077917a 100644 --- a/test/e2e/fixtures/revisions.json +++ b/test/e2e/fixtures/revisions.json @@ -7,25 +7,25 @@ "section": "", "itemId": ".field--name-field-wide-template", "itemName": "Use wide template", - "fields": [{"fieldName": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + "fields": [{"fieldId": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] }, { "section": "", "itemId": "[id=edit-advanced]", "itemName": "Revision Log", - "fields":[{"fieldName":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "This is the first creation of the page","fieldDefault": ""}] + "fields":[{"fieldId":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "This is the first creation of the page","fieldDefault": ""}] }, { "section": "", "itemId": ".field--name-title", "itemName": "Title", - "fields":[{"fieldName":"input","fieldType": "text","fieldValue": "Revisions Test","fieldDefault": ""}] + "fields":[{"fieldId":"input","fieldType": "text","fieldValue": "Revisions Test","fieldDefault": ""}] }, { "section": "", "itemId": ".field--name-field-description", "itemName": "Description", - "fields":[{"fieldName":"[id=edit-field-description-0-value]","fieldType": "text", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", "fieldDefault": "" }] @@ -34,7 +34,7 @@ "section": "", "itemId": "[id=edit-field-channel-wrapper]", "itemName": "Channel", - "fields":[{"fieldName": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + "fields":[{"fieldId": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] }, { @@ -42,14 +42,14 @@ "itemId": ".field--name-field-keywords", "itemName": "Keywords", "fields":[ - {"fieldName": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""} + {"fieldId": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""} ] }, { "section": "", "itemId": ".field--name-field-type", "itemName":"Type", - "fields":[{"fieldName": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] + "fields":[{"fieldId": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] }, { @@ -59,10 +59,10 @@ "fields": [ { - "fieldName":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", "subFields":[ - {"fieldName":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, - {"fieldName":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} ] } ] @@ -72,10 +72,10 @@ "itemId": ".paragraph-type--card-group", "itemName": "Card Group", "fields":[ - {"fieldName":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, - {"fieldName":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, - {"fieldName":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, - {"fieldName":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} ] }, { @@ -83,16 +83,16 @@ "itemId": ".paragraph-type--header", "itemName": "Header", "fields":[ - {"fieldName": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}] + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}] }, { "section": "Body", "itemId": ".paragraph-type--link-list", "itemName": "Link List", "fields":[ - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} ] }, @@ -101,9 +101,9 @@ "itemId": ".paragraph-type--slideshow", "itemName": "Slideshow", "fields":[ - {"fieldName": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, - {"fieldName": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}] + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}] }, { @@ -111,7 +111,7 @@ "itemId": ".paragraph-type--dynamic-list", "itemName": "Dynamic List", "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""} ] }, { @@ -119,14 +119,14 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 0, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}] }, { "section": "Body", "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 1, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}] }, { @@ -134,7 +134,7 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 0, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first Sidebar html -new", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first Sidebar html -new", "fieldDefault": ""}] } ], "bulkPublishTest": @@ -143,25 +143,25 @@ "section": "", "itemId": ".field--name-field-wide-template", "itemName": "Use wide template", - "fields": [{"fieldName": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + "fields": [{"fieldId": "input", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] }, { "section": "", "itemId": "[id=edit-advanced]", "itemName": "Revision Log", - "fields":[{"fieldName":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "This is the first creation of the page","fieldDefault": ""}] + "fields":[{"fieldId":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "This is the first creation of the page","fieldDefault": ""}] }, { "section": "", "itemId": ".field--name-title", "itemName": "Title", - "fields":[{"fieldName":"input","fieldType": "text","fieldValue": "Bulk Publish Test","fieldDefault": ""}] + "fields":[{"fieldId":"input","fieldType": "text","fieldValue": "Bulk Publish Test","fieldDefault": ""}] }, { "section": "", "itemId": ".field--name-field-description", "itemName": "Description", - "fields":[{"fieldName":"[id=edit-field-description-0-value]","fieldType": "text", + "fields":[{"fieldId":"[id=edit-field-description-0-value]","fieldType": "text", "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", "fieldDefault": "" }] @@ -170,7 +170,7 @@ "section": "", "itemId": "[id=edit-field-channel-wrapper]", "itemName": "Channel", - "fields":[{"fieldName": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + "fields":[{"fieldId": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] }, { @@ -178,14 +178,14 @@ "itemId": ".field--name-field-keywords", "itemName": "Keywords", "fields":[ - {"fieldName": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""} + {"fieldId": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""} ] }, { "section": "", "itemId": ".field--name-field-type", "itemName":"Type", - "fields":[{"fieldName": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] + "fields":[{"fieldId": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] }, { @@ -195,10 +195,10 @@ "fields": [ { - "fieldName":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", + "fieldId":".button:visible","fieldType":"dialog","fieldIndex":1,"fieldDefault":"", "subFields":[ - {"fieldName":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, - {"fieldName":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} + {"fieldId":".form-radio","fieldType":"radio", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0}, + {"fieldId":"[value=\"Select reusable paragraph\"]","fieldType":"button", "fieldIndex": 0, "fieldValue" : true, "fieldDefault": 0} ] } ] @@ -208,10 +208,10 @@ "itemId": ".paragraph-type--card-group", "itemName": "Card Group", "fields":[ - {"fieldName":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, - {"fieldName":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, - {"fieldName":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, - {"fieldName":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} + {"fieldId":".form-text", "fieldType":"text","fieldIndex":0, "fieldValue":"Card 1","fieldDefault":""}, + {"fieldId":"iframe", "fieldType":"iframe","fieldValue":"Card 1 Body"}, + {"fieldId":".form-text", "fieldIndex": 1, "fieldType":"text","fieldValue" : "https://www.google.com/","fieldDefault":""}, + {"fieldId":".form-text", "fieldIndex": 2, "fieldType":"text","fieldValue":"Let me google that!","fieldDefault":""} ] }, { @@ -219,16 +219,16 @@ "itemId": ".paragraph-type--header", "itemName": "Header", "fields":[ - {"fieldName": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}] + {"fieldId": ".js-text-full","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main header title", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "h3", "fieldDefault": 0}] }, { "section": "Body", "itemId": ".paragraph-type--link-list", "itemName": "Link List", "fields":[ - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, - {"fieldName": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 1, "fieldValue" : "https://www.google.com/", "fieldDefault": ""}, + {"fieldId": "input:visible","fieldType": "text", "fieldIndex": 2, "fieldValue" : "Search for stuff", "fieldDefault": ""} ] }, @@ -237,9 +237,9 @@ "itemId": ".paragraph-type--slideshow", "itemName": "Slideshow", "fields":[ - {"fieldName": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, - {"fieldName": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, - {"fieldName":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}] + {"fieldId": ".form-text:visible","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slideshow title", "fieldDefault": ""}, + {"fieldId": "textarea","fieldType": "text", "fieldIndex": 0, "fieldValue" : "main slide caption", "fieldDefault": ""}, + {"fieldId":"select","fieldType":"select", "fieldIndex": 0, "fieldValue" : "Large", "fieldDefault": 0}] }, { @@ -247,7 +247,7 @@ "itemId": ".paragraph-type--dynamic-list", "itemName": "Dynamic List", "fields":[ - {"fieldName": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""} + {"fieldId": "select","fieldType": "select", "fieldIndex": 0, "fieldValue" : "Dynamic List: Perspectives", "fieldDefault": ""} ] }, { @@ -255,14 +255,14 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 0, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first html in body section", "fieldDefault": ""}] }, { "section": "Body", "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 1, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "second body html -new", "fieldDefault": ""}] }, { @@ -270,7 +270,7 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 0, - "fields":[{"fieldName": "iframe","fieldType": "iframe", "fieldValue" : "first Sidebar html -new", "fieldDefault": ""}] + "fields":[{"fieldId": "iframe","fieldType": "iframe", "fieldValue" : "first Sidebar html -new", "fieldDefault": ""}] } ], @@ -281,13 +281,13 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 1, - "fields": [{"fieldName": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "second body html -edited", "fieldDefault": ""}] }, { "section": "", "itemId": "[id=edit-advanced]", "itemName": "Revision Log", - "fields":[{"fieldName":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "Made an edit","fieldDefault": ""}] + "fields":[{"fieldId":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "Made an edit","fieldDefault": ""}] } ], @@ -298,13 +298,13 @@ "itemId": ".paragraph-type--html", "itemName": "HTML", "itemIndex": 1, - "fields": [{"fieldName": "iframe", "fieldType": "iframe", "fieldValue": "edit published", "fieldDefault": ""}] + "fields": [{"fieldId": "iframe", "fieldType": "iframe", "fieldValue": "edit published", "fieldDefault": ""}] }, { "section": "", "itemId": "[id=edit-advanced]", "itemName": "Revision Log", - "fields":[{"fieldName":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "Edit Published Page","fieldDefault": ""}] + "fields":[{"fieldId":"[id=edit-revision-log-0-value]","fieldType": "text","fieldValue": "Edit Published Page","fieldDefault": ""}] } ], diff --git a/test/e2e/fixtures/wysiwyg.json b/test/e2e/fixtures/wysiwyg.json index 93686d3cdc..7315d1c517 100644 --- a/test/e2e/fixtures/wysiwyg.json +++ b/test/e2e/fixtures/wysiwyg.json @@ -293,43 +293,43 @@ "tag": "table", "fields": [ { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 1, "fieldValue": 2 }, { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 3, "fieldValue": 3 }, { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 5, "fieldValue": 20 }, { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 7, "fieldValue": 30 }, { - "fieldName": "select", + "fieldId": "select", "fieldIndex": 0, "fieldValue": "Both", "fieldType": "select" }, { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 9, "fieldValue": "This is a caption" }, { - "fieldName": ".cke_dialog_ui_input_text:visible", + "fieldId": ".cke_dialog_ui_input_text:visible", "fieldIndex": 11, "fieldValue": "This is a summary" }, { - "fieldName": "a:contains(\"OK\")", + "fieldId": "a:contains(\"OK\")", "fieldType": "click" } ] @@ -342,17 +342,17 @@ "tag": "abbr", "fields": [ { - "fieldName": "input", + "fieldId": "input", "fieldIndex": 0, "fieldValue": "EPA" }, { - "fieldName": "input", + "fieldId": "input", "fieldIndex": 1, "fieldValue": "Environmental Protection Agency" }, { - "fieldName": "button:contains(\"Save\")", + "fieldId": "button:contains(\"Save\")", "fieldType": "click" } ] @@ -364,23 +364,23 @@ "tag": "a", "fields": [ { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 0, "fieldType": "click" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex":2, "fieldValue": "/node/148197/revisions/731523/view", "fieldType":"text" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex":3, "fieldValue": "this is a link" }, { - "fieldName": "button:contains(\"Save\")", + "fieldId": "button:contains(\"Save\")", "fieldType": "click" } ] @@ -392,11 +392,11 @@ "class": "cke_drupalanchor", "fields": [ { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldValue": "anchor test" }, { - "fieldName": ".cke_dialog_ui_button:contains(\"OK\")", + "fieldId": ".cke_dialog_ui_button:contains(\"OK\")", "fieldType": "click" } ] @@ -408,16 +408,16 @@ "tag": "drupal-inline-media", "fields": [ { - "fieldName": "a:contains(\"Audio\")", + "fieldId": "a:contains(\"Audio\")", "fieldType": "click" }, { - "fieldName": "Podcast:", + "fieldId": "Podcast:", "fieldValue": "", "fieldType": "media library item" }, { - "fieldName": "button:contains(\"Insert selected\")", + "fieldId": "button:contains(\"Insert selected\")", "fieldType": "click" } ] @@ -429,16 +429,16 @@ "tag": "drupal-media", "fields": [ { - "fieldName": "a:contains(\"Show Image media\")", + "fieldId": "a:contains(\"Show Image media\")", "fieldType": "click" }, { - "fieldName": "watershed", + "fieldId": "watershed", "fieldValue": "", "fieldType": "media library item" }, { - "fieldName": "button:contains(\"Insert selected\")", + "fieldId": "button:contains(\"Insert selected\")", "fieldType": "click" } ] @@ -451,27 +451,27 @@ "tag": "drupal-paragraph", "fields": [ { - "fieldName": "[value=\"Add Header\"]", + "fieldId": "[value=\"Add Header\"]", "fieldType": "click" }, { - "fieldName": ".js-text-full", + "fieldId": ".js-text-full", "fieldValue": "Paragraph Header Title", "fieldType": "text" }, { - "fieldName": "select", + "fieldId": "select", "fieldIndex": 0, "fieldValue": "H2", "fieldType": "select" },{ - "fieldName": "select", + "fieldId": "select", "fieldIndex": 1, "fieldValue": "Highlight", "fieldType": "select" }, { - "fieldName": "[value=\"Create and Place\"]", + "fieldId": "[value=\"Create and Place\"]", "fieldType": "click" } ] @@ -484,37 +484,37 @@ "class": "cke_iframe", "fields": [ { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 0, "fieldValue": "https://www.youtube-nocookie.com/embed/Y6chlLb59zA?rel=0" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 1, "fieldValue": "100" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 2, "fieldValue": "200" }, { - "fieldName": ".cke_dialog_ui_checkbox_input", + "fieldId": ".cke_dialog_ui_checkbox_input", "fieldValue": true, "fieldType": "checkbox" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 4, "fieldValue": "video name" }, { - "fieldName": "input:visible", + "fieldId": "input:visible", "fieldIndex": 5, "fieldValue": "video title" }, { - "fieldName": ".cke_dialog_ui_button:contains(\"OK\")", + "fieldId": ".cke_dialog_ui_button:contains(\"OK\")", "fieldType": "click" } ] @@ -526,7 +526,7 @@ "expectedCount": 1, "fields": [ { - "fieldName": "a:contains(\"β\")", + "fieldId": "a:contains(\"β\")", "fieldType": "click" } ] @@ -537,7 +537,7 @@ "section": "", "itemId": ".field--name-title", "itemName": "Title", - "fields": [{"fieldName": "input", "fieldType": "text", "fieldValue": "Wysiwyg", "fieldDefault": ""}] + "fields": [{"fieldId": "input", "fieldType": "text", "fieldValue": "Wysiwyg", "fieldDefault": ""}] }, { "section": "", @@ -545,7 +545,7 @@ "itemName": "Description", "fields": [ { - "fieldName": "[id=edit-field-description-0-value]", + "fieldId": "[id=edit-field-description-0-value]", "fieldType": "text", "fieldValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.", "fieldDefault": "" @@ -556,19 +556,19 @@ "section": "", "itemId": "[id=edit-field-channel-wrapper]", "itemName": "Channel", - "fields": [{"fieldName": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] + "fields": [{"fieldId": ".form-type-checkbox:contains(\"About EPA\")", "fieldValue": true, "fieldType": "checkbox", "fieldDefault": false}] }, { "section": "", "itemId": ".field--name-field-keywords", "itemName": "Keywords", - "fields": [{"fieldName": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""}] + "fields": [{"fieldId": "[id=edit-field-keywords-target-id]", "fieldType": "text", "fieldValue": "blood lead testing (331587), drupal (332750)", "fieldDefault": ""}] }, { "section": "", "itemId": ".field--name-field-type", "itemName": "Type", - "fields": [{"fieldName": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] + "fields": [{"fieldId": "[id=edit-field-type]", "fieldType": "select", "fieldValue": "News Release", "fieldDefault": 0}] } ], "expected": diff --git a/test/e2e/specs/performance/performance.cy.js b/test/e2e/specs/performance/performance.cy.js new file mode 100755 index 0000000000..97b8fe3063 --- /dev/null +++ b/test/e2e/specs/performance/performance.cy.js @@ -0,0 +1,79 @@ +// const tabName = Cypress.env('tabName'); +const filepath = Cypress.env('filepath'); +const inputFile = require('../../fixtures/performanceUrls full.json'); +const {testPageLoad, getTodayDate} = require('../../support/functions'); +const { + writeToFile, writeToXlsx, writeToFileAppend, +} = require('../../support/fileFunctions'); + +const commands = []; +let testAttributes; +const targetDate = getTodayDate('MM.DD.YYYY'); +const filename = `cypress/e2e/fixtures/timings_${targetDate}.txt`; + +before(() => { + writeToFile(filename, '{\n"records" : [\n'); +}); + +const sendTestTimings = () => { + if (!testAttributes) { return; } + + const attr = testAttributes; + testAttributes = null; + writeToFileAppend(filename, `{\n\"testName\":\"${attr.title}\",\n\"timings\":\n`); + writeToFileAppend(filename, attr.commands); + writeToFileAppend(filename, '\n},\n'); + cy.task('testTimings', attr); +}; + +beforeEach(sendTestTimings); + +after(() => { + cy.get('body').then(() => { + writeToFileAppend(filename, '{"testName":"End","timings":[{"name": "end",\n"started": 0,\n"endedAt": 0,\n"elapsed": 0}\n]\n}\n\n]\n}'); + }).then(() => { + sendTestTimings; + }).then(() => { + // readFile() + // writeToXlsx(filename) + }); +}); + +Cypress.on('test:before:run', () => { commands.length = 0; }); + +Cypress.on('test:after:run', (attributes) => { + /* eslint-disable no-console */ + console.log('Test "%s" has finished in %dms', attributes.title, attributes.duration); + console.table(commands); + testAttributes = { + title: attributes.title, + duration: attributes.duration, + commands: Cypress._.cloneDeep(commands), + }; +}); + +Cypress.on('command:start', (c) => { + commands.push({ + name: c.attributes.name, + started: +new Date(), + }); +}); + +Cypress.on('command:end', (c) => { + const lastCommand = commands[commands.length - 1]; + + if (lastCommand.name !== c.attributes.name) { throw new Error('Last command is wrong'); } + + lastCommand.endedAt = +new Date(); + lastCommand.elapsed = lastCommand.endedAt - lastCommand.started; +}); + +describe('Performance Tests', () => { + inputFile.urls.forEach((page) => { + describe(`Performance Tests for ${page.name} page`, () => { + it(`Page loads in a reasonable time frame -${page.url}`, () => { + testPageLoad(page.url, page.expectedLoadTime, commands); + }); + }); + }); +}); diff --git a/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js b/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js index cb9425f298..0a038260a2 100755 --- a/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js +++ b/test/e2e/specs/smoke/tc1.basic-page.errors.cy.js @@ -62,7 +62,7 @@ describe('TC1 - Basic Page: SuperUser', () => { itemIndex: 0, fields: [ { - fieldName: 'iframe', fieldType: 'iframe', fieldValue: 'first html in body section', fieldDefault: '', + fieldId: 'iframe', fieldType: 'iframe', fieldValue: 'first html in body section', fieldDefault: '', }, ], }, @@ -72,7 +72,7 @@ describe('TC1 - Basic Page: SuperUser', () => { itemName: 'Channel', fields: [ { - fieldName: '.form-type-checkbox:contains("About EPA")', fieldValue: true, fieldType: 'checkbox', fieldDefault: false, + fieldId: '.form-type-checkbox:contains("About EPA")', fieldValue: true, fieldType: 'checkbox', fieldDefault: false, }, ], }, diff --git a/test/e2e/specs/smoke/tc1.basic-page.new.cy.js b/test/e2e/specs/smoke/tc1.basic-page.new.cy.js index 6cce09ae1c..9462dd3dea 100755 --- a/test/e2e/specs/smoke/tc1.basic-page.new.cy.js +++ b/test/e2e/specs/smoke/tc1.basic-page.new.cy.js @@ -6,8 +6,6 @@ import { const formatFile = require('../../fixtures/basicPageNew.json'); -let pageTitle = 'old news'; - describe(formatFile.testCaseName, () => { Cypress.on('uncaught:exception', (_err, _runnable) => false); before(() => { @@ -16,7 +14,6 @@ describe(formatFile.testCaseName, () => { beforeEach(() => { cy.preserveAllCookiesOnce(); - cy.wrap(pageTitle).as('pageTitle'); }); it(`Add New ${formatFile.contentType}`, () => { @@ -53,15 +50,10 @@ describe(formatFile.testCaseName, () => { it('Save after entering all required information', () => { cy.get('body').then(() => { - cy.get('.field--name-title').find('input').then((titleField) => { - pageTitle = titleField.val().trim(); - cy.wrap(pageTitle).as('pageTitle'); - }); - }).then(() => { cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() .click({force: true}); }).then(() => { - cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been created.`); + cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been created.`); }); }); @@ -93,7 +85,7 @@ describe(formatFile.testCaseName, () => { }).then(() => { cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() .click(); - cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been updated.`); + cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been updated.`); verifyPageElements(formatFile.expectedEdited); }); }); @@ -123,8 +115,8 @@ describe(formatFile.testCaseName, () => { cy.get('body').then(() => { cy.get('a:contains("Group Dashboard"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); }); }); @@ -132,17 +124,17 @@ describe(formatFile.testCaseName, () => { cy.get('body').then(() => { cy.get('a:contains("Published Content"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); }); }); it('Clone the page', () => { cy.get('body').then(() => { - cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get(`a:contains("${formatFile.pageTitle}"):visible`).first().click(); cy.get('a:contains("Clone"):visible').first().click(); cy.get('[value="Clone"]').first().click(); }).then(() => { - cy.get('.usa-alert__text').should('contain.text', `The entity ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', `The entity ${formatFile.pageTitle}`); cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); verifyPageElements(formatFile.expected); @@ -164,8 +156,8 @@ describe(formatFile.testCaseName, () => { cy.get('body').then(() => { cy.get('a:contains("Group Dashboard"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); }); }); @@ -173,7 +165,7 @@ describe(formatFile.testCaseName, () => { cy.get('body').then(() => { cy.get('a:contains("Published Content"):visible').first().click(); }).then(() => { - cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).should('not.exist'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).should('not.exist'); }); }); @@ -181,7 +173,7 @@ describe(formatFile.testCaseName, () => { cy.get('body').then(() => { cy.get('a:contains("Latest Revisions")').click(); }).then(() => { - cy.get('.views-table').find('tbody').find('a:contains("pageTitle")').first() + cy.get('.views-table').find('tbody').find(`a:contains("${formatFile.pageTitle}")`).first() .click(); }).then(() => { verifyPageElements(formatFile.expected); diff --git a/test/e2e/specs/smoke/tc2.wysiwyg.cy.js b/test/e2e/specs/smoke/tc2.wysiwyg.cy.js index 409dd47b7e..a4c0c64153 100755 --- a/test/e2e/specs/smoke/tc2.wysiwyg.cy.js +++ b/test/e2e/specs/smoke/tc2.wysiwyg.cy.js @@ -1,6 +1,6 @@ import { addPageSection, - loginToDrupal, setFormatting, setPageFields, verifyFormatting, verifyPageElements, + loginToDrupal, setFormatting, setPageFields, verifyPageElements, } from '../../support/functions'; const formatFile = require('../../fixtures/wysiwyg.json'); @@ -16,7 +16,7 @@ const formatFile = require('../../fixtures/wysiwyg.json'); "fields": [ { - "fieldName": "Filter by Dictionary", "fieldValue": "", "fieldType": "select" + "fieldId": "Filter by Dictionary", "fieldValue": "", "fieldType": "select" } ] }, diff --git a/test/e2e/specs/smoke/tc7.form.cy.js b/test/e2e/specs/smoke/tc7.form.cy.js new file mode 100755 index 0000000000..189a3e1752 --- /dev/null +++ b/test/e2e/specs/smoke/tc7.form.cy.js @@ -0,0 +1,261 @@ +import { + addContent, + addPageSection, + duplicatePageSection, + editWebformElements, + getPageFields, getTodayDate, loginToDrupal, navigateToWebArea, setPageFields, setWebformFields, + verifyPageElements, verifyPageSource, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/formsNew.json'); + +describe(formatFile.testCaseName, () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + loginToDrupal('first'); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + }); + + it(`Add New ${formatFile.contentType}`, () => { + navigateToWebArea('Web Guide'); + addContent(formatFile.contentType); + }); + + it(`Add New ${formatFile.contentType} - defaults`, () => { + cy.get('.paragraphs-subform').should('have.length', 1); + cy.contains('a', 'Web Guide').should('exist'); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Add Item - ${currentItem.section} - ${currentItem.itemName}`, () => { + addPageSection(currentItem); + }); + + it(`Default Value - ${currentItem.section} - ${currentItem.itemName}`, () => { + getPageFields(currentItem); + }); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Set Fields - ${currentItem.section} - ${currentItem.itemName}`, () => { + setPageFields(currentItem); + }); + }); + + it('Duplicate HTML Section', () => { + duplicatePageSection('Body', '.paragraph-type--html'); + }); + + it('Save after entering all required information', () => { + cy.get('[data-drupal-selector="edit-actions"]').find('input').first().click(); + cy.get('.usa-alert').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been created.`); + }); + + it('Open webform editor', () => { + cy.get('p:contains("This webform has no elements added to it.")').should('exist'); + cy.get('a:contains("Please add elements to this webform.")').click(); + cy.get('a:contains("Add element")').should('exist'); + }); + + it('Add Elements to the form', () => { + editWebformElements(formatFile.webform); + }); + + it('Set State to Draft Approved State', () => { + cy.get('body').then(() => { + navigateToWebArea('Web Guide'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('a').first() + .click(); + }).then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Draft, approved'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Approved the draft'); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').first().click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + }); + }); + + it('View the webpage', () => { + cy.get('body').then(() => { + cy.get('a:contains("View"):visible').first().click(); + }).then(() => { + verifyPageElements(formatFile.expected); + }); + }); + + it(`Edit ${formatFile.contentType}`, () => { + cy.get('body').then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.wrap(formatFile.editedItems).each((currentEdit) => { + setPageFields(currentEdit); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + cy.get('.usa-alert').should('contain.text', `${formatFile.contentType} ${formatFile.pageTitle} has been updated.`); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Edit Webform', () => { + cy.get('body').then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.get('.form-item-webform-link').find('a').invoke('removeAttr', 'target').click(); + }).then(() => { + editWebformElements(formatFile.webformEdited); + }) + .then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + }) + .then(() => { + navigateToWebArea('Web Guide'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('a').first() + .click(); + }) + .then(() => { + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Verify Dates in Page Source', () => { + verifyPageSource('DC.date.created', getTodayDate('yyyy-MM-dd')); + verifyPageSource('DC.date.modified', getTodayDate('yyyy-MM-dd')); + verifyPageSource('DC.date.reviewed', getTodayDate('yyyy-MM-dd'), (60000 * 60 * 24 * 90)); + }); + + it('Submit form without entering required fields', () => { + cy.get('.webform-button--submit').click(); + cy.get('.usa-alert--error').should('contain.text', 'This is a checkbox field is required.'); + cy.get('.usa-alert--error').should('contain.text', 'First field is required.'); + cy.get('.usa-alert--error').should('contain.text', 'Middle field is required.'); + cy.get('.usa-alert--error').should('contain.text', 'Last field is required.'); + }); + + it('Submit form after entering required fields', () => { + cy.get('.form-item--checkbox:contains("This is a checkbox")').check(); + cy.get('.field--type-webform').find('.form-item--textfield:contains("First")').type('John'); + cy.get('.field--type-webform').find('.form-item--textfield:contains("Middle")').type('Jacob Jingleheimer'); + cy.get('.field--type-webform').find('.form-item--textfield:contains("Last")').type('Smith'); + cy.get('.webform-button--submit').click(); + cy.get('.webform-confirmation__message').should('contain.text', 'Thank you for contacting us.'); + }); + + it('Verify form submission', () => { + cy.get('body').then(() => { + cy.get('a:contains("Back to form")').click(); + navigateToWebArea('Web Guide'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('a').first() + .click(); + }).then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.get('.form-item-webform-link').find('a').invoke('removeAttr', 'target').click(); + cy.get('a:contains("Results")').click(); + }) + .then(() => { + + + /* +All submissions (if any) will be visible +*/ + }); + }); + + + it('Publish the page', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Published'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Published the page'); + cy.get('[id=edit-workflow-508-compliant]').check({force: true}); + }).then(() => { + cy.get('.box').find('[data-drupal-selector="edit-submit"]').first().click(); + cy.get('.usa-alert').should('contain.text', 'The moderation state has been updated.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Published'); + }); + }); + + it('Revisions tab shows the latest revision as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Currently published revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + }); + }); + + it('Published Content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + }); + }); + + it('Clone the page', () => { + cy.get('body').then(() => { + cy.get(`a:contains("${formatFile.pageTitle}"):visible`).first().click(); + cy.get('a:contains("Clone"):visible').first().click(); + cy.get('[value="Clone"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The entity ${formatFile.pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + + it('Cloned page shows on Latest Revisions tab', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Current revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the cloned page as Draft', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + }); + }); + + it('Published Content tab does not show the cloned page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${formatFile.pageTitle}")`).should('not.exist'); + }); + }); + + it('Return to View Page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Latest Revisions")').click(); + }).then(() => { + cy.get('.views-table').find('tbody').find(`a:contains("${formatFile.pageTitle}")`).first() + .click(); + }).then(() => { + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); +}); diff --git a/test/e2e/specs/smoke/tc7.form.errors.cy.js b/test/e2e/specs/smoke/tc7.form.errors.cy.js new file mode 100755 index 0000000000..98d0850b3f --- /dev/null +++ b/test/e2e/specs/smoke/tc7.form.errors.cy.js @@ -0,0 +1,66 @@ +import { + addPageSection, + findStringInArray, + getErrorMessages, loginToDrupal, removePageSection, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/formsNew.json'); + +describe('TC6 - Events - errors', () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + cy.get('body').then(() => { + loginToDrupal('first'); + }).then(() => { + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + }).then(() => { + cy.contains('a', 'Add new content').click(); + }) + .then(() => { + cy.get('.admin-list').contains('a', 'Event').click(); + }) + .then(() => { + cy.get('.page-title').should('contain.text', 'Add Web Area: Group node (Event)'); + }); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`${currentItem.section} - ${currentItem.itemName} - Saving without required information shows errors`, () => { + cy.get('body').then(() => { + addPageSection(currentItem); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + }) + .then(() => { + const errors = []; + cy.task('log', `expected: ${JSON.stringify(currentItem.errors)} - actual: ${JSON.stringify(getErrorMessages())}`); + + cy.wrap(currentItem.errors).each((currentError) => { + if (!findStringInArray(getErrorMessages(), currentError)) { + errors.push(currentError); + } + }); + cy.task('log', `errors: ${JSON.stringify(errors)}`); + cy.wrap(errors).should('have.length', 0); + cy.wrap(getErrorMessages()).should('have.length', currentItem.errors.length); + }); + }); + + it(`${currentItem.section} - ${currentItem.itemName} - Remove the section`, () => { + removePageSection(currentItem); + }); + }); + + it('Description only allows 256 characters', () => { + cy.get('body').then(() => { + cy.get('.field--name-field-description').find('textarea').type('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. {enter} Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec.'); + }).then(() => { + cy.get('[id=edit-field-description-0-value]').should('have.value', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Purus gravida quis blandit turpis cursus in. \n Placerat in egestas erat imperdiet. Nisl purus in mollis nunc sed id. Odio aenean sed'); + }); + }); +}); From 2b480eff4a810a489184f14ffe832aeb0a0b16e9 Mon Sep 17 00:00:00 2001 From: Brandon Bruce Date: Thu, 15 Feb 2024 16:34:53 -0500 Subject: [PATCH 5/9] added unfinished files --- .../unfinished/tc10.public-notices.cy.js | 249 ++++++++++++++++++ .../specs/unfinished/tc11.regulations.cy.js | 240 +++++++++++++++++ .../unfinished/tc12.web-area-homepage.cy.js | 63 +++++ test/e2e/specs/unfinished/tc13.specials.cy.js | 44 ++++ .../specs/unfinished/tc14.perspectives.cy.js | 52 ++++ test/e2e/specs/unfinished/tc15.admin.cy.js | 89 +++++++ test/e2e/specs/unfinished/tc4.files.cy.js | 93 +++++++ .../unfinished/tc8.frequent-questions.cy.js | 239 +++++++++++++++++ .../specs/unfinished/tc9.news-releases.cy.js | 244 +++++++++++++++++ 9 files changed, 1313 insertions(+) create mode 100755 test/e2e/specs/unfinished/tc10.public-notices.cy.js create mode 100755 test/e2e/specs/unfinished/tc11.regulations.cy.js create mode 100755 test/e2e/specs/unfinished/tc12.web-area-homepage.cy.js create mode 100755 test/e2e/specs/unfinished/tc13.specials.cy.js create mode 100755 test/e2e/specs/unfinished/tc14.perspectives.cy.js create mode 100755 test/e2e/specs/unfinished/tc15.admin.cy.js create mode 100755 test/e2e/specs/unfinished/tc4.files.cy.js create mode 100755 test/e2e/specs/unfinished/tc8.frequent-questions.cy.js create mode 100755 test/e2e/specs/unfinished/tc9.news-releases.cy.js diff --git a/test/e2e/specs/unfinished/tc10.public-notices.cy.js b/test/e2e/specs/unfinished/tc10.public-notices.cy.js new file mode 100755 index 0000000000..0a5bde62f4 --- /dev/null +++ b/test/e2e/specs/unfinished/tc10.public-notices.cy.js @@ -0,0 +1,249 @@ +import { + addPageSection, + duplicatePageSection, + getPageFields, getTodayDate, loginToDrupal, setPageFields, verifyPageElements, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/eventsNew.json'); + +let pageTitle = 'old news'; + +describe('TC6 - Events', () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + loginToDrupal('first'); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + cy.wrap(pageTitle).as('pageTitle'); + }); + + it(`Add New ${formatFile.contentType}`, () => { + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + cy.contains('a', 'Add new content').click(); + cy.get('.admin-list').contains('a', formatFile.contentType).click(); + cy.get('.page-title').should('contain.text', `Add Web Area: Group node (${formatFile.contentType})`); + }); + + it(`Add New ${formatFile.contentType} - defaults`, () => { + cy.get('.paragraphs-subform').should('have.length', 1); + cy.contains('a', 'Web Guide').should('exist'); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Add Item - ${currentItem.section} - ${currentItem.itemName}`, () => { + addPageSection(currentItem); + }); + + it(`Default Value - ${currentItem.section} - ${currentItem.itemName}`, () => { + getPageFields(currentItem); + }); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Set Fields - ${currentItem.section} - ${currentItem.itemName}`, () => { + setPageFields(currentItem); + }); + }); + + it('Duplicate HTML Section', () => { + duplicatePageSection('Body', '.paragraph-type--html', 0); + }); + + it('Save after entering all required information', () => { + cy.get('body').then(() => { + cy.get('.field--name-title').find('input').then((titleField) => { + // pageTitle = titleField.val().trim(); + pageTitle = 'This is a test event title'; + cy.wrap(pageTitle).as('pageTitle'); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click({force: true}); + }).then(() => { + cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been created.`); + }); + }); + + it('Set State to Draft Approved State', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Draft, approved'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Approved the draft'); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + }); + }); + + it('View the webpage', () => { + cy.get('body').then(() => { + cy.get('a:contains("View"):visible').first().click(); + }).then(() => { + verifyPageElements(formatFile.expected); + }); + }); + + it(`Edit ${formatFile.contentType}`, () => { + cy.get('body').then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.wrap(formatFile.editedItems).each((currentEdit) => { + setPageFields(currentEdit); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been updated.`); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Publish the page', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Published'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Published the page'); + cy.get('[id=edit-workflow-508-compliant]').check({force: true}); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Published'); + }); + }); + + it('Revisions tab shows the latest revision as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Currently published revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + }); + }); + + it('Published Content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + }); + }); + + it('Clone the page', () => { + cy.get('body').then(() => { + cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get('a:contains("Clone"):visible').first().click(); + cy.get('[value="Clone"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The entity ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + + it('Cloned page shows on Latest Revisions tab', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Current revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the cloned page as Draft', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + }); + }); + + it('Published Content tab does not show the cloned page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).should('not.exist'); + }); + }); + + it('Return to View Page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Latest Revisions")').click(); + }).then(() => { + cy.get('.views-table').find('tbody').find('a').each((currentLink) => { + if (currentLink.text().toLowerCase() === pageTitle.toLowerCase()) { + cy.wrap(currentLink).click(); + return false; + } + }); + }).then(() => { + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); +}); + + +/* + """All filled out metadata is available in source, including all date metadata (DC.date.modified, DC.date.created, and DC.date.reviewed). + DC.date.reviewed date is 90 days later than DC.date.modified. + +DC.type metadata defaults to Announcements and Schedules""" + +Find and cancel a test event that you created. "Canceled" checkbox is displayed between the Date and Registration Deadline fields. +Selecting checkbox adds "Canceled:" to the left of the Event title + +Find and delete a test event that you created. users can delete events that they created. +*/ + +/* + """All filled out metadata is available in source, including all date metadata (DC.date.modified, DC.date.created, and DC.date.reviewed). + DC.date.reviewed date is 90 days later than DC.date.modified. + +DC.type metadata defaults to Announcements and Schedules""" + +Find and cancel a test event that you created. "Canceled" checkbox is displayed between the Date and Registration Deadline fields. +Selecting checkbox adds "Canceled:" to the left of the Event title + +Find and delete a test event that you created. users can delete events that they created. +*/ + +/* + In selected Web area, click Create Content and select Public Notices Create Public Notice screen opens. Web area field defaults to current selection + Add Title is required + Add Publication Date Can input manually date or with the calendar button + Add content to Summary of Proposed Action Content can be input and is visible on view/save. + Select Programs or Statutes from dropdown list Select one or more statutes. Cannot select None. + Add Name and Address to Applicants or Respondents field + Select Proposed Actions from dropdown list Can select from list, add multiple items + Select State or Territory from dropdown list Can choose from international regions, United states or manually input an " Other" location + Add Docket Numbers Can input Docket numbers separated by comma and supporting links + add FR Citations Can input FR citations separated by comma and supporting links + Add Permit Number Can input Permit number + Add Comments Due Date Input date manually or with the calendar button. + Add Comments Extension Date Input date manually or with the calendar button. + Fill out email, phone, and mail in the How to Comment Information appears in the how to comment box upon save + Add media Media Library opens and the user can select or add media such as PDF and or video to the public notice + Add hub links if required Used for easy navigations throught the EPA Webiste (visible at the top of the page after saving) + Fill out description, type, etc in primary metadata Metadata output into HTML source on publication. + Save page Page is saved and you're directed to view page. + View page Content is visible, styles are rendered correctly and look good in Google Chrome and OK in IE + Publish Prompted to enter log message for state change and verify Section 508 compliance. Page is published. Log message is visible in revisions tab. State/status on View tab, Revisions tab, and Content tab has changed to published. + View Revisions Tab "All revisions are listed in reverse chronological order. + + Uses TC - 3: steps 2-6 to test revisions of this page" + Review source code of published page. Note, you must be looking at the published revision, meaning the URL is the alias. All filled out metadata is available in source, including all date metadata (reviewed, modified, created). Date metadata matches type metadata. + Go to Content tab on web area dashboard. Find and delete a test Public notice that you created. Users can delete Public Notice that they created. + */ diff --git a/test/e2e/specs/unfinished/tc11.regulations.cy.js b/test/e2e/specs/unfinished/tc11.regulations.cy.js new file mode 100755 index 0000000000..c95562bc78 --- /dev/null +++ b/test/e2e/specs/unfinished/tc11.regulations.cy.js @@ -0,0 +1,240 @@ +import { + addPageSection, + duplicatePageSection, + getPageFields, getTodayDate, loginToDrupal, setPageFields, verifyPageElements, +} from '../../support/functions'; + +const formatFile = require('../../fixtures/regulationNew.json'); + +let pageTitle = 'old news'; + +describe('TC6 - Regulations', () => { + Cypress.on('uncaught:exception', (_err, _runnable) => false); + before(() => { + loginToDrupal('first'); + }); + + beforeEach(() => { + cy.preserveAllCookiesOnce(); + cy.wrap(pageTitle).as('pageTitle'); + }); + + it(`Add New ${formatFile.contentType}`, () => { + cy.get('.block:contains("My Web Areas")').find('a:contains("Web Guide"):visible').first().click(); + cy.contains('a', 'Add new content').click(); + cy.get('.admin-list').contains('a', formatFile.contentType).click(); + cy.get('.page-title').should('contain.text', `Add Web Area: Group node (${formatFile.contentType})`); + }); + + it(`Add New ${formatFile.contentType} - defaults`, () => { + cy.get('.paragraphs-subform').should('have.length', 1); + cy.contains('a', 'Web Guide').should('exist'); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Add Item - ${currentItem.section} - ${currentItem.itemName}`, () => { + addPageSection(currentItem); + }); + + it(`Default Value - ${currentItem.section} - ${currentItem.itemName}`, () => { + getPageFields(currentItem); + }); + }); + + formatFile.formatItems.forEach((currentItem) => { + it(`Set Fields - ${currentItem.section} - ${currentItem.itemName}`, () => { + setPageFields(currentItem); + }); + }); + + it('Duplicate HTML Section', () => { + duplicatePageSection('Body', '.paragraph-type--html', 0); + }); + + it('Save after entering all required information', () => { + cy.get('body').then(() => { + cy.get('.field--name-title').find('input').then((titleField) => { + // pageTitle = titleField.val().trim(); + pageTitle = 'This is a test Regulation title'; + cy.wrap(pageTitle).as('pageTitle'); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click({force: true}); + }).then(() => { + cy.get('.usa-alert--success').find('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been created.`); + }); + }); + + it('Set State to Draft Approved State', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Draft, approved'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Approved the draft'); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + }); + }); + + it('View the webpage', () => { + cy.get('body').then(() => { + cy.get('a:contains("View"):visible').first().click(); + }).then(() => { + verifyPageElements(formatFile.expected); + }); + }); + + it(`Edit ${formatFile.contentType}`, () => { + cy.get('body').then(() => { + cy.get('a:contains("Edit"):visible').first().click(); + }).then(() => { + cy.wrap(formatFile.editedItems).each((currentEdit) => { + setPageFields(currentEdit); + }); + }).then(() => { + cy.get('[data-drupal-selector="edit-actions"]').first().find('input').first() + .click(); + cy.get('.usa-alert__text').should('contain.text', `${formatFile.contentType} ${pageTitle} has been updated.`); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + it('Publish the page', () => { + cy.get('body').then(() => { + cy.get('[data-drupal-selector="edit-new-state"]').first().select('Published'); + cy.get('[data-drupal-selector="edit-revision-log"]').type('Published the page'); + cy.get('[id=edit-workflow-508-compliant]').check({force: true}); + }).then(() => { + cy.get('[data-drupal-selector="edit-submit"]').click(); + cy.get('.usa-alert__text').should('contain.text', 'The moderation state has been updated.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Published'); + }); + }); + + it('Revisions tab shows the latest revision as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Currently published revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Published'); + }); + }); + + it('Published Content tab shows the page as published', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Published'); + }); + }); + + it('Clone the page', () => { + cy.get('body').then(() => { + cy.get(`a:contains("${pageTitle}"):visible`).first().click(); + cy.get('a:contains("Clone"):visible').first().click(); + cy.get('[value="Clone"]').first().click(); + }).then(() => { + cy.get('.usa-alert__text').should('contain.text', `The entity ${pageTitle}`); + cy.get('.usa-alert__text').should('contain.text', 'of type node was cloned.'); + cy.get('.field--tight:contains("Moderation state")').should('contain.text', 'Draft'); + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); + + + it('Cloned page shows on Latest Revisions tab', () => { + cy.get('body').then(() => { + cy.get('a:contains("Revisions"):visible').first().click(); + }).then(() => { + cy.get('.diff-revisions').find('tr:contains("Latest revision")').should('have.length', 1); + cy.get('.diff-revisions').find('tr:contains("Current revision")').should('have.length', 1); + }); + }); + + it('Dashboard content tab shows the cloned page as Draft', () => { + cy.get('body').then(() => { + cy.get('a:contains("Group Dashboard"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state').should('contain.text', 'Draft'); + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).find('.views-field-moderation-state-1').should('contain.text', 'Draft'); + }); + }); + + it('Published Content tab does not show the cloned page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Published Content"):visible').first().click(); + }).then(() => { + cy.get('.views-table').find(`tr:contains("Cloned: ${pageTitle}")`).should('not.exist'); + }); + }); + + it('Return to View Page', () => { + cy.get('body').then(() => { + cy.get('a:contains("Latest Revisions")').click(); + }).then(() => { + cy.get('.views-table').find('tbody').find('a').each((currentLink) => { + if (currentLink.text().toLowerCase() === pageTitle.toLowerCase()) { + cy.wrap(currentLink).click(); + return false; + } + }); + }).then(() => { + verifyPageElements(formatFile.expected); + verifyPageElements(formatFile.expectedEdited); + }); + }); +}); + + +/* + """All filled out metadata is available in source, including all date metadata (DC.date.modified, DC.date.created, and DC.date.reviewed). + DC.date.reviewed date is 90 days later than DC.date.modified. + +DC.type metadata defaults to Announcements and Schedules""" + +Find and cancel a test event that you created. "Canceled" checkbox is displayed between the Date and Registration Deadline fields. +Selecting checkbox adds "Canceled:" to the left of the Event title + +Find and delete a test event that you created. users can delete events that they created. + + In selected Web area, click Create Content and select Regulation Create Regulation Page screen opens. + (As super admin, web area field will default to current selection.) +Add Regulation Title is required +Add Effective Date and End Date "Date can be selected from calendar or entered manually. Validates as mm-dd-yyyy +End date must be greater than start date." +Add content to Rule Summary, Rule History, Additional Resources and Compliance either by direct input or copy-and-paste WYSIWYG buttons. "Content can be input and is visible on the page. Rule Summary is a required field + +Chrome does not support paste with the wysiwyg editor - must use ctrl-v" +Add Primary Metadata. Add more than 256 characters to the Description metadata. "User inputs well-formatted metadata into the following fields: Description, Keywords, Channel, Type. + +Description is now limited to 256 characters. If you edit an existing page, and the description is more than 256 characters, you will be prompted to reduce the number. Keywords are no longer required. + +Metadata output into HTML source on publication." +Save and view page Content is visible, styles are rendered correctly and look good in Google Chrome and OK in IE 8. Contact Us links, hublinks (or sidebar), breadcrumbs (for MS) are visible. Code of Federal Regulations and Docket Number values are linked if a link was added. Internal menu links work. +"Edit draft and add additional entries for either Legal Authority, Federal Register Citiation, Code of Federal Regulations, Docket Number, and Effective Date. + +Save page." Able to add more than one item for each field. Items are visible after saving. +Select the Collapse button in one of the citation boxes. The box shrinks and the collapse button becomes the edit button +Select the three dots next to the collapse/edit button and select duplicate Another citation appears - with the same citation info +Use Remove option in drop-down next to collapse/edit button to remove items for Code of Federal Regulations, Docket Number, Legal Authority, and Federal Register Citation fields. "Item is removed. + +(Effective Date does not have a remove button)" +"Remove all data from the following optional fields: + +Legal Authority, Federal Register Citation, Code of Federal Regulations, Docket Number, and Effective Date. Save and check how the page looks." The system should not render the "Basic Information" right-side box or header. +Publish Prompted to enter log message for state change and verify Section 508 compliance. Page is published. Log message is visible in Revisions tab. State/status on View tab, Workflow tab, and Dashboard > Content tab has changed to published. Current revision is "published," all other revisions are draft. +Go to content tab on the web area group dashboard and select Latest Revisions You can filter by title, content type, author, and moderation state +Select your page and then one of the options from the Actions pull-down menu. (e.g. Set to Published) Page changed moderation state (e.g. published) depending on what action you selected. +Review source code of published page. Note, you must be looking at the published revision, meaning the URL is the alias. All filled out metadata is available in source, including all date metadata (reviewed, modified, created). Date metadata matches type metadata. + +*/ diff --git a/test/e2e/specs/unfinished/tc12.web-area-homepage.cy.js b/test/e2e/specs/unfinished/tc12.web-area-homepage.cy.js new file mode 100755 index 0000000000..208d989830 --- /dev/null +++ b/test/e2e/specs/unfinished/tc12.web-area-homepage.cy.js @@ -0,0 +1,63 @@ +/* eslint-disable no-undef */ +describe('Dashboard Downloads List page', () => +{ + before(() => + { + cy.visit('').then(()=> + { + cy.get('.navbarLinks',{timeout:60000}).contains('.nav-link','About').click() + }) + }) + + it('An external link icon is shown', () => + { + In selected Web area, click Create Content and select Web Area Homepage + Only system admins can create web area homepage, ask an admin to create a blank page for you + Add Title Is required + Remove banner Banner is removed + Add banner Banner slides will open and user will have option to add title, text, and image + Add banner title, text, image, remove image, add again, add alt text "Overlay will be visible when Banner image is added and saved. + + Images can be uploaded, removed, and replaced. image name is retained. For images, can use PNG, JPEG, GIF, JPG. + + Alternative Text is Required + + Text alternative is visible in the source code." + Add banner Slide The option to add another image will appear. If added the homepage banner will now be a slide show. + Add text to Body field Chrome does not support paste with the wysiwyg editor - must use ctrl-v + Save Should be prompted to fill in description in primary metadata + Add Primary Metadata. Add more than 256 characters to the Description metadata. "User inputs well-formatted metadata into the following fields: Description, Keywords, Channel, Type. + + Description is now limited to 256 characters. If you edit an existing page, and the description is more than 256 characters, you will be prompted to reduce the number. Keywords are no longer required. + + Metadata output into HTML source on publication." + Save again "Content is visible, styles are rendered correctly and look good in Google Chrome and OK in IE 8. + + Layout options will be available" + Select the Layout tab Layout options will be available + Add section Will be prompted to choose layout and add an administration label (not required) + Add Block > Custom block > Paragraph > Add Paragraph Type Box "Title of the block is required - Display title can be checked or unchecked. If unchecked title will not show when you view the page. + + Can add a box title and a header image. Can Add HTML to the box content. + + Can add footer link + + Can select Box Style" + Save layout All changes will appear in the view tab + Search the Homepage by filtering Filter content on the Web Areas Dash board using the "content type" filter + Select edit then select the layout tab Can edit different fields by selecting on the pencil icon, after clicking on the pencil icon, select the configure option + Select the pencil icon > Move Will be given the option to move the blocks to different regions on the page + Save the page by selecting the "Save layout" button Page is saved and you're directed to view page. + View page Content (except content in aside block) is visible, styles are rendered correctly and look good in Google Chrome and OK in IE + Publish Prompted to enter log message for state change and verify Section 508 compliance. Page is published. Log message is visible in revisions tab. State/status on View tab, Workflow tab, and Dashboard > Content tab has changed to published. + View Revisions Tab "All revisions are listed in reverse chronological order. + + Uses TC - 3: steps 2-6 to test revisions of this page" + Review source code of published page. Note, you must be looking at the published revision, meaning the URL is the alias. All filled out metadata is available in source, including all date metadata (reviewed, modified, created). Date metadata matches type metadata. + "Use the clone tab to clone a page. + + You can only clone the current revision." All content (page content, panelizer content, metadata, etc.) is present in the cloned page. + Go to content tab on the web area group dashboard and select Latest Revisions Cloned page appears in list on Content > Latest Revisions tab + Select your page and then one of the options from the Actions pull-down menu. (e.g. Set to Published) Page changed moderation state (e.g. published) depending on what action you selected. + +}) diff --git a/test/e2e/specs/unfinished/tc13.specials.cy.js b/test/e2e/specs/unfinished/tc13.specials.cy.js new file mode 100755 index 0000000000..d9e42a5125 --- /dev/null +++ b/test/e2e/specs/unfinished/tc13.specials.cy.js @@ -0,0 +1,44 @@ +/* eslint-disable no-undef */ +describe('Dashboard Downloads List page', () => +{ + before(() => + { + cy.visit('').then(()=> + { + cy.get('.navbarLinks',{timeout:60000}).contains('.nav-link','About').click() + }) + }) + + it('An external link icon is shown', () => + { + + "Reduce screen size to approximate a smartphone and see if the content displays correctly. + +Use the webguide homepage. +" Boxes and pillbox links reflow and resize, becoming full width. +"Print a published page. + +Use the webguide home page or any long page with lots of images and boxes." Printed page should look moderately useful +Share dropdown is now available on all pages Share page with all four Social Media sites with no issues +Test shield - limited to advanced roles Publish a page. Ask Web CMS Support to shield the page. Check that the page is shielded. Shield a URL using directions at: http://www2.epa.gov/drupaltraining/forms/password-protection-external-review "You should be asked for a user id and password. user id: epa-reviewer +password: Shield-2017*01" +System Editor Role + + +As AU author, edit any content in their web area. All AUs can edit all content in their web area, EXCEPTING web form. Authors still cannot publish. +On a web area homepage, choose the group dashboard option. Select the Browse links option. Set options to Broken Links: yes, put 404 in the response code box. Leave the other fields at their defaults. You get a list of broken links with 404 response codes in the list. +Perform a search using the main EPA search box. You can see the text you type in and search results seem relevant to your terms. + +Publish page at a certain date and time You are able to do this +Pages are unpublished when sunset date is used You are able to do this + You are able to create each option + You are able to create an event with a map + + +Check this page: /node/148197/revisions/731523/view Page looks normal, particularly document dates after file attachments +Check this page: /node/63865/revisions/712209/view Page looks normal, particular "About the Data" box is full width + + + + +}) diff --git a/test/e2e/specs/unfinished/tc14.perspectives.cy.js b/test/e2e/specs/unfinished/tc14.perspectives.cy.js new file mode 100755 index 0000000000..f7e676ac57 --- /dev/null +++ b/test/e2e/specs/unfinished/tc14.perspectives.cy.js @@ -0,0 +1,52 @@ +describe('Dashboard Downloads List page', () => +{ + before(() => + { + cy.visit('').then(()=> + { + cy.get('.navbarLinks',{timeout:60000}).contains('.nav-link','About').click() + }) + }) + + it('An external link icon is shown', () => + { + In Perspectives Web area, click Create Content and select Perspective Create Perspective screen opens. Web area field defaults to current selection +Add title is required, has red * +Add Release Date is required, has red * Enter MM/DD/YYYY +Add content to Body, by direct input or copy-and-paste is required, has red * Chrome does not support paste with the wysiwyg editor - must use ctrl-v. +Add content to the Body field, is required, has red * +Add each paragrah type (from Add HTML dropdown) to the body section: link list, Box, Header, Dynamic List, Slideshow, from library (reusable paragraph), Card Group not required +Add Subjects "is required, has red * Select from dropdown menu: Adminsitrator, Agriculture, Air, Award and Recognition, Climate, Science matters. +This will appear as a link in the green box Related Info on the right-hand side of the page. +""Read other EPA Perspectives about [insert subject]""" +In Subjects: Add another item not required +Add Publishers not required +Add another item not required - can add a second Publisher +Add Author > Click Add existing Author, type in your name Add name Rudy, name is not in the system. +Click Add new Author Choose Add new Author, fields open to add Name, Image, Title/Position, Office, Biography +Fill in Author content "Name * required +Image - not required +If you add image, Alternative text required +Click Create Author button +Author field populates. +To remove author, or edit, click Edit Button, then click Edit to edit, or Remove to remove." +Title/Position, Office, Biography fields " + +Title/Position, Office field are limited to 240 characters. +Allowed HTML tags: <@ accesskey class data-date dir id lang style tabindex title name data>