[E2E][CourseStats] Fix test numbers

This commit is contained in:
Aaro Koivukangas
2026-08-24 21:48:56 +03:00
parent e99119a868
commit b84c2c1e9e
+37 -34
View File
@@ -422,6 +422,9 @@ test.describe('Basic user', () => {
await searchByCourseCode(page, 'TKT20001')
await page.getByTestId(`course-TKT20001`).click()
// This step should *not* be needed to make this test work (but it is)
await expect(page.getByRole('heading', { name: 'Selected course' })).toBeVisible()
await expect(page.getByText('TKT20001', { exact: true })).toBeVisible() // Tietorakenteet ja algoritmit
await expect(page.getByText('AYTKT20001', { exact: true })).toBeVisible() // Avoin yo: Tietorakenteet ja algoritmit
await expect(page.getByText('BSCS1003')).toBeVisible() // Data Structures and Algorithms
@@ -631,14 +634,14 @@ test.describe('Basic user', () => {
test('Show grades off, Separate by semesters off', async ({ page }) => {
const tableContents = [
// [Time, Total attempts, Passed, Failed, Pass rate, Enrollments]
['Total', 146, 140, 6, '95.89 %', 73],
['Total', 156, 140, 16, '89.74 %', 73],
['2023-2024', 7, 1, 0, '14.29 %', 7],
['2022-2023', 43, 27, 0, '62.79 %', 43],
['2021-2022', 23, 15, 0, '65.22 %', 23],
['2020-2021', 23, 23, 0, '100.00 %', null],
['2019-2020', 28, 28, 0, '100.00 %', null],
['2018-2019', 28, 26, 2, '92.86 %', null],
['2017-2018', 23, 19, 4, '82.61 %', null],
['2019-2020', 29, 28, 1, '96.55 %', null],
['2018-2019', 32, 26, 6, '81.25 %', null],
['2017-2018', 28, 19, 9, '67.86 %', null],
['2016-2017', 1, 1, 0, '100.00 %', null],
]
await checkTableContents(page, tableContents)
@@ -671,14 +674,14 @@ test.describe('Basic user', () => {
test('Show grades on, Separate by semesters off', async ({ page }) => {
const tableContents = [
// [Time, Total attempts, 0, 1, 2, 3, 4, 5, Other passed]
['Total', 146, 6, 3, 8, 5, 24, 99, 1],
['Total', 156, 16, 3, 8, 5, 24, 99, 1],
['2023-2024', 7, 0, 0, 0, 0, 0, 1, 0],
['2022-2023', 43, 0, 0, 0, 0, 6, 21, 0],
['2021-2022', 23, 0, 0, 0, 0, 2, 13, 0],
['2020-2021', 23, 0, 0, 2, 0, 2, 18, 1],
['2019-2020', 28, 0, 1, 4, 1, 5, 17, 0],
['2018-2019', 28, 2, 2, 1, 2, 3, 18, 0],
['2017-2018', 23, 4, 0, 1, 2, 5, 11, 0],
['2019-2020', 29, 1, 1, 4, 1, 5, 17, 0],
['2018-2019', 32, 6, 2, 1, 2, 3, 18, 0],
['2017-2018', 28, 9, 0, 1, 2, 5, 11, 0],
['2016-2017', 1, 0, 0, 0, 0, 1, 0, 0],
]
await toggleShowGrades(page)
@@ -799,7 +802,7 @@ test.describe('Basic user', () => {
['Kevät 2015', 3, 3, 0, null, '100.00 %', '0.00 %'],
['Syksy 2014', 3, 3, 0, null, '100.00 %', '0.00 %'],
['Kevät 2014', 1, 1, 0, null, '100.00 %', '0.00 %'],
['Syksy 2013', 0, 0, 0, 0, '–', '–'],
['Syksy 2013', 0, 0, 0, null, '–', '–'],
['Kevät 2013', 0, 0, 0, 0, '–', '–'],
['Syksy 2012', 4, 4, 0, null, '100.00 %', '0.00 %'],
['Kevät 2012', 1, 1, 0, null, '100.00 %', '0.00 %'],
@@ -891,7 +894,7 @@ test.describe('Basic user', () => {
['Kevät 2015', 3, 0, 0, 0, 0, 0, 0, 3, null, '100.00 %', '0.00 %'],
['Syksy 2014', 3, 0, 0, 1, 0, 0, 2, 0, null, '100.00 %', '0.00 %'],
['Kevät 2014', 1, 0, 0, 0, 0, 0, 1, 0, null, '100.00 %', '0.00 %'],
['Syksy 2013', 0, 0, 0, 0, 0, 0, 0, 0, 0, '–', '–'],
['Syksy 2013', 0, 0, 0, 0, 0, 0, 0, 0, null, '–', '–'],
['Kevät 2013', 0, 0, 0, 0, 0, 0, 0, 0, 0, '–', '–'],
['Syksy 2012', 4, 0, 0, 0, 0, 3, 1, 0, null, '100.00 %', '0.00 %'],
['Kevät 2012', 1, 0, 0, 0, 0, 0, 1, 0, null, '100.00 %', '0.00 %'],
@@ -935,18 +938,18 @@ test.describe('Basic user', () => {
test('Show grades off, Separate by semesters off', async ({ page }) => {
const tableContents = [
// [Time, Total attempts, Passed, Failed, Pass rate, Enrollments]
['Total', 246, 237, 9, '96.34 %', 90],
['Total', 266, 241, 25, '90.60 %', 90],
['2023-2024', 8, 2, 0, '25.00 %', 8],
['2022-2023', 44, 28, 0, '63.64 %', 44],
['2021-2022', 38, 27, 0, '71.05 %', 38],
['2020-2021', 33, 33, 0, '100.00 %', null],
['2019-2020', 57, 56, 1, '98.25 %', null],
['2018-2019', 40, 38, 2, '95.00 %', null],
['2017-2018', 29, 25, 4, '86.21 %', null],
['2020-2021', 34, 34, 0, '100.00 %', null],
['2019-2020', 60, 57, 3, '95.00 %', null],
['2018-2019', 46, 39, 7, '84.78 %', null],
['2017-2018', 35, 26, 9, '74.29 %', null],
['2016-2017', 7, 6, 1, '85.71 %', null],
['2015-2016', 3, 3, 0, '100.00 %', null],
['2014-2015', 6, 6, 0, '100.00 %', null],
['2013-2014', 1, 1, 0, '100.00 %', null],
['2015-2016', 5, 3, 2, '60.00 %', null],
['2014-2015', 7, 6, 1, '85.71 %', null],
['2013-2014', 2, 1, 1, '50.00 %', null],
['2012-2013', 4, 4, 0, '100.00 %', null],
['2011-2012', 1, 1, 0, '100.00 %', null],
['2010-2011', 1, 1, 0, '100.00 %', null],
@@ -989,7 +992,7 @@ test.describe('Basic user', () => {
['Kevät 2015', 3, 3, 0, null, '100.00 %', '0.00 %'],
['Syksy 2014', 3, 3, 0, null, '100.00 %', '0.00 %'],
['Kevät 2014', 1, 1, 0, null, '100.00 %', '0.00 %'],
['Syksy 2013', 0, 0, 0, 0, '–', '–'],
['Syksy 2013', 0, 0, 0, null, '–', '–'],
['Kevät 2013', 0, 0, 0, 0, '–', '–'],
['Syksy 2012', 4, 4, 0, null, '100.00 %', '0.00 %'],
['Kevät 2012', 1, 1, 0, null, '100.00 %', '0.00 %'],
@@ -1026,18 +1029,18 @@ test.describe('Basic user', () => {
test('Show grades on, Separate by semesters off', async ({ page }) => {
const tableContents = [
// [Time, Total attempts, 0, 1, 2, 3, 4, 5, Other passed]
['Total', 246, 9, 4, 14, 9, 37, 168, 5],
['Total', 266, 25, 6, 15, 9, 37, 169, 5],
['2023-2024', 8, 0, 0, 0, 0, 0, 2, 0],
['2022-2023', 44, 0, 0, 0, 0, 6, 22, 0],
['2021-2022', 38, 0, 0, 1, 0, 2, 24, 0],
['2020-2021', 33, 0, 0, 2, 1, 2, 27, 1],
['2019-2020', 57, 1, 1, 5, 3, 9, 38, 0],
['2018-2019', 40, 2, 3, 2, 2, 6, 25, 0],
['2017-2018', 29, 4, 0, 2, 2, 6, 15, 0],
['2020-2021', 34, 0, 0, 2, 1, 2, 28, 1],
['2019-2020', 60, 3, 2, 5, 3, 9, 38, 0],
['2018-2019', 46, 7, 3, 3, 2, 6, 25, 0],
['2017-2018', 35, 9, 1, 2, 2, 6, 15, 0],
['2016-2017', 7, 1, 0, 0, 1, 1, 4, 0],
['2015-2016', 3, 0, 0, 1, 0, 0, 1, 1],
['2014-2015', 6, 0, 0, 1, 0, 0, 2, 3],
['2013-2014', 1, 0, 0, 0, 0, 0, 1, 0],
['2015-2016', 5, 2, 0, 1, 0, 0, 1, 1],
['2014-2015', 7, 1, 0, 1, 0, 0, 2, 3],
['2013-2014', 2, 1, 0, 0, 0, 0, 1, 0],
['2012-2013', 4, 0, 0, 0, 0, 3, 1, 0],
['2011-2012', 1, 0, 0, 0, 0, 0, 1, 0],
['2010-2011', 1, 0, 0, 0, 0, 1, 0, 0],
@@ -1081,7 +1084,7 @@ test.describe('Basic user', () => {
['Kevät 2015', 3, 0, 0, 0, 0, 0, 0, 3, null, '100.00 %', '0.00 %'],
['Syksy 2014', 3, 0, 0, 1, 0, 0, 2, 0, null, '100.00 %', '0.00 %'],
['Kevät 2014', 1, 0, 0, 0, 0, 0, 1, 0, null, '100.00 %', '0.00 %'],
['Syksy 2013', 0, 0, 0, 0, 0, 0, 0, 0, 0, '–', '–'],
['Syksy 2013', 0, 0, 0, 0, 0, 0, 0, 0, null, '–', '–'],
['Kevät 2013', 0, 0, 0, 0, 0, 0, 0, 0, 0, '–', '–'],
['Syksy 2012', 4, 0, 0, 0, 0, 3, 1, 0, null, '100.00 %', '0.00 %'],
['Kevät 2012', 1, 0, 0, 0, 0, 0, 1, 0, null, '100.00 %', '0.00 %'],
@@ -1213,17 +1216,17 @@ test.describe('Only course statistics', () => {
const attemptsTableContents = [
// [Time, Total attempts, Passed, Failed, Pass rate, Enrollments]
['Total *', 227, 219, 8, '96.48 %', 82],
['Total *', 244, 223, 21, '91.39 %', 82],
emptyYear('2023-2024'),
['2022-2023', 44, 28, 0, '63.64 %', 44],
['2021-2022', 38, 27, 0, '71.05 %', 38],
['2020-2021', 33, 33, 0, '100.00 %', null],
['2019-2020', 57, 56, 1, '98.25 %', null],
['2018-2019', 40, 38, 2, '95.00 %', null],
['2017-2018', 29, 25, 4, '86.21 %', null],
['2020-2021', 34, 34, 0, '100.00 %', null],
['2019-2020', 60, 57, 3, '95.00 %', null],
['2018-2019', 46, 39, 7, '84.78 %', null],
['2017-2018', 35, 26, 9, '74.29 %', null],
['2016-2017', 7, 6, 1, '85.71 %', null],
emptyYear('2015-2016'),
['2014-2015', 6, 6, 0, '100.00 %', null],
['2014-2015', 7, 6, 1, '85.71 %', null],
emptyYear('2013-2014'),
emptyYear('2012-2013'),
emptyYear('2011-2012'),