From b20995304e89b471481f2d80c5c51586b4105e28 Mon Sep 17 00:00:00 2001 From: IDzyre Date: Mon, 22 Sep 2025 21:48:43 -0800 Subject: [PATCH 1/5] test --- site/cypress/e2e/Cypress-UI/sidebar.spec.js | 50 +++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/site/cypress/e2e/Cypress-UI/sidebar.spec.js b/site/cypress/e2e/Cypress-UI/sidebar.spec.js index bfbee31863a..1efc0bb5d05 100644 --- a/site/cypress/e2e/Cypress-UI/sidebar.spec.js +++ b/site/cypress/e2e/Cypress-UI/sidebar.spec.js @@ -100,29 +100,29 @@ function baseCourseSidebar(user, course) { describe('Test sidebars', () => { // Sample Course - it('Test student sidebars', () => { - baseCourseSidebar('student', 'sample'); - baseSidebar(); - notHaveInstructorSidebars(); - cy.visit(['sample']); - cy.get('[data-testid="sidebar"]').contains('Student Photos').should('not.exist'); - }); - - it('Test ta sidebars', () => { - baseCourseSidebar('ta', 'sample'); - baseSidebar(); - cy.visit(['sample']); - sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); - notHaveInstructorSidebars(); - }); - - it('Test instructor sidebars', () => { - baseCourseSidebar('instructor', 'sample'); - instructorSidebar(); - baseSidebar(); - cy.visit(['sample']); - sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); - }); + // it('Test student sidebars', () => { + // baseCourseSidebar('student', 'sample'); + // baseSidebar(); + // notHaveInstructorSidebars(); + // cy.visit(['sample']); + // cy.get('[data-testid="sidebar"]').contains('Student Photos').should('not.exist'); + // }); + + // it('Test ta sidebars', () => { + // baseCourseSidebar('ta', 'sample'); + // baseSidebar(); + // cy.visit(['sample']); + // sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); + // notHaveInstructorSidebars(); + // }); + + // it('Test instructor sidebars', () => { + // baseCourseSidebar('instructor', 'sample'); + // instructorSidebar(); + // baseSidebar(); + // cy.visit(['sample']); + // sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); + // }); it('Test custom sidebars and themes', () => { const sidebarElements = ['override.css', 'sidebar.json']; @@ -135,14 +135,18 @@ describe('Test sidebars', () => { cy.get(`[data-testid="${element}-delete-button"]`).should('not.exist'); cy.get(`[data-testid="${element}-upload-input"]`).attachFile(`copy_of_sample_files/site_theme/${element}`); cy.get(`[data-testid="${element}-upload-button"]`).click(); + cy.get(`[data-testid="${element}-delete-button"]`).should('exist'); }); + cy.logout(); + ['student', 'ta', 'instructor', 'grader'].forEach((user) => { cy.login(user); cy.visit(['sample']); extendedBaseSidebar(); cy.get('body').should('have.css', 'background-image').and('include', 'http://www.cs.rpi.edu/~cutler/classes/visualization/S18/images/vinca_minor_mirrored.jpg'); cy.get('#submitty-body').should('have.css', 'background-color', 'rgba(240, 240, 240, 0.85)'); + cy.logout() }); cy.login('instructor'); From 877ddfa4e39a58497ca1888ac080ea43bea96177 Mon Sep 17 00:00:00 2001 From: IDzyre Date: Mon, 22 Sep 2025 21:49:52 -0800 Subject: [PATCH 2/5] test --- site/cypress/e2e/Cypress-UI/sidebar.spec.js | 47 ++++++++++----------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/site/cypress/e2e/Cypress-UI/sidebar.spec.js b/site/cypress/e2e/Cypress-UI/sidebar.spec.js index 1efc0bb5d05..334a698e487 100644 --- a/site/cypress/e2e/Cypress-UI/sidebar.spec.js +++ b/site/cypress/e2e/Cypress-UI/sidebar.spec.js @@ -99,30 +99,29 @@ function baseCourseSidebar(user, course) { } describe('Test sidebars', () => { - // Sample Course - // it('Test student sidebars', () => { - // baseCourseSidebar('student', 'sample'); - // baseSidebar(); - // notHaveInstructorSidebars(); - // cy.visit(['sample']); - // cy.get('[data-testid="sidebar"]').contains('Student Photos').should('not.exist'); - // }); - - // it('Test ta sidebars', () => { - // baseCourseSidebar('ta', 'sample'); - // baseSidebar(); - // cy.visit(['sample']); - // sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); - // notHaveInstructorSidebars(); - // }); - - // it('Test instructor sidebars', () => { - // baseCourseSidebar('instructor', 'sample'); - // instructorSidebar(); - // baseSidebar(); - // cy.visit(['sample']); - // sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); - // }); + it('Test student sidebars', () => { + baseCourseSidebar('student', 'sample'); + baseSidebar(); + notHaveInstructorSidebars(); + cy.visit(['sample']); + cy.get('[data-testid="sidebar"]').contains('Student Photos').should('not.exist'); + }); + + it('Test ta sidebars', () => { + baseCourseSidebar('ta', 'sample'); + baseSidebar(); + cy.visit(['sample']); + sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); + notHaveInstructorSidebars(); + }); + + it('Test instructor sidebars', () => { + baseCourseSidebar('instructor', 'sample'); + instructorSidebar(); + baseSidebar(); + cy.visit(['sample']); + sidebarContains('Student Photos', `/courses/${currentSemester}/sample/student_photos`); + }); it('Test custom sidebars and themes', () => { const sidebarElements = ['override.css', 'sidebar.json']; From aac5a43488bfc35d3326b95ba95aa5c3d1ca138c Mon Sep 17 00:00:00 2001 From: IDzyre Date: Tue, 23 Sep 2025 12:31:57 -0800 Subject: [PATCH 3/5] test --- site/cypress/e2e/Cypress-UI/sidebar.spec.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/site/cypress/e2e/Cypress-UI/sidebar.spec.js b/site/cypress/e2e/Cypress-UI/sidebar.spec.js index 334a698e487..21eaa7a1b4b 100644 --- a/site/cypress/e2e/Cypress-UI/sidebar.spec.js +++ b/site/cypress/e2e/Cypress-UI/sidebar.spec.js @@ -137,16 +137,15 @@ describe('Test sidebars', () => { cy.get(`[data-testid="${element}-delete-button"]`).should('exist'); }); - cy.logout(); - - ['student', 'ta', 'instructor', 'grader'].forEach((user) => { - cy.login(user); + ['student', 'ta', 'grader'].forEach((user) => { cy.visit(['sample']); extendedBaseSidebar(); cy.get('body').should('have.css', 'background-image').and('include', 'http://www.cs.rpi.edu/~cutler/classes/visualization/S18/images/vinca_minor_mirrored.jpg'); cy.get('#submitty-body').should('have.css', 'background-color', 'rgba(240, 240, 240, 0.85)'); - cy.logout() + cy.logout(); + cy.login(user); }); + cy.logout(); cy.login('instructor'); cy.visit(['sample', 'theme']); From 2827c5c9024c4d8daafcc1a7322a6406494cf06d Mon Sep 17 00:00:00 2001 From: IDzyre Date: Tue, 23 Sep 2025 15:24:20 -0800 Subject: [PATCH 4/5] test --- site/cypress/e2e/Cypress-UI/sidebar.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/site/cypress/e2e/Cypress-UI/sidebar.spec.js b/site/cypress/e2e/Cypress-UI/sidebar.spec.js index 21eaa7a1b4b..e7d87b5b5de 100644 --- a/site/cypress/e2e/Cypress-UI/sidebar.spec.js +++ b/site/cypress/e2e/Cypress-UI/sidebar.spec.js @@ -136,14 +136,15 @@ describe('Test sidebars', () => { cy.get(`[data-testid="${element}-upload-button"]`).click(); cy.get(`[data-testid="${element}-delete-button"]`).should('exist'); }); - - ['student', 'ta', 'grader'].forEach((user) => { + sidebarContainsButton('Syllabus', 'http://www.cs.rpi.edu/academics/courses/fall18/csci1200/syllabus.php'); + cy.logout(); + ['student', 'ta', 'instructor', 'grader'].forEach((user) => { + cy.login(user); cy.visit(['sample']); extendedBaseSidebar(); cy.get('body').should('have.css', 'background-image').and('include', 'http://www.cs.rpi.edu/~cutler/classes/visualization/S18/images/vinca_minor_mirrored.jpg'); cy.get('#submitty-body').should('have.css', 'background-color', 'rgba(240, 240, 240, 0.85)'); cy.logout(); - cy.login(user); }); cy.logout(); From 48534fc0be4f13e0d3b20d44b75d9a37531085fd Mon Sep 17 00:00:00 2001 From: IDzyre Date: Tue, 23 Sep 2025 15:38:27 -0800 Subject: [PATCH 5/5] use select file --- site/cypress/e2e/Cypress-UI/sidebar.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/cypress/e2e/Cypress-UI/sidebar.spec.js b/site/cypress/e2e/Cypress-UI/sidebar.spec.js index e7d87b5b5de..7adcae3b9af 100644 --- a/site/cypress/e2e/Cypress-UI/sidebar.spec.js +++ b/site/cypress/e2e/Cypress-UI/sidebar.spec.js @@ -132,7 +132,7 @@ describe('Test sidebars', () => { // assert that we dont begin with any custom sidebar elements sidebarElements.forEach((element) => { cy.get(`[data-testid="${element}-delete-button"]`).should('not.exist'); - cy.get(`[data-testid="${element}-upload-input"]`).attachFile(`copy_of_sample_files/site_theme/${element}`); + cy.get(`[data-testid="${element}-upload-input"]`).selectFile(`cypress/fixtures/copy_of_sample_files/site_theme/${element}`); cy.get(`[data-testid="${element}-upload-button"]`).click(); cy.get(`[data-testid="${element}-delete-button"]`).should('exist'); });