itemengine-cypress-automation 1.0.377-highlight-flakiness-08bd446.0 → 1.0.378-IEI-5835-f7292f7.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.
@@ -114,6 +114,7 @@ describe('Create item page - Grid fill: Customize layout section - \'Fill Image\
114
114
  it('When the user adds the image more than of 10MB, then the file should not be uploaded', () => {
115
115
  gridFillPage.steps.uploadFilledImageFile('20mbFile.png');
116
116
  gridFillPage.steps.verifyFilledImageFileNameLabel('highlightImage.jpg');
117
+ gridFillPage.steps.verifyErrorMessageDoesNotHaveText();
117
118
  });
118
119
 
119
120
  it('Delete button should appear beside uploaded file\'s name', () => {
@@ -44,7 +44,7 @@ describe('Create item page - Grid fill: Header section and Saving question', ()
44
44
  describe('Validation error messages', () => {
45
45
  dialogBoxBase.tests.verifyRequiredFieldsWarningPopupOnClickingSaveButton(['Please set points']);
46
46
 
47
- it('Validation error messages should not be displayed below required input fields', () => {
47
+ it('Validation error messages and error icons should not be displayed below required input fields', () => {
48
48
  gridFillPage.steps.verifyQuestionInstructionsErrorMessageIsNotDisplayed();
49
49
  gridFillPage.steps.verifyPointsFieldErrorMessageIsNotDisplayed();
50
50
  gridFillPage.steps.verifySpecifyCorrectAnswerErrorIconNotExists();
@@ -0,0 +1,56 @@
1
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
2
+ import { liveItemPage } from "../../../pages/components/liveItemPage";
3
+ import utilities from "../../../support/helpers/utilities";
4
+
5
+ describe('Navigate to Live item page and view the page contents', () => {
6
+ before(() => {
7
+ cy.loginAs('admin');
8
+ });
9
+
10
+ describe('Live item page', () => {
11
+ abortEarlySetup();
12
+ before(() => {
13
+ liveItemPage.steps.navigateToLiveItemPage();
14
+ });
15
+
16
+ it('Live item heading should be displayed', () => {
17
+ utilities.verifyElementVisibilityState(liveItemPage.liveItemHeaderText(), 'visible');
18
+ utilities.verifyInnerText(liveItemPage.liveItemHeaderText(), 'Live Item Demo');
19
+ });
20
+
21
+ it('Item id should be displayed', () => {
22
+ utilities.verifyElementVisibilityState(liveItemPage.liveItemItemId(), 'visible');
23
+ utilities.verifyInnerText(liveItemPage.liveItemItemId(), 'Item: a61f2-1a16-eff1-421d-ba3defd3e643');
24
+ });
25
+
26
+ it('Student preview should be displayed', () => {
27
+ utilities.verifyElementVisibilityState(liveItemPage.liveItemStudentPreview(), 'visible');
28
+ utilities.verifyInnerText(liveItemPage.liveItemStudentPreview(), 'Student Preview');
29
+ });
30
+
31
+ it('Teacher preview should be displayed', () => {
32
+ utilities.verifyElementVisibilityState(liveItemPage.liveItemTeacherPreview(), 'visible');
33
+ utilities.verifyInnerText(liveItemPage.liveItemTeacherPreview(), 'Teacher Preview');
34
+ });
35
+ });
36
+
37
+ describe.only('Student preview content', () => {
38
+ abortEarlySetup();
39
+ before(() => {
40
+ liveItemPage.steps.navigateToLiveItemPage();
41
+ });
42
+
43
+ it('Student preview should be displayed', () => {
44
+ utilities.verifyElementVisibilityState(liveItemPage.liveItemStudentPreview(), 'visible');
45
+ utilities.verifyInnerText(liveItemPage.liveItemStudentPreview(), 'Student Preview');
46
+ cy.wait(2000);
47
+ liveItemPage.steps.checkOptionForQuestion(0, 1);
48
+ liveItemPage.steps.checkOptionForQuestion(1, 3);
49
+ liveItemPage.steps.checkOptionForQuestion(2, [1, 3]);
50
+ liveItemPage.steps.checkOptionForQuestion(3, 0);
51
+ liveItemPage.steps.checkOptionForQuestion(4, [0, 2]);
52
+ liveItemPage.steps.checkOptionForQuestion(5, 0);
53
+ liveItemPage.steps.checkOptionForQuestion(6, [1, 2, 3]);
54
+ });
55
+ });
56
+ });
@@ -97,6 +97,10 @@ const steps = {
97
97
  utilities.verifyElementVisibilityState(commonComponents.tooltipText(), 'notExist');
98
98
  },
99
99
 
100
+ verifyErrorMessageDoesNotHaveText: () => {
101
+ commonComponents.errorMessage()
102
+ .should('not.have.text', 'Error:');
103
+ }
100
104
  }
101
105
 
102
106
  const tests = {
@@ -0,0 +1,58 @@
1
+ import utilities from "../../support/helpers/utilities";
2
+ import { commonComponents } from "./commonComponents";
3
+ const css = Cypress.env('css');
4
+
5
+ const selectors = {
6
+ liveItemHeaderText: () => cy.get('[class*="HeaderTitleComponentstyles__HeaderTitleWrapper"]'),
7
+ liveItemItemId: () => cy.get('[class*="LiveItemDemostyles__ViewInfoWrapper"]'),
8
+ liveItemStudentPreview: () => cy.get('[class*="LiveItemDemostyles__LiveStudentHeader"]'),
9
+ liveItemTeacherPreview: () => cy.get('[class*="LiveTeacherPreviewstyles__LiveTeacherHeader"]'),
10
+ optionsRadioButtonForCorrectAnswer: () => cy.get('.radio-option-wrapper'),
11
+ optionsCheckboxForCorrectAnswer: () => cy.get('.mcq-option-wrapper'),
12
+ selectQuestion: ()=> cy.get('[class*="SinglePageAssessmentQuestionsstyles__QuestionPartContainer"]'),
13
+ };
14
+
15
+ const steps = {
16
+ navigateToLiveItemPage: () => {
17
+ cy.visit('/item-engine/demo/live-item-demo');
18
+ },
19
+
20
+ /**
21
+ * @description Checks the options checkbox in the 'Specify correct answer' section for single selection questions.
22
+ * @param {number} optionIndex - The index of the option checkbox to be checked.
23
+ */
24
+ checkRadioOptionInStudentPreview: (optionIndex) => {
25
+ liveItemPage.optionsRadioButtonForCorrectAnswer()
26
+ .eq(optionIndex)
27
+ .click()
28
+ },
29
+
30
+ checkCheckboxInStudentPreview: (optionIndex) => {
31
+ liveItemPage.optionsCheckboxForCorrectAnswer()
32
+ .eq(optionIndex)
33
+ .click()
34
+ },
35
+
36
+ checkOptionForQuestion: (questionNumber, optionIndex) => {
37
+ liveItemPage.selectQuestion()
38
+ .eq(questionNumber)
39
+ .within(() => {
40
+ if (Array.isArray(optionIndex)) {
41
+ optionIndex.forEach((index) => {
42
+ liveItemPage.steps.checkCheckboxInStudentPreview(index);
43
+ });
44
+ } else {
45
+ liveItemPage.steps.checkRadioOptionInStudentPreview(optionIndex);
46
+ }
47
+ });
48
+ },
49
+
50
+ };
51
+
52
+ const tests = {};
53
+
54
+ export const liveItemPage = {
55
+ ...selectors,
56
+ steps,
57
+ tests,
58
+ };
@@ -2924,7 +2924,7 @@ const tests = {
2924
2924
  gridFillPage.steps.selectCellSpecifyCorrectAnswerSection(0, 0);
2925
2925
  });
2926
2926
 
2927
- it(`When user deselect all the cells in the grid in the ${accordionName} accordion, \'Error: Please set a correct answer.\' error message should be thrown along with an error icon on the \'${accordionName}\' accordion`, () => {
2927
+ it(`When user deselect all the cells in the grid in the ${accordionName} accordion, error message and error icons should not be displayed on \'${accordionName}\' accordion`, () => {
2928
2928
  gridFillPage.steps.deselectCellSpecifyCorrectAnswerSection(0, 0);
2929
2929
  gridFillPage.steps.verifyErrorMessageIsNotDisplayed();
2930
2930
  if (accordionName == 'Correct') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.377-highlight-flakiness-08bd446.0",
3
+ "version": "1.0.378-IEI-5835-f7292f7.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {