itemengine-cypress-automation 1.0.352-IEI-6059-a5d8e8c.0 → 1.0.352-IEI-6088-3cb25eb.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.
@@ -1,4 +1,4 @@
1
- import { multipleSelectionGridPage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { multipleSelectionGridPage, itemPreviewPage, studentViewPage, itemPrintPreviewPage } from "../../../pages";
2
2
  import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
@@ -194,6 +194,17 @@ describe('Create item page - Multiple selection grid: Preview contents', () => {
194
194
  it.skip('Accessibility of preview tab', { tags: 'a11y' }, () => {
195
195
  cy.checkAccessibility(multipleSelectionGridPage.tableCell());
196
196
  });
197
+
198
+ if (view === 'Item view') {
199
+ it(`The Print Preview button should be visible`, () => {
200
+ itemPrintPreviewPage.steps.verifyPrintPreviewButton();
201
+ });
202
+
203
+ it('User should be able to open print preview', () => {
204
+ itemPrintPreviewPage.steps.clickPrintPreviewButton();
205
+ itemPrintPreviewPage.steps.verifyNoPrintPreviewErrors();
206
+ });
207
+ }
197
208
  });
198
209
  });
199
210
  });
@@ -1,4 +1,4 @@
1
- import { singleSelectionGridPage, itemPreviewPage, studentViewPage } from "../../../pages";
1
+ import { singleSelectionGridPage, itemPreviewPage, studentViewPage, itemPrintPreviewPage } from "../../../pages";
2
2
  import { ckEditorToolbar, equationEditorFlyout } from "../../../pages/components";
3
3
  import abortEarlySetup from "../../../support/helpers/abortEarly";
4
4
  import utilities from "../../../support/helpers/utilities";
@@ -193,6 +193,17 @@ describe('Create item page - Single selection grid: Preview contents', () => {
193
193
  it.skip('Accessibility of preview tab', { tags: 'a11y' }, () => {
194
194
  cy.checkAccessibility(singleSelectionGridPage.tableCell());
195
195
  });
196
+
197
+ if (view === 'Item view') {
198
+ it(`The Print Preview button should be visible`, () => {
199
+ itemPrintPreviewPage.steps.verifyPrintPreviewButton();
200
+ });
201
+
202
+ it('User should be able to open print preview', () => {
203
+ itemPrintPreviewPage.steps.clickPrintPreviewButton();
204
+ itemPrintPreviewPage.steps.verifyNoPrintPreviewErrors();
205
+ });
206
+ }
196
207
  });
197
208
  });
198
209
  });
@@ -54,3 +54,4 @@ export * from './numberLineLabelPage';
54
54
  export * from './chartsDotPlotPage';
55
55
  export * from './imageHighlightPage';
56
56
  export * from './compassPage';
57
+ export * from './itemPrintPreviewPage';
@@ -0,0 +1,32 @@
1
+ // This file contains the selectors and steps for the item print preview page
2
+ const selectors = {
3
+ printPreviewButton: () => cy.get('button.ngie-button').contains(/^print preview$/i),
4
+ };
5
+
6
+ const steps = {
7
+ verifyPrintPreviewButton: () => {
8
+ itemPrintPreviewPage.printPreviewButton()
9
+ .should('exist')
10
+ .and('be.visible')
11
+ .and('contain.text', 'print preview')
12
+ .and('not.be.disabled');
13
+ },
14
+ clickPrintPreviewButton: () => {
15
+ itemPrintPreviewPage.printPreviewButton()
16
+ .should('exist')
17
+ .and('be.visible')
18
+ .and('contain.text', 'print preview')
19
+ .and('not.be.disabled')
20
+ .click();
21
+ },
22
+ verifyNoPrintPreviewErrors: () => {
23
+ // Check that error messages are not visible in the DOM
24
+ cy.contains('NGIE: Sorry, something went wrong.').should('not.exist');
25
+ cy.contains('NGIE: There was an error occured while rendering page.').should('not.exist');
26
+ },
27
+ };
28
+
29
+ export const itemPrintPreviewPage = {
30
+ ...selectors,
31
+ steps,
32
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.352-IEI-6059-a5d8e8c.0",
3
+ "version": "1.0.352-IEI-6088-3cb25eb.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {