itemengine-cypress-automation 1.0.379-highlight-flakiness-r2-fba67fd.0 → 1.0.380-IEI-5863-5864-97d3f1f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/BrowseItems/browseReviewItems.js +39 -7
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +0 -1
- package/cypress/e2e/ILC/ThinkSphere/createReviewItem.js +53 -0
- package/cypress/e2e/ILC/ThinkSphere/editTabBasicSection.js +52 -1
- package/cypress/e2e/ILC/ThinkSphere/equationEditorCreateCustomCategory.smoke.js +417 -0
- package/cypress/e2e/ILC/ThinkSphere/equationEditorEditCategoryFlyOut.js +289 -0
- package/cypress/e2e/ILC/ThinkSphere/planPhase.js +46 -4
- package/cypress/e2e/ILC/ThinkSphere/previewTabPlanSection.js +4 -4
- package/cypress/e2e/ILC/ThinkSphere/solvePhase.js +34 -1
- package/cypress/pages/components/browseItemsPage.js +109 -2
- package/cypress/pages/components/editCategoryFlyout.js +2 -2
- package/cypress/pages/essayResponsePage.js +1 -1
- package/cypress/pages/thinkSpherePage.js +321 -6
- package/package.json +1 -1
@@ -1,15 +1,19 @@
|
|
1
1
|
import utilities from "../support/helpers/utilities";
|
2
2
|
import { browseItemsPage } from "../pages/components/browseItemsPage";
|
3
|
+
import { editCategoryFlyout } from "../pages/components/editCategoryFlyout";
|
3
4
|
import { dialogBoxBase } from "../pages/dialogBoxBase";
|
4
|
-
import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout } from "./components"
|
5
|
+
import { backgroundImageUploadComponent, createQuestionBasePage, scoringSectionBaseEditTab, commonComponents, additionalSettingsPanel, additionalSettingsAccessibilitySectionComponent, toolSettingsComponent, questionInstructionsComponent, studentViewSettingsLabelComponent, defaultToolDropdown, essayResponseCommonComponents, equationEditorSectionCommonComponent, equationEditorFlyout, createCustomCategoryFlyout } from "./components"
|
5
6
|
import { drawingResponsePage } from "./drawingResponsePage";
|
6
7
|
import { optionsWrapperComponent } from "../pages/components/optionsWrapperComponent";
|
7
8
|
import { selectQuestionResourceToolPage } from "./selectQuestionResourceToolPage";
|
8
9
|
import { videoResponsePage } from "./videoResponsePage";
|
9
10
|
import { singleSelectionPage } from "./singleSelectionPage";
|
11
|
+
import { essayResponsePage } from "./essayResponsePage";
|
12
|
+
import { equationEditorCategoriesAndSymbols } from "../fixtures/equationEditorCategoriesAndSymbols ";
|
10
13
|
const css = Cypress.env('css');
|
11
14
|
|
12
15
|
const selectors = {
|
16
|
+
...essayResponsePage,
|
13
17
|
...backgroundImageUploadComponent,
|
14
18
|
...questionInstructionsComponent,
|
15
19
|
...commonComponents,
|
@@ -24,6 +28,10 @@ const selectors = {
|
|
24
28
|
...browseItemsPage,
|
25
29
|
...videoResponsePage,
|
26
30
|
...dialogBoxBase,
|
31
|
+
...editCategoryFlyout,
|
32
|
+
...createCustomCategoryFlyout,
|
33
|
+
...createQuestionBasePage,
|
34
|
+
|
27
35
|
editQuestionPencil: () => cy.get('[class*="Widgetstyles__HeaderContainer"] button.icon-pencil'),
|
28
36
|
widgetHeaderQuestionTitle: () => cy.get('[class*="Widgetstyles__HeaderContainer"] [class*="Widgetstyles__QuestionTypeText"]'),
|
29
37
|
imageUploadSection: () => cy.get('[class*="TabsComponentstyles__ImageUploadComponentWrapper"]'),
|
@@ -103,6 +111,7 @@ const selectors = {
|
|
103
111
|
addCheckMathQuestionButton: () => cy.get('.ngie-btn-typography').contains(`Add 'Check your math' question`),
|
104
112
|
firstAvailableItemLink: () => utilities.getNthElement(cy.get('.browse-item-styled-link'), 0),
|
105
113
|
saveButton: () => cy.get('.ngie-btn-typography').contains('save',{matchCase: false}),
|
114
|
+
cancelButton: () => cy.get('.ngie-btn-typography').contains('cancel',{matchCase: false}),
|
106
115
|
AddCheckMathQuestionHeader: () => cy.get('.browse-title-wrapper').contains(`Add 'Check your math' question`),
|
107
116
|
singleOptionTextFieldWrapper: () => cy.get('[class*="SingleOptionstyle__TextFieldWrapper"]'),
|
108
117
|
customizeStampComponent: () => cy.get('[class*="CustomizeStampstyles__CustomizeStampWrapper"]'),
|
@@ -127,7 +136,7 @@ const selectors = {
|
|
127
136
|
imageUploadSectionQuestionImageCrossIcon: () => thinkSpherePage.imageUploadSection().find('div[class*="QuestionImageComponentstyle__CrossIcon"]'),
|
128
137
|
imageRadioButtonParentSvg: () => thinkSpherePage.imageRadioButton().parent().find('svg'),
|
129
138
|
solvePhaseAccordionSvg: () => thinkSpherePage.solvePhaseAccordion().find('svg'),
|
130
|
-
|
139
|
+
customizeToolsAndControlsPath: () => thinkSpherePage.customizeToolsAndControls().find('path'),
|
131
140
|
solvePhaseToolsAndControlsOptionsTilesFeatherCheckIcon: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name="Icon feather-check"]'),
|
132
141
|
solvePhaseToolsAndControlsOptionsTilesRectangle: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('[data-name*="Rectangle"]'),
|
133
142
|
solvePhaseToolsAndControlsOptionsTilesDragItemFlexWrapperSvg: () => thinkSpherePage.solveToolsAndControlsOptionsTiles('Text').find('.drag-item-flex-wrapper svg'),
|
@@ -181,9 +190,32 @@ const selectors = {
|
|
181
190
|
gridItemsWrapper: (number) => cy.get('[class*="DragAndDropGridstyles__GridItemsWrapper"]').eq(number),
|
182
191
|
dragButton: (number) => cy.get('[type="button"]').eq(number),
|
183
192
|
customizeStampsButton: (customizeStampPosition) => cy.get(`button[aria-label="Stamp ${customizeStampPosition}"]`),
|
193
|
+
buttonSave: () => cy.get('.action-btn-wrapper button').eq(1),
|
194
|
+
buttonCancel: () => cy.get('.action-btn-wrapper button').eq(0),
|
195
|
+
nextGenThinkSphereCreateItemWrapper: () => cy.get('#nextgen-thinkshpere-create-item'),
|
196
|
+
equationEditorSectionTitle: () => cy.get('.equation-editor-text-title'),
|
197
|
+
referenceIdWrapper: () => cy.get('.edit-item-reference-id-wrapper'),
|
198
|
+
editBoxWrapper: () => cy.get('.edit-box-wrapper'),
|
199
|
+
editBoxText: () => cy.get('.edit-box-text'),
|
200
|
+
editBoxTextInput: () => thinkSpherePage.editBoxWrapper().find('input'),
|
201
|
+
editIconPencil: () => cy.get('.icon-pencil'),
|
202
|
+
thinkSphereQuestionHeader: () => cy.get('.edit-question-header-title'),
|
203
|
+
filterSectionQuestionTypesAccordion: () => cy.get('.filter-section-expansion-panel-summary-root'),
|
204
|
+
filterSectionQuestionAccordion: () => cy.get('.expansion-item-expansion-panel-summary-content'),
|
205
|
+
checkBox: () => cy.get('.MuiCheckbox-root'),
|
206
|
+
browseItemQuestionItem: () => cy.get('.browse-item-question-item'),
|
207
|
+
ErrorMessageContainer: () => cy.get('.ErrorMessageContainer'),
|
208
|
+
categoriesDropDown: () => cy.get('.dropdown-form-control[label="Categories"]'),
|
209
|
+
categoriesDropDownLabelText: () => cy.get('.dropdown-label-text'),
|
210
|
+
categoriesDropDownMenuItem: () => cy.get('.dropdown-menu-item .dropdown-label-text'),
|
211
|
+
categoriesDropDownParent: () => cy.get('.drop-down-parent'),
|
212
|
+
cardWrapper: () => cy.get('.card-wrapper'),
|
213
|
+
cardLabel: () => cy.get('.widget-card-label'),
|
214
|
+
thinkSphereQuestionInstructionCKEditor: () => cy.get('div.cke_editable[contenteditable="true"]'),
|
184
215
|
};
|
185
216
|
|
186
217
|
const steps = {
|
218
|
+
...essayResponsePage.steps,
|
187
219
|
...backgroundImageUploadComponent.steps,
|
188
220
|
...questionInstructionsComponent.steps,
|
189
221
|
...scoringSectionBaseEditTab.steps,
|
@@ -200,6 +232,7 @@ const steps = {
|
|
200
232
|
...browseItemsPage.steps,
|
201
233
|
...videoResponsePage.steps,
|
202
234
|
...createQuestionBasePage.steps,
|
235
|
+
...createCustomCategoryFlyout.steps,
|
203
236
|
|
204
237
|
/**
|
205
238
|
* Navigates to the ThinkSphere create question page.
|
@@ -271,12 +304,24 @@ const steps = {
|
|
271
304
|
cy.wait('@setItem');
|
272
305
|
},
|
273
306
|
|
307
|
+
clickOnCancelButton: () => {
|
308
|
+
cy.interceptGraphql('setItem');
|
309
|
+
thinkSpherePage.cancelButton()
|
310
|
+
.click();
|
311
|
+
},
|
312
|
+
|
274
313
|
clickOnSwapButton: () => {
|
275
314
|
thinkSpherePage.ThinkSphereMathQuestionHeaderSwapIcon()
|
276
315
|
.click();
|
277
316
|
cy.wait(2000);
|
278
317
|
},
|
279
318
|
|
319
|
+
clickOnEditButton: () => {
|
320
|
+
thinkSpherePage.ThinkSphereMathQuestionHeaderPencilIcon()
|
321
|
+
.click();
|
322
|
+
cy.wait(2000);
|
323
|
+
},
|
324
|
+
|
280
325
|
clickOnDeleteButton: () => {
|
281
326
|
thinkSpherePage.thinkSphereMathQuestionHeaderDeleteIcon()
|
282
327
|
.click();
|
@@ -543,7 +588,8 @@ const steps = {
|
|
543
588
|
.click();
|
544
589
|
} else {
|
545
590
|
thinkSpherePage.planSentenceStarterAddItemButton()
|
546
|
-
.click()
|
591
|
+
.click()
|
592
|
+
.trigger('mouseout', { force: true });
|
547
593
|
}
|
548
594
|
},
|
549
595
|
|
@@ -855,9 +901,213 @@ const steps = {
|
|
855
901
|
verifyCustomizeStampSelectedUnselected: (selected, customizeStampPosition) => {
|
856
902
|
utilities.verifyElementAttribute(thinkSpherePage.customizeStampsButton(customizeStampPosition), 'aria-checked', selected ? 'true' : 'false');
|
857
903
|
},
|
904
|
+
|
905
|
+
saveCustomCategory: () => {
|
906
|
+
thinkSpherePage.buttonSave()
|
907
|
+
.click();
|
908
|
+
},
|
909
|
+
|
910
|
+
cancelCustomCategory: () => {
|
911
|
+
thinkSpherePage.buttonCancel()
|
912
|
+
.click();
|
913
|
+
},
|
914
|
+
|
915
|
+
createCustomCategoryWithMultipleCategoryCharacters: () => {
|
916
|
+
cy.log('Creating a custom category by selecting \'Keypad\' category, partially selecting \'Basic\' and \'Greek\' categories')
|
917
|
+
createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
|
918
|
+
createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['primary'].displayName}`);
|
919
|
+
cy.wait(2000);
|
920
|
+
createCustomCategoryFlyout.steps.verifyPartiallyCheckedStateOfCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['matrices'].displayName}`);
|
921
|
+
createCustomCategoryFlyout.steps.expandCategoryAccordion(`Greek Symbols`);
|
922
|
+
createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.gamma.ariaLabel}`);
|
923
|
+
createCustomCategoryFlyout.steps.selectASymbolInCreateCustomCategoryFlyout(`${equationEditorCategoriesAndSymbols['greek'].displayName}`, `${equationEditorCategoriesAndSymbols.greek.symbols.delta.ariaLabel}`);
|
924
|
+
createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name.');
|
925
|
+
thinkSpherePage.steps.saveCustomCategory();
|
926
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'notExist');
|
927
|
+
},
|
928
|
+
|
929
|
+
createCustomCategoryWithNameAndIcon: () => {
|
930
|
+
cy.log('Creating a category by selecting \'Arrows\' category')
|
931
|
+
createCustomCategoryFlyout.steps.openCreateCustomCategoryFlyout();
|
932
|
+
createCustomCategoryFlyout.steps.checkCategoryAccordionCheckbox(`${equationEditorCategoriesAndSymbols['geo'].displayName}`);
|
933
|
+
createCustomCategoryFlyout.steps.addInputToCustomCategoryNameInputField('Custom category with name and icon.');
|
934
|
+
createCustomCategoryFlyout.steps.addInputToCategoryIconInputField('#');
|
935
|
+
thinkSpherePage.steps.saveCustomCategory();
|
936
|
+
},
|
937
|
+
|
938
|
+
verifyCategoryCharactersAndUnSelectedState: (arrayOfSymbolsAriaLabel) => {
|
939
|
+
thinkSpherePage.categoryCharacters()
|
940
|
+
.then(($symbols) => {
|
941
|
+
for (let index = 10; index < $symbols.length - 1; index++) {
|
942
|
+
editCategoryFlyout.categoryCharacters()
|
943
|
+
.eq(index)
|
944
|
+
.should('not.have.class', 'Mui-selected')
|
945
|
+
.invoke('attr', 'aria-label')
|
946
|
+
.then((ariaLabel) => {
|
947
|
+
const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
|
948
|
+
editCategoryFlyout.categoryCharacters()
|
949
|
+
.eq(index)
|
950
|
+
.verifyTooltip(tooltipText);
|
951
|
+
});
|
952
|
+
}
|
953
|
+
});
|
954
|
+
},
|
955
|
+
|
956
|
+
verifyCategoryCharactersAndSelectedState: (arrayOfSymbolsAriaLabel) => {
|
957
|
+
editCategoryFlyout.categoryCharacters()
|
958
|
+
.then(($symbols) => {
|
959
|
+
for (let index = 0; index < arrayOfSymbolsAriaLabel.length - 1; index++) {
|
960
|
+
editCategoryFlyout.categoryCharacters()
|
961
|
+
.eq(index)
|
962
|
+
.should('have.class', 'Mui-selected')
|
963
|
+
.invoke('attr', 'aria-label')
|
964
|
+
.then((ariaLabel) => {
|
965
|
+
const tooltipText = ariaLabel.split(' ').slice(0, -1).join(' ');
|
966
|
+
editCategoryFlyout.categoryCharacters()
|
967
|
+
.eq(index)
|
968
|
+
.verifyTooltip(tooltipText);
|
969
|
+
});
|
970
|
+
}
|
971
|
+
});
|
972
|
+
},
|
973
|
+
|
974
|
+
expandDropdown: () => {
|
975
|
+
thinkSpherePage.categoriesDropDownParent()
|
976
|
+
.click();
|
977
|
+
},
|
978
|
+
|
979
|
+
verifyDropdownOptions: (dropDownListArray) => {
|
980
|
+
thinkSpherePage.categoriesDropDownMenuItem().should('have.length', dropDownListArray.length).each(($item) => {
|
981
|
+
cy.wrap($item)
|
982
|
+
.invoke('text')
|
983
|
+
.then((text) => {
|
984
|
+
const trimmedText = text.trim();
|
985
|
+
expect(dropDownListArray).to.include(trimmedText);
|
986
|
+
});
|
987
|
+
});
|
988
|
+
},
|
989
|
+
|
990
|
+
clickOnDropDownCategory: (index) => {
|
991
|
+
thinkSpherePage.categoriesDropDownMenuItem().eq(index).click();
|
992
|
+
},
|
993
|
+
|
994
|
+
clickOnQuestionTypesAccordion: () => {
|
995
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion()
|
996
|
+
.click()
|
997
|
+
},
|
998
|
+
|
999
|
+
typeInSearchBar: (input) => {
|
1000
|
+
thinkSpherePage.searchBar()
|
1001
|
+
.clear()
|
1002
|
+
.type(input)
|
1003
|
+
.should('have.value', input);
|
1004
|
+
},
|
1005
|
+
|
1006
|
+
searchInSearchBar: (input) => {
|
1007
|
+
thinkSpherePage.searchBar()
|
1008
|
+
.clear()
|
1009
|
+
.type(input)
|
1010
|
+
.should('have.value', input)
|
1011
|
+
.type('{enter}');
|
1012
|
+
},
|
1013
|
+
|
1014
|
+
clickOnSolvePhaseAccordionIcon: (element) => {
|
1015
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon()
|
1016
|
+
.click();
|
1017
|
+
},
|
1018
|
+
|
1019
|
+
verifyElementDoesNotHaveExpandedClass: (element) => {
|
1020
|
+
element.should('not.have.class', 'Mui-expanded');
|
1021
|
+
},
|
1022
|
+
|
1023
|
+
verifyElementDoesNotHaveCheckedClass: (element) => {
|
1024
|
+
element.should('not.have.class', 'Mui-checked');
|
1025
|
+
},
|
1026
|
+
|
1027
|
+
verifyThinkSphereSearchBarPlaceholder: () => {
|
1028
|
+
thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by title, tags and content');
|
1029
|
+
},
|
1030
|
+
|
1031
|
+
verifyReviewItemSearchBarPlaceholder: () => {
|
1032
|
+
thinkSpherePage.searchBar().should('have.attr', 'placeholder', 'Search by question type');
|
1033
|
+
},
|
1034
|
+
|
1035
|
+
verifyEquationEditorSectionCategoryNotPressed: () => {
|
1036
|
+
thinkSpherePage.equationEditorSectionCategories().eq(1).should('have.attr', 'data-aria-pressed', 'false');
|
1037
|
+
},
|
1038
|
+
|
1039
|
+
verifyEquationEditorSectionCategoryIsPressed: () => {
|
1040
|
+
thinkSpherePage.equationEditorSectionCategories().eq(10).should('have.attr', 'data-aria-pressed', 'true');
|
1041
|
+
},
|
1042
|
+
|
1043
|
+
verifyTypeCheckBoxStrategy: () => {
|
1044
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
|
1045
|
+
.find('input').should('have.attr', 'type', 'checkbox');
|
1046
|
+
},
|
1047
|
+
|
1048
|
+
verifyTypeCheckBoxSentenceStarter: () => {
|
1049
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
|
1050
|
+
.find('input').should('have.attr', 'type', 'checkbox');
|
1051
|
+
},
|
1052
|
+
|
1053
|
+
verifyStrategyCheckBoxNotChecked: () => {
|
1054
|
+
utilities.getNthElement(thinkSpherePage.planStrategyCheckbox(), 5)
|
1055
|
+
.find('input').should('not.have.attr', 'checked');
|
1056
|
+
},
|
1057
|
+
|
1058
|
+
verifySentenceStrategyCheckBoxNotChecked: () => {
|
1059
|
+
utilities.getNthElement(thinkSpherePage.planSentenceStarterCheckbox(), 5)
|
1060
|
+
.find('input').should('not.have.attr', 'checked');
|
1061
|
+
},
|
1062
|
+
|
1063
|
+
verifyTextIsNotEmpty: (element) => {
|
1064
|
+
element.invoke('text')
|
1065
|
+
.should('not.be.empty');
|
1066
|
+
},
|
1067
|
+
|
1068
|
+
verifyLength: (element, length) => {
|
1069
|
+
element.should('have.length', length);
|
1070
|
+
},
|
1071
|
+
|
1072
|
+
verifyFilterSectionExpanded: () => {
|
1073
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion().should('have.class', 'Mui-expanded');
|
1074
|
+
},
|
1075
|
+
|
1076
|
+
verifyFilterSectionCollapsed: () => {
|
1077
|
+
thinkSpherePage.filterSectionQuestionTypesAccordion().should('not.have.class', 'Mui-expanded');
|
1078
|
+
},
|
1079
|
+
|
1080
|
+
verifySolvePhaseAccordionExpanded: () => {
|
1081
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon().should('have.class', 'Mui-expanded');
|
1082
|
+
},
|
1083
|
+
|
1084
|
+
verifySolvePhaseAccordionCollapsed: () => {
|
1085
|
+
thinkSpherePage.solvePhaseAccordionExpandIcon().should('not.have.class', 'Mui-expanded');
|
1086
|
+
},
|
1087
|
+
|
1088
|
+
addQuestionInstructionInnerHTML: (innerHTML) => {
|
1089
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
1090
|
+
.invoke('html', innerHTML);
|
1091
|
+
},
|
1092
|
+
|
1093
|
+
verifyQuestionInstructionIncreasedHeightAndScrollBar: () => {
|
1094
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
1095
|
+
.invoke('height') // Get the height of the element
|
1096
|
+
.should('be.gt', 198);
|
1097
|
+
|
1098
|
+
thinkSpherePage.thinkSphereQuestionInstructionCKEditor()
|
1099
|
+
.should(($el) => {
|
1100
|
+
const scrollWidth = $el[0].scrollWidth;
|
1101
|
+
const clientWidth = $el[0].clientWidth;
|
1102
|
+
|
1103
|
+
// Assert that horizontal scroll is present
|
1104
|
+
expect(scrollWidth).to.be.greaterThan(clientWidth);
|
1105
|
+
});
|
1106
|
+
},
|
858
1107
|
};
|
859
1108
|
|
860
1109
|
const tests = {
|
1110
|
+
...essayResponsePage.tests,
|
861
1111
|
...createQuestionBasePage.tests,
|
862
1112
|
...backgroundImageUploadComponent.tests,
|
863
1113
|
...questionInstructionsComponent.tests,
|
@@ -869,6 +1119,7 @@ const tests = {
|
|
869
1119
|
...studentViewSettingsLabelComponent.tests,
|
870
1120
|
...defaultToolDropdown.tests,
|
871
1121
|
...optionsWrapperComponent.tests,
|
1122
|
+
...equationEditorFlyout.tests,
|
872
1123
|
|
873
1124
|
/**
|
874
1125
|
* Verifies the ThinkSphere cancel button functionality.
|
@@ -1362,9 +1613,12 @@ const tests = {
|
|
1362
1613
|
it('When user clicks on \'Reset to default\' button then the sentence starter list should be reset to default', () => {
|
1363
1614
|
thinkSpherePage.planSentenceStarterListResetToDefault()
|
1364
1615
|
.click();
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1616
|
+
thinkSpherePage.planSentenceStarterSection()
|
1617
|
+
.within(() => {
|
1618
|
+
optionList.forEach((option, index) => {
|
1619
|
+
thinkSpherePage.steps.verifyOptionsContents(index, option, 'Enter sentence starter name');
|
1620
|
+
});
|
1621
|
+
})
|
1368
1622
|
});
|
1369
1623
|
}
|
1370
1624
|
},
|
@@ -1550,6 +1804,67 @@ const tests = {
|
|
1550
1804
|
cy.checkAccessibility(thinkSpherePage.singleOptionTextFieldWrapper());
|
1551
1805
|
});
|
1552
1806
|
},
|
1807
|
+
|
1808
|
+
verifyErrorMessageCSSAndA11y: () => {
|
1809
|
+
it('CSS of error message', { tags: 'css' }, () => {
|
1810
|
+
utilities.verifyCSS(commonComponents.errorMessage(), {
|
1811
|
+
'color': css.color.errorText,
|
1812
|
+
'font-size': css.fontSize.small,
|
1813
|
+
'font-weight': css.fontWeight.regular
|
1814
|
+
});
|
1815
|
+
});
|
1816
|
+
|
1817
|
+
it('Accessibility of error message', { tags: 'a11y' }, () => {
|
1818
|
+
cy.checkAccessibility(thinkSpherePage.nextGenThinkSphereCreateItemWrapper());
|
1819
|
+
});
|
1820
|
+
},
|
1821
|
+
|
1822
|
+
verifyQuestionAccordion: () => {
|
1823
|
+
it('Author should be able to expand and collapse the question accordion by clicking on the expand icon', () => {
|
1824
|
+
thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
|
1825
|
+
cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
|
1826
|
+
cy.wrap($accordion).should('have.class', 'Mui-expanded');
|
1827
|
+
});
|
1828
|
+
|
1829
|
+
thinkSpherePage.filterSectionQuestionAccordion().each(($accordion) => {
|
1830
|
+
cy.wrap($accordion).find('.expansion-item-icon-wrapper').click();
|
1831
|
+
cy.wrap($accordion).should('not.have.class', 'Mui-expanded');
|
1832
|
+
});
|
1833
|
+
});
|
1834
|
+
},
|
1835
|
+
|
1836
|
+
verifyCreateItemHeaderSection: () => {
|
1837
|
+
it('The page displays a unique Reference ID at the top left corner in the format "Ref ID:"', () => {
|
1838
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.referenceIdWrapper(), 'visible');
|
1839
|
+
utilities.verifyInnerText(thinkSpherePage.referenceIdWrapper().children('div').first(), 'Ref ID:\u00A0');
|
1840
|
+
const initialRefId = thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text');
|
1841
|
+
initialRefId.then((refId) => {
|
1842
|
+
expect(refId).to.be.a('string').and.not.be.empty;
|
1843
|
+
cy.reload();
|
1844
|
+
thinkSpherePage.referenceIdWrapper().children('div').eq(1).invoke('text').should((newRefId) => {
|
1845
|
+
expect(newRefId).to.be.a('string').and.not.be.empty;
|
1846
|
+
expect(newRefId).to.not.equal(refId);
|
1847
|
+
});
|
1848
|
+
});
|
1849
|
+
});
|
1850
|
+
|
1851
|
+
it('Edit text box and edit icon pencil should exist, and on clicking the edit input field with placeholder \'Enter title\ should allow the user to add title' , () => {
|
1852
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editBoxTextInput(), 'visible');
|
1853
|
+
thinkSpherePage.editBoxTextInput().blur();
|
1854
|
+
utilities.verifyElementVisibilityState(thinkSpherePage.editIconPencil(), 'visible');
|
1855
|
+
thinkSpherePage.editIconPencil().click();
|
1856
|
+
thinkSpherePage.editBoxTextInput().should('have.attr', 'placeholder', 'Enter title');
|
1857
|
+
thinkSpherePage.editBoxTextInput().type('Test Title');
|
1858
|
+
thinkSpherePage.editBoxTextInput().blur();
|
1859
|
+
utilities.verifyInnerText(thinkSpherePage.editBoxText(),'Test Title');
|
1860
|
+
});
|
1861
|
+
},
|
1862
|
+
|
1863
|
+
verifyDefaultTab: () => {
|
1864
|
+
it('By default edit tab should be selected', () => {
|
1865
|
+
thinkSpherePage.editTab().should('have.class', 'Mui-selected');
|
1866
|
+
});
|
1867
|
+
},
|
1553
1868
|
};
|
1554
1869
|
|
1555
1870
|
export const thinkSpherePage = {
|