itemengine-cypress-automation 1.0.555-IEI-7011-1ad4f1a.0 → 1.0.555-IEI-7011-ce17b8f.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itemengine-cypress-automation",
3
- "version": "1.0.555-IEI-7011-1ad4f1a.0",
3
+ "version": "1.0.555-IEI-7011-ce17b8f.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,78 +0,0 @@
1
- import { singleSelectionPage } from "../pages/singleSelectionPage";
2
-
3
- /**
4
- * Example usage of the "Show alternative answers" toggle methods
5
- * This demonstrates how to verify the presence and functionality of the toggle component
6
- */
7
-
8
- describe('Show Alternative Answers Toggle - Example Usage', () => {
9
- before(() => {
10
- cy.loginAs('admin');
11
- // Navigate to a single selection question with alternative answers
12
- singleSelectionPage.steps.navigateToCreateQuestion('single selection');
13
- cy.barsPreLoaderWait();
14
-
15
- // Set up a question with alternative answers
16
- singleSelectionPage.steps.addTextInQuestionInstructionsInputField('Which of the following is the major contributor to increased carbon dioxide levels because of urbanization? Select your answer from the options below.');
17
- const options = ['Pollution caused by treating chemical waste', 'Pollution caused by cement production', 'Pollution caused by methane production', 'Pollution caused by cement and methane production'];
18
- singleSelectionPage.steps.addInputToOptionsInputField(options);
19
- singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(1);
20
- singleSelectionPage.steps.allotPoints(20);
21
- singleSelectionPage.steps.clickOnAddAlternativeAnswerButton();
22
- singleSelectionPage.steps.allotPoints(10);
23
- singleSelectionPage.steps.checkOptionInSpecifyCorrectAnswerSection(2);
24
- singleSelectionPage.steps.switchToPreviewTab();
25
- });
26
-
27
- it('Should verify the "Show alternative answers" toggle exists and has correct label', () => {
28
- // Verify the toggle component is present with correct label
29
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleExists();
30
- });
31
-
32
- it('Should verify the toggle is initially unchecked', () => {
33
- // Verify the toggle starts in unchecked state
34
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
35
- });
36
-
37
- it('Should be able to click the toggle to enable it', () => {
38
- // Click the toggle to enable it
39
- singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
40
-
41
- // Verify it's now checked
42
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
43
- });
44
-
45
- it('Should be able to click the toggle to disable it', () => {
46
- // Click the toggle again to disable it
47
- singleSelectionPage.steps.clickShowAlternativeAnswersToggle();
48
-
49
- // Verify it's now unchecked
50
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
51
- });
52
-
53
- it('Should verify complete toggle functionality', () => {
54
- // Test the complete functionality in one method
55
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleFunctionality();
56
- });
57
-
58
- it('Should enable toggle if currently disabled', () => {
59
- // Ensure toggle is enabled (will click only if currently disabled)
60
- singleSelectionPage.steps.enableShowAlternativeAnswersToggle();
61
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleChecked();
62
- });
63
-
64
- it('Should disable toggle if currently enabled', () => {
65
- // Ensure toggle is disabled (will click only if currently enabled)
66
- singleSelectionPage.steps.disableShowAlternativeAnswersToggle();
67
- singleSelectionPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
68
- });
69
-
70
- it('Should verify alternative answers section when incorrectly answered', () => {
71
- // Answer the question incorrectly to trigger alternative answers display
72
- singleSelectionPage.steps.checkOptionInPreviewTab(0);
73
- singleSelectionPage.steps.switchToGradingView();
74
-
75
- // Verify the alternative answers section is visible
76
- singleSelectionPage.steps.verifyAlternativeAnswersSection();
77
- });
78
- });