itemengine-cypress-automation 1.0.105 → 1.0.107
Sign up to get free protection for your applications and to get access to all the features.
- package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +129 -0
- package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +482 -0
- package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +123 -0
- package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.js +554 -0
- package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +1 -41
- package/cypress/e2e/ILC/EditTabSettingPage/ItemPreviewSettingsTabContent.js +5 -3
- package/cypress/e2e/ILC/EssayResponse/editCategoryFlyout.js +284 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditor.smoke.js +412 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories1.js +203 -0
- package/cypress/e2e/ILC/EssayResponse/equationEditorCategories2.js +340 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettings.js +432 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseAdditionalSettingsBasic.js +134 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions1.smoke.js +336 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions2.js +332 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseCustomizeFormattingOptions3.js +522 -0
- package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +253 -0
- package/cypress/e2e/ILC/EssayResponse/previewHyperlink.js +266 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +57 -640
- package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/previewContentsForAllViews.smoke.js +1 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +209 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +303 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/allOrNothingPenaltyScoring.js +68 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsBasic.js +149 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +218 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +191 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +219 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/allOrNothingForAllView.smoke.js +240 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +124 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/previewContentsForAllViews.smoke.js +107 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/manuallyAndNonScored.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +0 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +408 -0
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +2 -2
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
- package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +2 -2
- package/cypress/e2e/ILC/MultipleSelection/headerSection.js +1 -0
- package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +0 -6
- package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +242 -0
- package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +99 -0
- package/cypress/e2e/ILC/Passage/passageEditTab.js +241 -0
- package/cypress/e2e/ILC/Passage/passageHeaderSection.js +73 -0
- package/cypress/e2e/ILC/Passage/passagePreviewTab.js +246 -0
- package/cypress/e2e/ILC/ReadingRuler/readingRulerEditTabBasicsSection.js +138 -33
- package/cypress/e2e/ILC/ReadingRuler/readingRulerHeaderSection.js +30 -6
- package/cypress/e2e/ILC/ReadingRuler/readingRulerPreviewTab.js +167 -101
- package/cypress/e2e/ILC/ReadingRuler/readingrulerPreviewContents.smoke.js +1 -1
- package/cypress/e2e/ILC/SingleSelection/headerSection.js +20 -5
- package/cypress/e2e/ILC/SingleSelection/manuallyAndNonScoredScoring.js +1 -0
- package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +12 -7
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +1336 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +419 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +443 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +411 -0
- package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +3 -3
- package/cypress/fixtures/specialAndMathCharacters.js +2 -0
- package/cypress/fixtures/theme/ilc.json +4 -2
- package/cypress/pages/audioResponsePage.js +326 -165
- package/cypress/pages/components/additionalSettingsPanel.js +1 -1
- package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +1 -1
- package/cypress/pages/components/backgroundImageUploadComponent.js +162 -2
- package/cypress/pages/components/colorPopupComponent.js +115 -26
- package/cypress/pages/components/customizeMathCharacterComponent.js +133 -0
- package/cypress/pages/components/customizeSpecialCharacterComponent.js +74 -4
- package/cypress/pages/components/editCategoryFlyout.js +164 -2
- package/cypress/pages/components/equationEditorFlyout.js +36 -1
- package/cypress/pages/components/essayResponseCommonComponents.js +0 -2
- package/cypress/pages/components/figOverImageCanvasComponent.js +587 -134
- package/cypress/pages/components/index.js +2 -1
- package/cypress/pages/components/playbackControlsBaseComponent.js +137 -2
- package/cypress/pages/correctAnswerViewPage.js +12 -1
- package/cypress/pages/drawingResponsePage.js +26 -151
- package/cypress/pages/essayResponseMathPage.js +28 -16
- package/cypress/pages/essayResponsePage.js +187 -7
- package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +78 -14
- package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +178 -221
- package/cypress/pages/fillInTheGapsOverImageTextPage.js +79 -0
- package/cypress/pages/multipleSelectionPage.js +1 -1
- package/cypress/pages/readingRulerPage.js +219 -104
- package/cypress/pages/singleSelectionPage.js +1 -0
- package/cypress/pages/textEntryMathPage.js +17 -6
- package/cypress/pages/videoResponsePage.js +0 -8
- package/package.json +1 -1
- package/scripts/sorry-cypress.mjs +1 -1
@@ -2,30 +2,34 @@ import utilities from "../../support/helpers/utilities";
|
|
2
2
|
import { backgroundImageUploadComponent } from "./backgroundImageUploadComponent";
|
3
3
|
import { commonComponents } from "./commonComponents";
|
4
4
|
import { createQuestionBasePage } from "./createQuestionBasePage";
|
5
|
+
import { opacityComponent } from "./opacityComponent";
|
6
|
+
import { imageActionsComponent } from "./imageActionsComponent";
|
7
|
+
import { colorPopupComponent } from "./colorPopupComponent";
|
8
|
+
import { dialogBoxBase } from "../dialogBoxBase";
|
9
|
+
const css = Cypress.env('css');
|
10
|
+
|
11
|
+
const labels = [colorPopupComponent.selectedColorLabel, colorPopupComponent.hexLabel]
|
12
|
+
const inputFields = [colorPopupComponent.hexInputField];
|
13
|
+
const alignmentOptions = ['Top left', 'Center', 'Top right'];
|
14
|
+
const responseAreaPointerStyles = ['None', 'Bottom', 'Bottom right', 'Right', 'Top right', 'Top', 'Top left', 'Left', 'Bottom left'];
|
5
15
|
|
6
16
|
const selectors = {
|
7
17
|
insertResponseAreaButton: () => cy.get('[class*="ControlsBtnWrapper"] button').eq(1),
|
8
18
|
selectResponseAreaButton: () => cy.get('button[aria-label*="select"]').eq(0),
|
9
|
-
insertTextAreaButton: () => cy.get('button[aria-label*="insert text"]')
|
19
|
+
insertTextAreaButton: () => cy.get('button[aria-label*="insert text"]'),
|
10
20
|
canvas: () => cy.get('[class*="Canvasstyle__DragAndDropCanvas"]'),
|
11
|
-
canvasInPreviewTab: () => cy.get('[class*="PreviewTabstyles__ContentWrapper"] [class*="Canvasstyle__DragAndDropCanvas"]'),
|
12
21
|
canvasLabel: () => cy.get('[class*="Canvasstyle__CanvasTxt"]'),
|
13
|
-
selectDropzoneButton: () => cy.get('[aria-label="select dropzone"]'),
|
14
|
-
insertDropzoneButton: () => cy.get('[aria-label="insert dropzone"]'),
|
15
|
-
insertTextButton: () => cy.get('[aria-label="insert text"]'),
|
16
22
|
undoButton: () => cy.get('[aria-label="undo"]'),
|
17
23
|
redoButton: () => cy.get('[aria-label="redo"]'),
|
18
24
|
clearAllButton: () => cy.get('[aria-label="clear all"]'),
|
19
25
|
canvasSelectedMenuText: () => cy.get('[class*="Canvasstyle__CanvasSelectedMenuTxt"]'),
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
dropzonePointerInPreviewTab: () => cy.get('.preview-content-wrapper [class*="Canvasstyle__PointerWrapper"]'),
|
24
|
-
dropzoneInPreviewTab: () => cy.get('.preview-content-wrapper [class*="Canvasstyle__DropzoneWrapper"]'),
|
26
|
+
responseAreaWrapper: () => cy.get('[class*="Canvasstyle__ResponseDiv"]'),
|
27
|
+
responseAreaPointer: () => cy.get('[class*="Canvasstyle__PointerWrapper"]'),
|
28
|
+
responseArea: () => cy.get('[class*="Canvasstyle__DropZone"]'),
|
25
29
|
textBoxInPreviewTab: () => cy.get('.preview-content-wrapper [class*="Canvasstyle__TextBoxContainer"] textarea'),
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
removeResponseAreaButton: () => cy.get('.remove-button'),
|
31
|
+
responseAreaNumerationText: () => cy.get('[class*="Canvasstyle__DropzoneContent"]'),
|
32
|
+
responseAreaStyle: (ariaLabel = null) => {
|
29
33
|
if (ariaLabel) {
|
30
34
|
return cy.get(`.canvas-secondary-control[aria-label="${ariaLabel}"]`)
|
31
35
|
} else {
|
@@ -34,7 +38,7 @@ const selectors = {
|
|
34
38
|
},
|
35
39
|
textResponse: () => cy.get('[class*="Canvasstyle__TextBoxContainer"] textarea'),
|
36
40
|
canvasImage: () => cy.get('.canvas-image'),
|
37
|
-
canvasImageInPreviewTab: () => cy.get('[class*="
|
41
|
+
canvasImageInPreviewTab: () => cy.get('[class*="PreviewTabstyles"] [class*="ImageWrapper"] img'),
|
38
42
|
imagePropertiesLabel: () => cy.get('[class*="ImagePropertiesstyles__SectionLabel"]'),
|
39
43
|
fillImageToCanvasLabel: () => cy.get('[data-ngie-testid="fill-image-to-canvas-checkbox"] .MuiFormControlLabel-label'),
|
40
44
|
fillImageToCanvasCheckbox: () => cy.get('[data-ngie-testid="fill-image-to-canvas-checkbox"] input'),
|
@@ -55,6 +59,11 @@ const selectors = {
|
|
55
59
|
}
|
56
60
|
|
57
61
|
const steps = {
|
62
|
+
...createQuestionBasePage.steps,
|
63
|
+
...opacityComponent.steps,
|
64
|
+
...imageActionsComponent.steps,
|
65
|
+
...colorPopupComponent.steps,
|
66
|
+
|
58
67
|
/**
|
59
68
|
* @param {number} xCoordinateInPercentage - The x co-ordinate for position of the response area
|
60
69
|
* @description Adds response area to the canvas.
|
@@ -75,10 +84,11 @@ const steps = {
|
|
75
84
|
},
|
76
85
|
|
77
86
|
/**
|
78
|
-
* @param {number}
|
79
|
-
* @
|
87
|
+
* @param {number} yCoordinateInPercentage - The y co-ordinate for position of the response area
|
88
|
+
* @param {string} text to be added in text area
|
89
|
+
* @description Adds text area to the canvas.
|
80
90
|
*/
|
81
|
-
insertTextArea: (yCoordinateInPercentage) => {
|
91
|
+
insertTextArea: (yCoordinateInPercentage, text) => {
|
82
92
|
figOverImageCanvasComponent.insertTextAreaButton()
|
83
93
|
.click();
|
84
94
|
figOverImageCanvasComponent.canvasImage()
|
@@ -324,59 +334,43 @@ const steps = {
|
|
324
334
|
},
|
325
335
|
|
326
336
|
/**
|
327
|
-
* @param {
|
328
|
-
* @description this function verifies width of canvas
|
329
|
-
*/
|
330
|
-
verifyCanvasWidthInPreviewTab: (width) => {
|
331
|
-
figOverImageCanvasComponent.canvasInPreviewTab()
|
332
|
-
.should('have.attr', 'width', width);
|
333
|
-
},
|
334
|
-
|
335
|
-
/**
|
336
|
-
* @param {*} height height of canvas
|
337
|
-
* @description this function verifies height of canvas
|
338
|
-
*/
|
339
|
-
verifyCanvasHeightInPreviewTab: (height) => {
|
340
|
-
figOverImageCanvasComponent.canvasInPreviewTab()
|
341
|
-
.should('have.css', 'height', `${height}px`);
|
342
|
-
},
|
343
|
-
|
344
|
-
/**
|
345
|
-
* @param {"Insert dropzone"|"Insert text"|"Select dropzone"} {String} button denotes selected button name
|
337
|
+
* @param {"Insert dropzone"|"Insert text"|"Select dropzone"|"Insert text container"|"Select text container"} button denotes selected button name
|
346
338
|
*@description function verifies button active state
|
347
339
|
*/
|
348
340
|
verifyCanvasMenuButtonSelected: (button) => {
|
349
|
-
|
350
|
-
|
341
|
+
if (button == 'Insert dropzone' || button == 'Insert text container') {
|
342
|
+
figOverImageCanvasComponent.insertResponseAreaButton()
|
351
343
|
.should('have.class', 'active');
|
352
|
-
|
353
|
-
|
344
|
+
}
|
345
|
+
else if (button == 'Select dropzone' || button == 'Select text container') {
|
346
|
+
figOverImageCanvasComponent.selectResponseAreaButton()
|
354
347
|
.should('have.class', 'active');
|
355
|
-
|
356
|
-
|
348
|
+
}
|
349
|
+
else {
|
350
|
+
figOverImageCanvasComponent.insertTextAreaButton()
|
357
351
|
.should('have.class', 'active');
|
358
|
-
break;
|
359
352
|
}
|
360
353
|
},
|
361
354
|
|
362
355
|
/**
|
363
|
-
* @param {"Insert dropzone"|"Insert text"|"Select dropzone"} {String} button denotes selected button name
|
356
|
+
* @param {"Insert dropzone"|"Insert text"|"Select dropzone"|"Insert text container"|"Select text container"} {String} button denotes selected button name
|
364
357
|
*@description function selects button
|
365
358
|
*/
|
366
359
|
selectCanvasMenuButton: (button) => {
|
367
|
-
|
368
|
-
|
360
|
+
if (button == 'Insert dropzone' || button == 'Insert text container') {
|
361
|
+
figOverImageCanvasComponent.insertResponseAreaButton()
|
369
362
|
.click()
|
370
363
|
.should('have.class', 'active');
|
371
|
-
|
372
|
-
|
364
|
+
}
|
365
|
+
else if (button == 'Select dropzone' || button == 'Select text container') {
|
366
|
+
figOverImageCanvasComponent.selectResponseAreaButton()
|
373
367
|
.click()
|
374
368
|
.should('have.class', 'active');
|
375
|
-
|
376
|
-
|
369
|
+
}
|
370
|
+
else {
|
371
|
+
figOverImageCanvasComponent.insertTextAreaButton()
|
377
372
|
.click()
|
378
373
|
.should('have.class', 'active');
|
379
|
-
break;
|
380
374
|
}
|
381
375
|
},
|
382
376
|
|
@@ -412,21 +406,21 @@ const steps = {
|
|
412
406
|
},
|
413
407
|
|
414
408
|
/**
|
415
|
-
* @param {number}
|
416
|
-
* @description function selects
|
409
|
+
* @param {number} responseAreaIndex response area number
|
410
|
+
* @description function selects response container of a particular index
|
417
411
|
*/
|
418
|
-
|
419
|
-
figOverImageCanvasComponent.
|
420
|
-
.eq(
|
412
|
+
selectResponseArea: (responseAreaIndex) => {
|
413
|
+
figOverImageCanvasComponent.responseArea()
|
414
|
+
.eq(responseAreaIndex)
|
421
415
|
.click();
|
422
416
|
},
|
423
417
|
|
424
418
|
/**
|
425
|
-
* @param {string} style
|
426
|
-
* @description function selects
|
419
|
+
* @param {string} style response container pointer orientation
|
420
|
+
* @description function selects response container pointer style
|
427
421
|
*/
|
428
|
-
|
429
|
-
figOverImageCanvasComponent.
|
422
|
+
selectResponseAreaPointerStyle: (style) => {
|
423
|
+
figOverImageCanvasComponent.responseAreaStyle(style)
|
430
424
|
.click();
|
431
425
|
},
|
432
426
|
|
@@ -435,102 +429,51 @@ const steps = {
|
|
435
429
|
.click();
|
436
430
|
},
|
437
431
|
|
438
|
-
|
432
|
+
verifyResponseAreaPointerStyle: (style, responseAreaIndex) => {
|
439
433
|
const getPosition = (option) => {
|
440
434
|
switch (option) {
|
441
|
-
case '
|
435
|
+
case 'Bottom':
|
442
436
|
return { top: '-31.5px', left: '-37.5px' };
|
443
|
-
case '
|
437
|
+
case 'Bottom right':
|
444
438
|
return { top: '-25px', left: '-40px' };
|
445
|
-
case '
|
439
|
+
case 'Right':
|
446
440
|
return { top: '-21px', left: '-36.5px' };
|
447
|
-
case '
|
441
|
+
case 'Top right':
|
448
442
|
return { top: '-19px', left: '-31px' };
|
449
|
-
case '
|
443
|
+
case 'Top':
|
450
444
|
return { top: '-22.5px', left: '-25.5px' };
|
451
|
-
case '
|
445
|
+
case 'Top left':
|
452
446
|
return { top: '-27px', left: '-24px' };
|
453
|
-
case '
|
447
|
+
case 'Left':
|
454
448
|
return { bottom: '-20px', left: '-27px' };
|
455
|
-
case '
|
449
|
+
case 'Bottom left':
|
456
450
|
return { bottom: '-18px', left: '-32px' };
|
457
451
|
}
|
458
452
|
}
|
459
453
|
const expectedPosition = getPosition(style);
|
460
|
-
if (style == '
|
461
|
-
figOverImageCanvasComponent.
|
462
|
-
.eq(
|
454
|
+
if (style == 'Left' || style == 'Bottom left') {
|
455
|
+
figOverImageCanvasComponent.responseAreaPointer()
|
456
|
+
.eq(responseAreaIndex)
|
463
457
|
.should('have.css', 'bottom', expectedPosition.bottom)
|
464
458
|
.and('have.css', 'left', expectedPosition.left);
|
465
459
|
}
|
466
|
-
else if (style == '
|
467
|
-
figOverImageCanvasComponent.
|
460
|
+
else if (style == 'None') {
|
461
|
+
figOverImageCanvasComponent.responseArea()
|
468
462
|
.parent()
|
469
463
|
.should('not.contain', '[class*="Canvasstyle__PointerWrapper"]');
|
470
464
|
}
|
471
465
|
else {
|
472
|
-
figOverImageCanvasComponent.
|
473
|
-
.eq(
|
474
|
-
.should('have.css', 'top', expectedPosition.top)
|
475
|
-
.and('have.css', 'left', expectedPosition.left);
|
476
|
-
}
|
477
|
-
},
|
478
|
-
|
479
|
-
verifyDropzonePointerStyleInPreviewTab: (style, dropzoneIndex) => {
|
480
|
-
const getPosition = (option) => {
|
481
|
-
switch (option) {
|
482
|
-
case 'bottom':
|
483
|
-
return { top: '-31.5px', left: '-37.5px' };
|
484
|
-
case 'bottom right':
|
485
|
-
return { top: '-25px', left: '-40px' };
|
486
|
-
case 'right':
|
487
|
-
return { top: '-21px', left: '-36.5px' };
|
488
|
-
case 'top right':
|
489
|
-
return { top: '-19px', left: '-31px' };
|
490
|
-
case 'top':
|
491
|
-
return { top: '-22.5px', left: '-25.5px' };
|
492
|
-
case 'top left':
|
493
|
-
return { top: '-27px', left: '-24px' };
|
494
|
-
case 'left':
|
495
|
-
return { bottom: '-20px', left: '-27px' };
|
496
|
-
case 'bottom left':
|
497
|
-
return { bottom: '-18px', left: '-32px' };
|
498
|
-
}
|
499
|
-
}
|
500
|
-
const expectedPosition = getPosition(style);
|
501
|
-
if (style == 'left' || style == 'bottom left') {
|
502
|
-
figOverImageCanvasComponent.dropzonePointerInPreviewTab()
|
503
|
-
.eq(dropzoneIndex)
|
504
|
-
.should('have.css', 'bottom', expectedPosition.bottom)
|
505
|
-
.and('have.css', 'left', expectedPosition.left);
|
506
|
-
}
|
507
|
-
else if (style == 'none') {
|
508
|
-
figOverImageCanvasComponent.dropzonePointerInPreviewTab()
|
509
|
-
.eq(dropzoneIndex)
|
510
|
-
.should('not.have.css', 'bottom')
|
511
|
-
.and('not.have.css', 'left');
|
512
|
-
}
|
513
|
-
else {
|
514
|
-
figOverImageCanvasComponent.dropzonePointerInPreviewTab()
|
515
|
-
.eq(dropzoneIndex)
|
466
|
+
figOverImageCanvasComponent.responseAreaPointer()
|
467
|
+
.eq(responseAreaIndex)
|
516
468
|
.should('have.css', 'top', expectedPosition.top)
|
517
469
|
.and('have.css', 'left', expectedPosition.left);
|
518
470
|
}
|
519
471
|
},
|
520
472
|
|
521
|
-
verifyDropzoneNotExistInPreviewTab: () => {
|
522
|
-
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.dropzoneInPreviewTab(), 'notExist');
|
523
|
-
},
|
524
|
-
|
525
473
|
verifyTextBoxNotExistInPreviewTab: () => {
|
526
474
|
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textBoxInPreviewTab(), 'notExist');
|
527
475
|
},
|
528
476
|
|
529
|
-
verifyDropzoneExistInPreviewTab: () => {
|
530
|
-
figOverImageCanvasComponent.dropzoneInPreviewTab()
|
531
|
-
.should('be.visible');
|
532
|
-
},
|
533
|
-
|
534
477
|
verifyTextBoxExistInPreviewTab: () => {
|
535
478
|
figOverImageCanvasComponent.textBoxInPreviewTab()
|
536
479
|
.should('be.visible');
|
@@ -559,7 +502,7 @@ const steps = {
|
|
559
502
|
},
|
560
503
|
|
561
504
|
clickOnTextColorButton: () => {
|
562
|
-
figOverImageCanvasComponent.
|
505
|
+
figOverImageCanvasComponent.responseAreaStyle()
|
563
506
|
.click();
|
564
507
|
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorPopupWrapper(), 'visible');
|
565
508
|
},
|
@@ -581,11 +524,11 @@ const steps = {
|
|
581
524
|
},
|
582
525
|
|
583
526
|
/**
|
584
|
-
* @description this function removes a
|
585
|
-
* @param {number} index of the
|
527
|
+
* @description this function removes a response container from the canvas
|
528
|
+
* @param {number} index of the response container to be removed
|
586
529
|
*/
|
587
|
-
|
588
|
-
figOverImageCanvasComponent.
|
530
|
+
removeResponseArea: (index) => {
|
531
|
+
figOverImageCanvasComponent.removeResponseAreaButton()
|
589
532
|
.eq(index)
|
590
533
|
.click({ force: true });
|
591
534
|
},
|
@@ -604,16 +547,526 @@ const steps = {
|
|
604
547
|
* @param {string} text denotes tooltip text
|
605
548
|
* @description function is used to hover over element and verify innertext of its tooltip
|
606
549
|
*/
|
607
|
-
verifyTooltipInnerText: (element, text) => {
|
550
|
+
verifyTooltipInnerText: (element, text, index=null) => {
|
608
551
|
element()
|
552
|
+
.eq(index)
|
609
553
|
.trigger('mouseover', { force: true });
|
610
554
|
utilities.verifyInnerText(commonComponents.tooltipText(), text);
|
611
555
|
element()
|
556
|
+
.eq(index)
|
612
557
|
.trigger('mouseout', { force: true });
|
558
|
+
},
|
559
|
+
|
560
|
+
verifyPointerStyleTooltip: () => {
|
561
|
+
responseAreaPointerStyles.forEach((dropzonePointer, index) => {
|
562
|
+
cy.log('Clicking on canvas Selected Menu Text to hover away from select dropzone button');
|
563
|
+
steps.clickOnCanvasSelectedMenuText();
|
564
|
+
figOverImageCanvasComponent.responseAreaStyle()
|
565
|
+
.eq(index)
|
566
|
+
.trigger('mouseover', { force: true });
|
567
|
+
utilities.verifyInnerText(commonComponents.tooltipText(), dropzonePointer);
|
568
|
+
figOverImageCanvasComponent.responseAreaStyle()
|
569
|
+
.eq(index)
|
570
|
+
.trigger('mouseout', { force: true });
|
571
|
+
});
|
613
572
|
}
|
614
573
|
}
|
615
574
|
|
575
|
+
const tests = {
|
576
|
+
...colorPopupComponent.tests,
|
577
|
+
|
578
|
+
verifyCanvasLabelAndCanvas: () => {
|
579
|
+
it('\'Canvas\' label and canvas should be displayed', () => {
|
580
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.canvasLabel(), 'Canvas');
|
581
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasLabel(), 'visible');
|
582
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvas(), 'visible');
|
583
|
+
});
|
584
|
+
|
585
|
+
it('When user uploads background image for canvas, then it should be displayed', () => {
|
586
|
+
backgroundImageUploadComponent.steps.uploadFile('highlightImage.jpg');
|
587
|
+
figOverImageCanvasComponent.steps.verifyImageIsUploaded();
|
588
|
+
});
|
589
|
+
},
|
590
|
+
|
591
|
+
verifyInsertTextTooltip: () => {
|
592
|
+
it('When user hovers over insert text button, then \'Insert text\' tooltip should be displayed', () => {
|
593
|
+
figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.insertTextAreaButton, 'Insert text');
|
594
|
+
});
|
595
|
+
},
|
596
|
+
|
597
|
+
verifyUndoRedoClearAllButtons: () => {
|
598
|
+
it('Undo, redo and clear all buttons should be displayed', () => {
|
599
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.undoButton(), 'visible');
|
600
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.redoButton(), 'visible');
|
601
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.clearAllButton(), 'visible');
|
602
|
+
});
|
603
|
+
|
604
|
+
it('When user hovers over undo button, then \'Undo\' tooltip should be displayed', () => {
|
605
|
+
utilities.hoverAwayFromElement(figOverImageCanvasComponent.canvasSelectedMenuText());
|
606
|
+
figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.undoButton, 'Undo');
|
607
|
+
});
|
608
|
+
|
609
|
+
it('When user hovers over clear all button, then \'Clear all\' tooltip should be displayed', () => {
|
610
|
+
figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.clearAllButton, 'Clear all');
|
611
|
+
});
|
612
|
+
|
613
|
+
it('When user hovers over redo button, then \'Redo\' tooltip should be displayed', () => {
|
614
|
+
utilities.hoverAwayFromElement(figOverImageCanvasComponent.undoButton());
|
615
|
+
figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.redoButton, 'Redo');
|
616
|
+
});
|
617
|
+
},
|
618
|
+
|
619
|
+
verifyCanvasResponseAreaContents: () => {
|
620
|
+
it('When user clicks inside canvas, then one response container should be added with pointer, close button and numeration.', () => {
|
621
|
+
figOverImageCanvasComponent.steps.insertResponseArea(80);
|
622
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 1);
|
623
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseArea(), 'visible');
|
624
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaPointer(), 'visible');
|
625
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.removeResponseAreaButton(), 'visible');
|
626
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.responseAreaNumerationText(), '1');
|
627
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaNumerationText(), 'visible');
|
628
|
+
});
|
629
|
+
},
|
630
|
+
|
631
|
+
/**
|
632
|
+
* @param {"text container"|"dropzone"} response value for the error message
|
633
|
+
*/
|
634
|
+
verifyInsertAndDeleteResponseAreaFunctionality: (response) => {
|
635
|
+
it(`When user clicks on close button for response container, then response container should be removed from canvas and error message 'Error: Please insert a ${response}.' should be displayed`, () => {
|
636
|
+
figOverImageCanvasComponent.steps.removeResponseArea(0);
|
637
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaWrapper(), 'notExist');
|
638
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
|
639
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
640
|
+
});
|
641
|
+
|
642
|
+
it('When user adds response container, then error message should disappear', () => {
|
643
|
+
figOverImageCanvasComponent.steps.insertResponseArea(80);
|
644
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
645
|
+
});
|
646
|
+
|
647
|
+
it('User should be able to add maximum 20 multiple response containers inside canvas', () => {
|
648
|
+
for (let i = 0; i < 21; i++) {
|
649
|
+
figOverImageCanvasComponent.steps.insertResponseArea(i * 2);
|
650
|
+
}
|
651
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 20);
|
652
|
+
});
|
653
|
+
|
654
|
+
it('When user clicks on close button for a response container, then response container should disappear and numeration for existing response containers should be changed appropriately', () => {
|
655
|
+
figOverImageCanvasComponent.steps.removeResponseArea(0);
|
656
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseAreaWrapper(), 19);
|
657
|
+
for (let i = 0; i < 19; i++) {
|
658
|
+
utilities.verifyInnerText(utilities.getNthElement(figOverImageCanvasComponent.responseAreaNumerationText(), i), `${i + 1}`);
|
659
|
+
}
|
660
|
+
});
|
661
|
+
},
|
662
|
+
|
663
|
+
/**
|
664
|
+
* @param {"text container"|"dropzone"} response value for the error message
|
665
|
+
*/
|
666
|
+
verifyUndoRedoClearAllButtonFunctionality: (response) => {
|
667
|
+
it('When the user has not made any changes in the canvas, the \'Undo\' and \'Redo\' button should be in disabled state', () => {
|
668
|
+
figOverImageCanvasComponent.steps.verifyUndoButtonDisabled();
|
669
|
+
figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
|
670
|
+
});
|
671
|
+
|
672
|
+
it('When user adds dropzone inside canvas, the \'Undo\' button should get enabled but the \'Redo\' button should continue to stay in disabled state', () => {
|
673
|
+
figOverImageCanvasComponent.steps.insertResponseArea(80);
|
674
|
+
figOverImageCanvasComponent.steps.insertResponseArea(20);
|
675
|
+
figOverImageCanvasComponent.steps.insertResponseArea(30);
|
676
|
+
figOverImageCanvasComponent.steps.insertResponseArea(40);
|
677
|
+
figOverImageCanvasComponent.steps.verifyUndoButtonEnabled();
|
678
|
+
figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
|
679
|
+
});
|
680
|
+
|
681
|
+
it('When the user clicks on the \'Undo\' button, then previous action should be reversed and redo button should be in enabled state', () => {
|
682
|
+
figOverImageCanvasComponent.steps.undoAction();
|
683
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 3);
|
684
|
+
utilities.verifyElementNotDisabled(figOverImageCanvasComponent.redoButton());
|
685
|
+
});
|
686
|
+
|
687
|
+
it('When the user clicks on the redo button, then previous action should be reinstated and redo button should be disabled', () => {
|
688
|
+
figOverImageCanvasComponent.steps.redoAction()
|
689
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 4);
|
690
|
+
figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
|
691
|
+
});
|
692
|
+
|
693
|
+
it(`When the user reaches the initial state by performing undo actions, the \'Undo\' button should get disabled and error message \'Error: Please insert a ${response}.\' should be displayed`, () => {
|
694
|
+
for (var i = 0; i < 4; i++) {
|
695
|
+
figOverImageCanvasComponent.steps.undoAction();
|
696
|
+
}
|
697
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 0);
|
698
|
+
figOverImageCanvasComponent.steps.verifyUndoButtonDisabled();
|
699
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
|
700
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
701
|
+
});
|
702
|
+
|
703
|
+
it('When the user reaches the latest state by performing redo actions, the \'Redo\' button should get disabled and error message should disappear', () => {
|
704
|
+
for (var i = 0; i < 4; i++) {
|
705
|
+
figOverImageCanvasComponent.steps.redoAction();
|
706
|
+
}
|
707
|
+
utilities.verifyElementCount(figOverImageCanvasComponent.responseArea(), 4);
|
708
|
+
figOverImageCanvasComponent.steps.verifyRedoButtonDisabled();
|
709
|
+
commonComponents.steps.verifyErrorMessageIsNotDisplayed();
|
710
|
+
});
|
711
|
+
|
712
|
+
it(`When user clicks on \'Clear all\' button, then all response container should be deleted and error message 'Error: Please insert a ${response}.' should be displayed`, () => {
|
713
|
+
figOverImageCanvasComponent.steps.clearAll();
|
714
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaWrapper(), 'notExist');
|
715
|
+
utilities.verifyInnerText(commonComponents.errorMessage(), `Error: Please insert a ${response}.`);
|
716
|
+
utilities.verifyElementVisibilityState(commonComponents.errorMessage(), 'visible');
|
717
|
+
});
|
718
|
+
},
|
719
|
+
|
720
|
+
verifyInsertTextAndTextColorButton: () => {
|
721
|
+
it('When user clicks on \'Insert text\' button, then \'Text\' menu label and \'Text color\' icon should be displayed.', () => {
|
722
|
+
figOverImageCanvasComponent.steps.selectCanvasMenuButton('Insert text');
|
723
|
+
cy.log('Clicking on canvas Selected Menu Text to hover away from select dropzone button');
|
724
|
+
figOverImageCanvasComponent.steps.clickOnCanvasSelectedMenuText();
|
725
|
+
figOverImageCanvasComponent.steps.verifyCanvasSelectedMenuText('Text');
|
726
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.responseAreaStyle(), 'visible');
|
727
|
+
});
|
728
|
+
|
729
|
+
it('\'Text color\' button should be in disabled state.', () => {
|
730
|
+
utilities.verifyElementDisabled(figOverImageCanvasComponent.responseAreaStyle());
|
731
|
+
});
|
732
|
+
|
733
|
+
it('When user hovers over \'Text color\' button, then \'Text color\' tooltip should be displayed.', () => {
|
734
|
+
figOverImageCanvasComponent.steps.verifyTooltipInnerText(figOverImageCanvasComponent.responseAreaStyle, 'Text color');
|
735
|
+
});
|
736
|
+
},
|
737
|
+
|
738
|
+
verifyTextColorPopupFunctionality: () => {
|
739
|
+
it('When user clicks inside the canvas, then text box should be displayed and \'Text color\' button should be enabled', () => {
|
740
|
+
figOverImageCanvasComponent.steps.insertTextArea(80, 'Inserted text');
|
741
|
+
figOverImageCanvasComponent.steps.verifyTextOfTextBox('Inserted text');
|
742
|
+
utilities.verifyElementNotDisabled(figOverImageCanvasComponent.responseAreaStyle());
|
743
|
+
});
|
744
|
+
|
745
|
+
it('Text color of text inside text box should be black by default', () => {
|
746
|
+
figOverImageCanvasComponent.steps.verifyTextColorOfTextBox('rgb(0, 0, 46)');
|
747
|
+
});
|
748
|
+
|
749
|
+
it('When user clicks on \'Text color\' button, \'Text color\' popup should be displayed.', () => {
|
750
|
+
figOverImageCanvasComponent.steps.clickOnTextColorButton();
|
751
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorPopupWrapper(), 'visible');
|
752
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.textColorLabelInTextColorPopup(), 'Text color');
|
753
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.textColorLabelInTextColorPopup(), 'visible');
|
754
|
+
});
|
755
|
+
|
756
|
+
it('\'Edit color\' label and Black color block should be displayed in selected state in the popup', () => {
|
757
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.editColorLabel(), 'Edit color');
|
758
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.editColorLabel(), 'visible');
|
759
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.selectedColorBlockInTextColorPopup(), 'visible');
|
760
|
+
figOverImageCanvasComponent.steps.verifyColorBlock('rgb(0, 0, 46)');
|
761
|
+
figOverImageCanvasComponent.steps.verifyColorBlockSelectedState();
|
762
|
+
});
|
763
|
+
},
|
764
|
+
|
765
|
+
verifySelectColorPopupContentAndFunctionality: () => {
|
766
|
+
|
767
|
+
it('When the user clicks on the \'Edit color\' present in an \'Text color\' popup, then a select color popup should be displayed', () => {
|
768
|
+
figOverImageCanvasComponent.steps.clickOnEditColorButton();
|
769
|
+
colorPopupComponent.steps.verifyColorPopupIsDisplayed();
|
770
|
+
});
|
771
|
+
|
772
|
+
it('A title \'Select color\' should be displayed on the color popup', () => {
|
773
|
+
colorPopupComponent.steps.verifyColorPopupSelectColorTitle();
|
774
|
+
});
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
it('A \'Color hue palette\' should be displayed on the color popup along with a color picker and the color picker should be set on the selected color', () => {
|
779
|
+
colorPopupComponent.steps.verifyColorHuePaletteAndPicker();
|
780
|
+
colorPopupComponent.steps.verifyHuePaletteColor('rgb(0, 0, 255)');
|
781
|
+
});
|
782
|
+
|
783
|
+
|
784
|
+
|
785
|
+
it('A \'Selected color\' label and color block displaying the selected color should be displayed', () => {
|
786
|
+
colorPopupComponent.steps.verifySelectedColorLabelAndSelectedColorBlock();
|
787
|
+
});
|
788
|
+
|
789
|
+
it('A \'Hex\' label and input field with pre-filled hex code value of the selected color should be displayed', () => {
|
790
|
+
colorPopupComponent.steps.verifyHexLabelAndInputField();
|
791
|
+
colorPopupComponent.steps.verifyHexValue('#00002E');
|
792
|
+
});
|
793
|
+
|
794
|
+
it('\'Cancel\' and \'Ok\' buttons should be displayed', () => {
|
795
|
+
utilities.verifyInnerText(colorPopupComponent.cancelButton(), 'Cancel');
|
796
|
+
utilities.verifyElementVisibilityState(colorPopupComponent.cancelButton(), 'visible');
|
797
|
+
utilities.verifyInnerText(colorPopupComponent.okButton(), 'OK');
|
798
|
+
utilities.verifyElementVisibilityState(colorPopupComponent.okButton(), 'visible');
|
799
|
+
});
|
800
|
+
|
801
|
+
it('CSS of color popup contents', { tags: 'css' }, () => {
|
802
|
+
labels.forEach(label => {
|
803
|
+
utilities.verifyCSS(label(), {
|
804
|
+
'color': css.color.labels,
|
805
|
+
'font-size': css.fontSize.normal,
|
806
|
+
'font-weight': css.fontWeight.semibold
|
807
|
+
});
|
808
|
+
});
|
809
|
+
inputFields.forEach(inputField => {
|
810
|
+
utilities.verifyCSS(inputField(), {
|
811
|
+
'color': css.color.text,
|
812
|
+
'font-size': css.fontSize.default,
|
813
|
+
'font-weight': css.fontWeight.regular
|
814
|
+
});
|
815
|
+
});
|
816
|
+
utilities.verifyCSS(colorPopupComponent.okButton(), {
|
817
|
+
'color': css.color.whiteText,
|
818
|
+
'font-size': css.fontSize.default,
|
819
|
+
'font-weight': css.fontWeight.regular,
|
820
|
+
'background-color': css.color.activeButtons
|
821
|
+
});
|
822
|
+
utilities.verifyCSS(colorPopupComponent.cancelButton(), {
|
823
|
+
'color': css.color.secondaryBtn,
|
824
|
+
'font-size': css.fontSize.default,
|
825
|
+
'font-weight': css.fontWeight.semibold,
|
826
|
+
'background-color': css.color.transparent
|
827
|
+
});
|
828
|
+
});
|
829
|
+
|
830
|
+
it('Accessibility of color popup contents', { tags: 'a11y' }, () => {
|
831
|
+
cy.checkAccessibility(dialogBoxBase.dialogBox());
|
832
|
+
});
|
833
|
+
|
834
|
+
|
835
|
+
},
|
836
|
+
|
837
|
+
verifyImagePropertiesSectionContent: () => {
|
838
|
+
it('\'Image properties\' label should be displayed.', () => {
|
839
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.imagePropertiesLabel(), 'Image properties');
|
840
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imagePropertiesLabel(), 'visible');
|
841
|
+
});
|
842
|
+
|
843
|
+
it('\'Fill image to canvas\' label and checkbox should be displayed and checkbox should be unchecked by default', () => {
|
844
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.fillImageToCanvasLabel(), 'visible');
|
845
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.fillImageToCanvasLabel(), 'Fill image to canvas');
|
846
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.fillImageToCanvasCheckbox(), 'exist');
|
847
|
+
figOverImageCanvasComponent.steps.verifyFillImageToCanvasCheckboxUnchecked();
|
848
|
+
});
|
849
|
+
|
850
|
+
it('User should be able to check \'Fill image to canvas\' checkbox', () => {
|
851
|
+
figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
|
852
|
+
});
|
853
|
+
|
854
|
+
it('\'Lock aspect ratio\' and \'Reset dimensions\' buttons should be displayed and by default \'Lock aspect ratio\' button should be locked', () => {
|
855
|
+
utilities.verifyElementVisibilityState(imageActionsComponent.lockAspectRatioButton(), 'visible');
|
856
|
+
utilities.verifyElementVisibilityState(imageActionsComponent.resetDimensionsButton(), 'visible');
|
857
|
+
});
|
858
|
+
|
859
|
+
it('\'Image alignment\' label should be displayed. ', () => {
|
860
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.imageAlignmentLabel(), 'Image alignment');
|
861
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlignmentLabel(), 'visible');
|
862
|
+
});
|
863
|
+
|
864
|
+
it(`\'Image alignment\' section should have three options ${alignmentOptions} and ${alignmentOptions[0]} should be active selection by default`, () => {
|
865
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.topLeftAlignmentButton(), 'Top left');
|
866
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.topLeftAlignmentButton(), 'visible');
|
867
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.centerAlignmentButton(), 'Center');
|
868
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.centerAlignmentButton(), 'visible');
|
869
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.topRightAlignmentButton(), 'Top right');
|
870
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.topRightAlignmentButton(), 'visible');
|
871
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
|
872
|
+
});
|
873
|
+
|
874
|
+
it('\'Image alternative text\' label and input field should be displayed. By default input field should be empty', () => {
|
875
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.imageAlternativeTextLabel(), 'Image alternative text');
|
876
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlternativeTextLabel(), 'visible');
|
877
|
+
utilities.verifyInnerText(figOverImageCanvasComponent.imageAlternativeTextInputField(), '');
|
878
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.imageAlternativeTextInputField(), 'exist');
|
879
|
+
});
|
880
|
+
|
881
|
+
it('User should be able to enter text in \'Image alternative text\' input field', () => {
|
882
|
+
figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('Image description');
|
883
|
+
});
|
884
|
+
},
|
885
|
+
|
886
|
+
verifyImageAlignmentEditTabFunctionality: () => {
|
887
|
+
it('When \'Top left\' image alignment is selected by default, then image should be aligned to top left inside the canvas', () => {
|
888
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
|
889
|
+
});
|
890
|
+
|
891
|
+
it('When user selects \'Center\' image alignment, then image should be aligned to center inside the canvas', () => {
|
892
|
+
figOverImageCanvasComponent.steps.selectCenterImageAlignment();
|
893
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageCenterAligned();
|
894
|
+
});
|
895
|
+
|
896
|
+
it('When user selects \'Top right\' image alignment, then image should be aligned to top right inside the canvas', () => {
|
897
|
+
figOverImageCanvasComponent.steps.selectTopRightImageAlignment();
|
898
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopRightAligned();
|
899
|
+
});
|
900
|
+
|
901
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas', () => {
|
902
|
+
figOverImageCanvasComponent.steps.selectTopLeftImageAlignment();
|
903
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAligned();
|
904
|
+
});
|
905
|
+
},
|
906
|
+
|
907
|
+
verifyFillImageToCanvasEditTabFunctionality: () => {
|
908
|
+
it('When user checks \'Fill image to canvas\' checkbox, then image should be adjusted to fit inside the canvas', () => {
|
909
|
+
figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox();
|
910
|
+
figOverImageCanvasComponent.steps.verifyImageFitsToCanvas();
|
911
|
+
});
|
912
|
+
|
913
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state', () => {
|
914
|
+
figOverImageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
|
915
|
+
figOverImageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
|
916
|
+
});
|
917
|
+
},
|
918
|
+
|
919
|
+
verifyAspectRatioAndResetDimensionsButtonFunctionality: () => {
|
920
|
+
it('When aspect ratio is unlocked and user changes the value in width input field, the height input field should remain unchanged and the dimensions should be updated in the image popup preview section', () => {
|
921
|
+
figOverImageCanvasComponent.steps.unlockAspectRatio();
|
922
|
+
figOverImageCanvasComponent.steps.updateCanvasWidth(500);
|
923
|
+
figOverImageCanvasComponent.steps.verifyCanvasWidth(500);
|
924
|
+
figOverImageCanvasComponent.steps.verifyCanvasHeight(432);
|
925
|
+
});
|
926
|
+
|
927
|
+
it('When aspect ratio is unlocked and user changes the value in height input field, then width input field should remain unchanged and the dimensions should be updated in the image popup preview section', () => {
|
928
|
+
figOverImageCanvasComponent.steps.updateCanvasHeight(500);
|
929
|
+
figOverImageCanvasComponent.steps.verifyCanvasHeight(500);
|
930
|
+
figOverImageCanvasComponent.steps.verifyCanvasWidth(500);
|
931
|
+
});
|
932
|
+
|
933
|
+
it('When user locks the aspect ratio button and changes the value in the width input field, the height input field should be updated accordingly to maintain the updated aspect ratio', () => {
|
934
|
+
figOverImageCanvasComponent.steps.lockAspectRatio();
|
935
|
+
figOverImageCanvasComponent.steps.updateCanvasWidth(800);
|
936
|
+
figOverImageCanvasComponent.steps.verifyCanvasHeight(450);
|
937
|
+
});
|
938
|
+
|
939
|
+
it('When user selects the \'Reset dimensions\' button the height and width should reset to the original values', () => {
|
940
|
+
figOverImageCanvasComponent.steps.resetDimensions();
|
941
|
+
figOverImageCanvasComponent.steps.verifyCanvasWidth(768);
|
942
|
+
figOverImageCanvasComponent.steps.verifyCanvasHeight(432);
|
943
|
+
});
|
944
|
+
},
|
945
|
+
|
946
|
+
verifyImageAlternativeTextEditTabFunctionality: () => {
|
947
|
+
it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed for canvas image', () => {
|
948
|
+
figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
|
949
|
+
figOverImageCanvasComponent.steps.verifyImageAlternativeTextPresentInEditTab('This is Alternative text for image');
|
950
|
+
});
|
951
|
+
|
952
|
+
it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed for canvas image', () => {
|
953
|
+
figOverImageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
|
954
|
+
figOverImageCanvasComponent.steps.verifyNoImageAlternativeTextPresentInEditTab();
|
955
|
+
});
|
956
|
+
},
|
957
|
+
|
958
|
+
verifyImageAlignmentPreviewTabFunctionality: () => {
|
959
|
+
it('When \'Top left\' image alignment is selected by default, then in preview tab canvas image should be aligned to top left', () => {
|
960
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
961
|
+
figOverImageCanvasComponent.steps.verifyImageIsUploadedInPreviewTab();
|
962
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
|
963
|
+
});
|
964
|
+
|
965
|
+
it('When user selects \'Center\' image alignment in edit tab, then canvas image should be aligned to center in preview tab ', () => {
|
966
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
967
|
+
figOverImageCanvasComponent.steps.selectCenterImageAlignment();
|
968
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
969
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageCenterAlignedInPreviewTab();
|
970
|
+
});
|
971
|
+
|
972
|
+
it('When user selects \'Top right\' image alignment, then canvas image should be aligned to top right in preview tab', () => {
|
973
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
974
|
+
figOverImageCanvasComponent.steps.selectTopRightImageAlignment();
|
975
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
976
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopRightAlignedInPreviewTab();
|
977
|
+
});
|
978
|
+
|
979
|
+
it('When user selects \'Top left\' image alignment again, then image should be aligned to top left inside the canvas in preview tab', () => {
|
980
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
981
|
+
figOverImageCanvasComponent.steps.selectTopLeftImageAlignment();
|
982
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
983
|
+
figOverImageCanvasComponent.steps.verifyCanvasImageTopLeftAlignedInPreviewTab();
|
984
|
+
});
|
985
|
+
},
|
986
|
+
|
987
|
+
verifyFillImageToCanvasPreviewTabFunctionality: () => {
|
988
|
+
it('When user checks \'Fill image to canvas\' checkbox in edit tab, then image should be adjusted to fit inside the canvas in preview tab', () => {
|
989
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
990
|
+
figOverImageCanvasComponent.steps.checkFillImageToCanvasCheckbox(); figOverImageCanvasComponent.steps.switchToPreviewTab();
|
991
|
+
figOverImageCanvasComponent.steps.verifyImageFitsToCanvasInPreviewTab();
|
992
|
+
});
|
993
|
+
|
994
|
+
// Failed due to https://redmine.zeuslearning.com/issues/556897
|
995
|
+
it('When user unchecks \'Fill image to canvas\' checkbox, then image dimensions should set to default state in preview tab', () => {
|
996
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
997
|
+
figOverImageCanvasComponent.steps.uncheckFillImageToCanvasCheckbox();
|
998
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
999
|
+
figOverImageCanvasComponent.steps.verifyImageDoesNotFitToCanvas();
|
1000
|
+
});
|
1001
|
+
},
|
1002
|
+
|
1003
|
+
verifyImageAlternativeTextPreviewTabFunctionality: () => {
|
1004
|
+
it('When user enters text in the \'Alternative text\' input field, then alternative text should be displayed in the \'Preview tab\'', () => {
|
1005
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
1006
|
+
figOverImageCanvasComponent.steps.enterAndVerifyImageAlternativeTextInInputField('This is Alternative text for image');
|
1007
|
+
cy.log('Switching to Preview Tab');
|
1008
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
1009
|
+
figOverImageCanvasComponent.steps.verifyImageAlternativeTextInPreviewTab('This is Alternative text for image');
|
1010
|
+
});
|
1011
|
+
|
1012
|
+
it('When user clears text in the \'Alternative text\' input field, then alternative text should not be displayed in the \'Preview tab\'', () => {
|
1013
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
1014
|
+
figOverImageCanvasComponent.steps.clearImageAlternativeTextInputFieldText();
|
1015
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
1016
|
+
figOverImageCanvasComponent.steps.verifyNoImageAlternativeTextPresentInPreviewTab();
|
1017
|
+
});
|
1018
|
+
},
|
1019
|
+
|
1020
|
+
verifyImageOpacityPreviewTabFunctionality: () => {
|
1021
|
+
it('When opacity is 100 percent by default, then canvas image should have 100 percent opacity in preview tab ', () => {
|
1022
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(100);
|
1023
|
+
});
|
1024
|
+
|
1025
|
+
it('When user changes opacity slider value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
|
1026
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
1027
|
+
figOverImageCanvasComponent.steps.clickActionOnOpacitySlider();
|
1028
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
1029
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(50);
|
1030
|
+
});
|
1031
|
+
|
1032
|
+
it('When user changes opacity input field value in edit tab, then opacity for canvas image should change accordingly in preview tab ', () => {
|
1033
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
1034
|
+
figOverImageCanvasComponent.steps.enterInputToOpacityInputField(40);
|
1035
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
1036
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImageInPreviewTab(40);
|
1037
|
+
});
|
1038
|
+
},
|
1039
|
+
|
1040
|
+
verifyImageOpacityEditTabFunctionality: () => {
|
1041
|
+
it('When opacity value is set to 100 percent by default, then opacity for image should be100 percent inside canvas', () => {
|
1042
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(100);
|
1043
|
+
});
|
1044
|
+
|
1045
|
+
it('When user changes opacity slider value , then opacity for image should be updated accordingly', () => {
|
1046
|
+
figOverImageCanvasComponent.steps.clickActionOnOpacitySlider();
|
1047
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(50);
|
1048
|
+
});
|
1049
|
+
|
1050
|
+
it('When user changes opacity value in input field, then opacity for image should be updated accordingly', () => {
|
1051
|
+
figOverImageCanvasComponent.steps.enterInputToOpacityInputField(40);
|
1052
|
+
figOverImageCanvasComponent.steps.verifyOpacityInputFieldValue(40);
|
1053
|
+
figOverImageCanvasComponent.steps.verifyOpacityValueForCanvasImage(40);
|
1054
|
+
});
|
1055
|
+
},
|
1056
|
+
|
1057
|
+
verifyImageNotExistPreviewTab: () => {
|
1058
|
+
it('When user deletes the uploaded image file in edit tab, then canvas image should not appear in preview tab', () => {
|
1059
|
+
figOverImageCanvasComponent.steps.switchToEditTab();
|
1060
|
+
backgroundImageUploadComponent.steps.deleteImage();
|
1061
|
+
backgroundImageUploadComponent.steps.clickOnDeleteButtonInDeleteImagePopup();
|
1062
|
+
figOverImageCanvasComponent.steps.switchToPreviewTab();
|
1063
|
+
utilities.verifyElementVisibilityState(figOverImageCanvasComponent.canvasImageInPreviewTab(), 'notExist');
|
1064
|
+
});
|
1065
|
+
},
|
1066
|
+
}
|
1067
|
+
|
616
1068
|
export const figOverImageCanvasComponent = {
|
617
1069
|
...selectors,
|
618
|
-
steps
|
1070
|
+
steps,
|
1071
|
+
tests
|
619
1072
|
}
|