From 23de3240adf5ae9503789e16a985617ab68de985 Mon Sep 17 00:00:00 2001 From: manzil-infinity180 Date: Thu, 11 Jul 2024 23:48:12 +0530 Subject: [PATCH 1/2] change for ci --- .../Cypress-Gradeable/rainbow_grading.spec.js | 95 +++++++++---------- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js b/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js index 4579aae9ec9..0ffeaea4e2a 100644 --- a/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js +++ b/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js @@ -1,55 +1,52 @@ -import { skipOn } from '@cypress/skip-test'; -skipOn(Cypress.env('run_area') === 'CI', () => { - describe('Test Rainbow Grading', () => { - beforeEach(() => { - cy.login('instructor'); - cy.visit(['sample', 'config']); +describe('Test Rainbow Grading', () => { + beforeEach(() => { + cy.login('instructor'); + cy.visit(['sample', 'config']); + }); + it('Enable viewing of rainbow grades and generating the rainbow grading', () => { + cy.get('[data-testid="display-rainbow-grades-summary"]').check(); + cy.visit(['sample', 'reports', 'rainbow_grades_customization']); + cy.get('[data-testid="display-rainbow-grades-summary"]').should('be.checked'); + cy.get('[data-testid="display-grade-summary"]').check(); + cy.get('[data-testid="display-grade-summary"]').should('be.checked'); + cy.get('[data-testid="display-grade-details"]').check(); + cy.get('[data-testid="display-benchmarks-average"]').check(); + cy.get('[data-testid="display-benchmarks-stddev"]').check(); + cy.get('[data-testid="display-benchmarks-perfect"]').check(); + cy.get('[data-testid="save-status-button"]').click(); + cy.get('[data-testid="save-status"]', { timeout: 15000 }).should('contain', 'Rainbow grades successfully generated!'); + cy.visit(['sample', 'grades']); + ['USERNAME', 'NUMERIC ID', 'AVERAGE', 'STDDEV', 'PERFECT'].forEach((fields) => { + cy.get('[data-testid="rainbow-grades"]').should('contain', fields); }); - it('Enable viewing of rainbow grades and generating the rainbow grading', () => { - cy.get('[data-testid="display-rainbow-grades-summary"]').check(); - cy.visit(['sample', 'reports', 'rainbow_grades_customization']); - cy.get('[data-testid="display-rainbow-grades-summary"]').should('be.checked'); - cy.get('[data-testid="display-grade-summary"]').check(); - cy.get('[data-testid="display-grade-summary"]').should('be.checked'); - cy.get('[data-testid="display-grade-details"]').check(); - cy.get('[data-testid="display-benchmarks-average"]').check(); - cy.get('[data-testid="display-benchmarks-stddev"]').check(); - cy.get('[data-testid="display-benchmarks-perfect"]').check(); - cy.get('[data-testid="save-status-button"]').click(); - cy.get('[data-testid="save-status"]', { timeout: 15000 }).should('contain', 'Rainbow grades successfully generated!'); - cy.visit(['sample', 'grades']); - ['USERNAME', 'NUMERIC ID', 'AVERAGE', 'STDDEV', 'PERFECT'].forEach((fields) => { - cy.get('[data-testid="rainbow-grades"]').should('contain', fields); - }); - cy.get('[data-testid="rainbow-grades"]').should('contain', 'Information last updated'); - ['ta', 'student', 'grader', 'instructor'].forEach((username) => { - cy.logout(); - cy.login(username); - cy.visit(['sample', 'grades']); - cy.get('[data-testid="rainbow-grades"]').should('contain', `Lecture Participation Polls for: ${username}`); - if (username === 'instructor') { - checkRainbowGrades('instructor', 801516157, 'Quinn', 'Instructor'); - checkRainbowGradesOption(); - } - else if (username === 'ta') { - checkRainbowGrades('ta', 281179137, 'Jill', 'TA'); - checkRainbowGradesOption(); - } - else if (username === 'student') { - checkRainbowGrades('student', 'student', 410853871, 'Joe', 'Student'); - checkRainbowGradesOption(); - } - else if (username === 'grader') { - checkRainbowGrades('grader', 10306042, 'Tim', 'Grader'); - checkRainbowGradesOption(); - } - }); - cy.visit(['sample', 'config']); - cy.get('[data-testid="display-rainbow-grades-summary"]').uncheck(); - cy.get('[data-testid="display-rainbow-grades-summary"]').should('not.be.checked'); + cy.get('[data-testid="rainbow-grades"]').should('contain', 'Information last updated'); + ['ta', 'student', 'grader', 'instructor'].forEach((username) => { + cy.logout(); + cy.login(username); cy.visit(['sample', 'grades']); - cy.get('[data-testid="rainbow-grades"]').should('contain', 'No grades are available...'); + cy.get('[data-testid="rainbow-grades"]').should('contain', `Lecture Participation Polls for: ${username}`); + if (username === 'instructor') { + checkRainbowGrades('instructor', 801516157, 'Quinn', 'Instructor'); + checkRainbowGradesOption(); + } + else if (username === 'ta') { + checkRainbowGrades('ta', 281179137, 'Jill', 'TA'); + checkRainbowGradesOption(); + } + else if (username === 'student') { + checkRainbowGrades('student', 'student', 410853871, 'Joe', 'Student'); + checkRainbowGradesOption(); + } + else if (username === 'grader') { + checkRainbowGrades('grader', 10306042, 'Tim', 'Grader'); + checkRainbowGradesOption(); + } }); + cy.visit(['sample', 'config']); + cy.get('[data-testid="display-rainbow-grades-summary"]').uncheck(); + cy.get('[data-testid="display-rainbow-grades-summary"]').should('not.be.checked'); + cy.visit(['sample', 'grades']); + cy.get('[data-testid="rainbow-grades"]').should('contain', 'No grades are available...'); }); }); const checkRainbowGrades = (username, numericId, firstName, lastname) => { From 67e35934f7261f832a49f7d5672257d67ecc622d Mon Sep 17 00:00:00 2001 From: Rahul Vishwakarma Date: Tue, 23 Jul 2024 18:22:50 +0530 Subject: [PATCH 2/2] Update rainbow_grading.spec.js --- .../e2e/Cypress-Gradeable/rainbow_grading.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js b/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js index 0ffeaea4e2a..ccafc4dd9f6 100644 --- a/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js +++ b/site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js @@ -1,11 +1,11 @@ describe('Test Rainbow Grading', () => { beforeEach(() => { cy.login('instructor'); - cy.visit(['sample', 'config']); + cy.visit(['tutorial', 'config']); }); it('Enable viewing of rainbow grades and generating the rainbow grading', () => { cy.get('[data-testid="display-rainbow-grades-summary"]').check(); - cy.visit(['sample', 'reports', 'rainbow_grades_customization']); + cy.visit(['tutorial', 'reports', 'rainbow_grades_customization']); cy.get('[data-testid="display-rainbow-grades-summary"]').should('be.checked'); cy.get('[data-testid="display-grade-summary"]').check(); cy.get('[data-testid="display-grade-summary"]').should('be.checked'); @@ -15,7 +15,7 @@ describe('Test Rainbow Grading', () => { cy.get('[data-testid="display-benchmarks-perfect"]').check(); cy.get('[data-testid="save-status-button"]').click(); cy.get('[data-testid="save-status"]', { timeout: 15000 }).should('contain', 'Rainbow grades successfully generated!'); - cy.visit(['sample', 'grades']); + cy.visit(['tutorial', 'grades']); ['USERNAME', 'NUMERIC ID', 'AVERAGE', 'STDDEV', 'PERFECT'].forEach((fields) => { cy.get('[data-testid="rainbow-grades"]').should('contain', fields); }); @@ -23,7 +23,7 @@ describe('Test Rainbow Grading', () => { ['ta', 'student', 'grader', 'instructor'].forEach((username) => { cy.logout(); cy.login(username); - cy.visit(['sample', 'grades']); + cy.visit(['tutorial', 'grades']); cy.get('[data-testid="rainbow-grades"]').should('contain', `Lecture Participation Polls for: ${username}`); if (username === 'instructor') { checkRainbowGrades('instructor', 801516157, 'Quinn', 'Instructor'); @@ -42,10 +42,10 @@ describe('Test Rainbow Grading', () => { checkRainbowGradesOption(); } }); - cy.visit(['sample', 'config']); + cy.visit(['tutorial', 'config']); cy.get('[data-testid="display-rainbow-grades-summary"]').uncheck(); cy.get('[data-testid="display-rainbow-grades-summary"]').should('not.be.checked'); - cy.visit(['sample', 'grades']); + cy.visit(['tutorial', 'grades']); cy.get('[data-testid="rainbow-grades"]').should('contain', 'No grades are available...'); }); });