itemengine-cypress-automation 1.0.346-miscellaneous-questions-r1-f032660.0 → 1.0.346
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/ContentBlocks/editTabBasics.js +62 -4
- package/cypress/e2e/ILC/ToolAudioPlayerNew/headerSection.js +89 -1
- package/cypress/pages/audioPlayerPage.js +2 -0
- package/cypress/pages/components/createQuestionBasePage.js +8 -2
- package/cypress/pages/contentBlocksPage.js +2 -0
- package/package.json +2 -2
@@ -1,8 +1,11 @@
|
|
1
|
-
import { contentBlocksPage } from "../../../pages";
|
1
|
+
import { contentBlocksPage, dialogBoxBase, itemPreviewPage } from "../../../pages";
|
2
|
+
import { browseItemsPage } from "../../../pages/components";
|
2
3
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
3
4
|
import utilities from "../../../support/helpers/utilities";
|
4
5
|
const css = Cypress.env('css');
|
5
6
|
|
7
|
+
var itemReferenceID = "";
|
8
|
+
|
6
9
|
describe('Content blocks - Edit tab', () => {
|
7
10
|
before(() => {
|
8
11
|
cy.loginAs('admin');
|
@@ -82,6 +85,62 @@ describe('Content blocks - Edit tab', () => {
|
|
82
85
|
it('Accessibility of header section', { tags: 'a11y' }, () => {
|
83
86
|
cy.checkAccessibility(contentBlocksPage.headerLabel().parents('content-blocks'));
|
84
87
|
});
|
88
|
+
|
89
|
+
describe('Saving a question with incomplete authoring', () => {
|
90
|
+
abortEarlySetup();
|
91
|
+
before(() => {
|
92
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
93
|
+
});
|
94
|
+
|
95
|
+
it('User should be able to save the resource with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save button is clicked', () => {
|
96
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please enter text block']);
|
97
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
98
|
+
});
|
99
|
+
contentBlocksPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
100
|
+
});
|
101
|
+
|
102
|
+
describe('User should be able to edit incomplete authored resource', () => {
|
103
|
+
abortEarlySetup();
|
104
|
+
before(() => {
|
105
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
106
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
107
|
+
contentBlocksPage.steps.editItem();
|
108
|
+
});
|
109
|
+
|
110
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
111
|
+
contentBlocksPage.steps.verifyWarningIconOnRequiredFields([
|
112
|
+
'Please enter text block',
|
113
|
+
]);
|
114
|
+
});
|
115
|
+
|
116
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
117
|
+
contentBlocksPage.steps.enterTextInTextBlockInputField(0, 'Text block text');
|
118
|
+
contentBlocksPage.steps.verifyErrorMessageIsNotDisplayed();
|
119
|
+
});
|
120
|
+
|
121
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
122
|
+
contentBlocksPage.steps.saveAQuestionAndVerifySnackbar();
|
123
|
+
});
|
124
|
+
|
125
|
+
it('Warning icon should not be visible', () => {
|
126
|
+
contentBlocksPage.steps.verifyWarningIconNotExist();
|
127
|
+
});
|
128
|
+
});
|
129
|
+
|
130
|
+
describe('Save as you go - Browse item page contents', () => {
|
131
|
+
abortEarlySetup();
|
132
|
+
before(() => {
|
133
|
+
contentBlocksPage.steps.navigateToCreateResource('content blocks');
|
134
|
+
contentBlocksPage.steps.saveAQuestionWithIncompleteAuthoring();
|
135
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
136
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
137
|
+
browseItemsPage.steps.navigateToBrowseItemsPage();
|
138
|
+
});
|
139
|
+
|
140
|
+
it('When user saves an incompletely authored resource then a warning icon should be visible in browse items page', () => {
|
141
|
+
browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
|
142
|
+
});
|
143
|
+
});
|
85
144
|
});
|
86
145
|
|
87
146
|
describe('Body section', () => {
|
@@ -113,10 +172,9 @@ describe('Content blocks - Edit tab', () => {
|
|
113
172
|
contentBlocksPage.steps.verifyTextBlockInputFieldPlaceholderTextNotExist(contentBlocksPage.verifyTextBlockInputFieldPlaceholderText);
|
114
173
|
});
|
115
174
|
|
116
|
-
it('When user clears text and focuses out of text block input field, then error message
|
175
|
+
it('When user clears text and focuses out of text block input field, then error message should not be displayed', () => {
|
117
176
|
contentBlocksPage.steps.clearAndFocusOutOfTextBlockInputField();
|
118
|
-
utilities.
|
119
|
-
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'visible');
|
177
|
+
utilities.verifyElementVisibilityState(contentBlocksPage.errorMessage(), 'notExist');
|
120
178
|
});
|
121
179
|
|
122
180
|
it('When user enters text again then error message should not be displayed', () => {
|
@@ -1,9 +1,12 @@
|
|
1
|
-
import { audioPlayerPage, dialogBoxBase, selectQuestionResourceToolPage } from "../../../pages";
|
1
|
+
import { audioPlayerPage, dialogBoxBase, selectQuestionResourceToolPage, itemPreviewPage } from "../../../pages";
|
2
|
+
import { browseItemsPage } from "../../../pages/components";
|
2
3
|
import utilities from "../../../support/helpers/utilities";
|
3
4
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
4
5
|
import constants from "../../../fixtures/constants";
|
5
6
|
const css = Cypress.env('css');
|
6
7
|
|
8
|
+
var itemReferenceID = "";
|
9
|
+
|
7
10
|
describe('Create question page - Audio player: Header section and saving resource tool', () => {
|
8
11
|
before(() => {
|
9
12
|
cy.loginAs('admin');
|
@@ -122,4 +125,89 @@ describe('Create question page - Audio player: Header section and saving resourc
|
|
122
125
|
audioPlayerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
123
126
|
});
|
124
127
|
});
|
128
|
+
|
129
|
+
describe('Saving a question with incomplete authoring', () => {
|
130
|
+
abortEarlySetup();
|
131
|
+
before(() => {
|
132
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
133
|
+
});
|
134
|
+
|
135
|
+
it('User should be able to save the resource with incomplete authoring and display a snackbar with the text "Saved successfully!" when the Save button is clicked', () => {
|
136
|
+
dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please add a source URL']);
|
137
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
138
|
+
});
|
139
|
+
audioPlayerPage.tests.verifySavedSuccessfullySnackbarCSSAndA11y();
|
140
|
+
});
|
141
|
+
|
142
|
+
describe('User should be able to edit incomplete authored resource', () => {
|
143
|
+
abortEarlySetup();
|
144
|
+
before(() => {
|
145
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
146
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
147
|
+
audioPlayerPage.steps.editItem();
|
148
|
+
});
|
149
|
+
|
150
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
151
|
+
audioPlayerPage.steps.verifyWarningIconOnRequiredFields([
|
152
|
+
'Please add a source URL',
|
153
|
+
]);
|
154
|
+
});
|
155
|
+
|
156
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
157
|
+
audioPlayerPage.steps.uploadAudioFile('uploads/sample.mp3');
|
158
|
+
audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
|
159
|
+
});
|
160
|
+
|
161
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
162
|
+
audioPlayerPage.steps.saveAQuestionAndVerifySnackbar();
|
163
|
+
});
|
164
|
+
|
165
|
+
it('Warning icon should not be visible', () => {
|
166
|
+
audioPlayerPage.steps.verifyWarningIconNotExist();
|
167
|
+
});
|
168
|
+
});
|
169
|
+
|
170
|
+
describe('User should be able to edit incomplete authored resource when add audio URL is selected', () => {
|
171
|
+
abortEarlySetup();
|
172
|
+
before(() => {
|
173
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
174
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
175
|
+
audioPlayerPage.steps.editItem();
|
176
|
+
});
|
177
|
+
|
178
|
+
it('Warning icons should be displayed on the required input fields', () => {
|
179
|
+
audioPlayerPage.steps.selectAddAudioURLRadioButton();
|
180
|
+
audioPlayerPage.steps.verifyWarningIconOnRequiredFields([
|
181
|
+
'Please add a source URL',
|
182
|
+
]);
|
183
|
+
});
|
184
|
+
|
185
|
+
it('When required input fields are filled then warning icons should disappear', () => {
|
186
|
+
audioPlayerPage.steps.enterTextInSourceURLInputField(constants.sampleMp3Link);
|
187
|
+
audioPlayerPage.steps.verifyErrorMessageIsNotDisplayed();
|
188
|
+
});
|
189
|
+
|
190
|
+
it('Clicking on Save button the question should get saved and a snackbar with text \'Saved successfully!\' should be displayed', () => {
|
191
|
+
audioPlayerPage.steps.saveAQuestionAndVerifySnackbar();
|
192
|
+
});
|
193
|
+
|
194
|
+
it('Warning icon should not be visible', () => {
|
195
|
+
audioPlayerPage.steps.verifyWarningIconNotExist();
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
describe('Save as you go - Browse item page contents', () => {
|
200
|
+
abortEarlySetup();
|
201
|
+
before(() => {
|
202
|
+
audioPlayerPage.steps.navigateToCreateResource('audio player');
|
203
|
+
audioPlayerPage.steps.saveAQuestionWithIncompleteAuthoring();
|
204
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
205
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
206
|
+
browseItemsPage.steps.navigateToBrowseItemsPage();
|
207
|
+
});
|
208
|
+
|
209
|
+
it('When user saves an incompletely authored resource then a warning icon should be visible in browse items page', () => {
|
210
|
+
browseItemsPage.steps.verifyWarningIconInBrowseItemPage(`${itemReferenceID}`);
|
211
|
+
});
|
212
|
+
});
|
125
213
|
});
|
@@ -2,6 +2,7 @@ import constants from "../fixtures/constants";
|
|
2
2
|
import utilities from "../support/helpers/utilities";
|
3
3
|
import { ckEditorToolbar, commonComponents, createQuestionBasePage, equationEditorFlyout, playbackControlsBaseComponent } from "./components";
|
4
4
|
import { dialogBoxBase } from "./dialogBoxBase";
|
5
|
+
import { createItemPage } from "./createItemPage";
|
5
6
|
|
6
7
|
const selectors = {
|
7
8
|
...playbackControlsBaseComponent,
|
@@ -127,6 +128,7 @@ const steps = {
|
|
127
128
|
...ckEditorToolbar.steps,
|
128
129
|
...equationEditorFlyout.steps,
|
129
130
|
...commonComponents.steps,
|
131
|
+
...createItemPage.steps,
|
130
132
|
/**
|
131
133
|
* Uploads a file to the audio player by attaching the file located at the specified filePath.
|
132
134
|
* @param {string} filePath - The file path to the file to be uploaded.
|
@@ -146,17 +146,23 @@ const steps = {
|
|
146
146
|
.within(() => {
|
147
147
|
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
148
148
|
});
|
149
|
-
}
|
149
|
+
}
|
150
150
|
else if (field === 'Please select a file type') {
|
151
151
|
// Upload Response Select File Type Accordion
|
152
152
|
cy.get('.edit-question-edit-tab-wrapper .ngie-accordion-summary')
|
153
153
|
.within(() => {
|
154
154
|
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
155
155
|
});
|
156
|
+
} else if (field === 'Please enter text block') {
|
157
|
+
// Content Block Body Label
|
158
|
+
cy.get('.options-label')
|
159
|
+
.within(() => {
|
160
|
+
utilities.verifyElementVisibilityState(commonComponents.warningIcon(), 'exist');
|
161
|
+
});
|
156
162
|
}
|
157
163
|
})
|
158
164
|
},
|
159
|
-
|
165
|
+
|
160
166
|
|
161
167
|
clickOnEditQuestionButton: () => {
|
162
168
|
createQuestionBasePage.editButton()
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "itemengine-cypress-automation",
|
3
|
-
"version": "1.0.346
|
3
|
+
"version": "1.0.346",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -52,4 +52,4 @@
|
|
52
52
|
"devDependencies": {
|
53
53
|
"@applitools/eyes-cypress": "^3.47.0"
|
54
54
|
}
|
55
|
-
}
|
55
|
+
}
|