Skip to content

Merge dev to main #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 93 commits into from
Apr 1, 2025
Merged

Merge dev to main #51

merged 93 commits into from
Apr 1, 2025

Conversation

Z2VvZ2Vv
Copy link
Collaborator

@Z2VvZ2Vv Z2VvZ2Vv commented Mar 31, 2025

Pull Request

Description

merging code to main

Related Issue(s) (If There Is)

  • Fixes #[Issue Number]
  • References #[Issue Number]

Type Of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • Documentation update

Checklist

Code Only

  • My code follows the project’s style guidelines.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added unit tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have ensured that my code does not introduce any errors or warnings.

Documents Only

  • My documentation follows the project’s style guidelines.
  • I have self-reviewed my document(s).
  • I have checked my documentation for grammatical errors.
  • I have ensured that my documentation is clear and easy to understand.

Additional Notes

[Add any additional context or screenshots (if applicable) here.]

Warning

Don't forget to fill in the following fields:

Field Value
Reviewers 2 Available people (prioritize QA and your n+1)
Assignees Authors of the modifications
Labels Labels corresponding to the pull request (bug fix, enhancement, code and/or document)

Z2VvZ2Vv and others added 30 commits March 10, 2025 16:49
added :
- upload sdf (parsing at same time)
- map sdf
- delete sdf
- list sdf
Comments translated in english
…the gitignore + deleting files and folder added to the gitignore + exporting the server and the app from index.js + adding 2 test files to ensure tests quality
- all api endpoint for verilog code
- verilog parser
- verify if the file is empty, then sending an error
- enhanced endpoints
- verilog parser done
- working on SDF parser & merge processing
…o the preview command for render"

This reverts commit b4d71a4.
@MistzSoftware MistzSoftware added the enhancement New feature or request label Mar 31, 2025
@MistzSoftware
Copy link
Collaborator

Backend E2E test suite

Summary

Test Suites: 1 failed, 1 total
Tests: 19 failed, 5 passed, 24 total
Snapshots: 0 total
Time: 0.41 s


✕ successfully uploads and parses an SDF file with a right project name (53 ms)
✓ fail to uploads an SDF and a Verilog file (no files uploaded) (6 ms)
✓ fail to uploads only an SDF file (no SDF file uploaded) (4 ms)
✓ fail to uploads only a Verilog file (no Verilog file uploaded) (5 ms)
✕ fail to uploads an empty SDF and an empty Verilog file (no file with content uploaded) (14 ms)
✕ fail to uploads an empty SDF file (no file with content uploaded) (13 ms)
✕ fail to uploads an empty Verilog file (no file with content uploaded) (11 ms)
✓ fail to uploads files without project name (no project name given) (11 ms)
✕ fail to uploads files (project already exists) (16 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (11 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (9 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (10 ms)
✕ fails to uploads an SDF and a Verilog files with the wrong format (invalid file format) (4 ms)
✕ fails to uploads an SDF file with the wrong format (invalid file format) (5 ms)
✕ fails to uploads a Verilog file with the wrong format (invalid file format) (5 ms)
✕ fails to uploads 2 times the same SDF file (uploading 2 times the same file) (5 ms)
✕ fails to uploads 2 times the same Verilog file (uploading 2 times the same file) (4 ms)
✕ fails to uploads 2 times the same wrong format file (uploading 2 times the same file) (4 ms)
✓ successfully fetch a project file (5 ms)
✕ fail to fetch a project that doesn't exist (project not found) (3 ms)
✕ fail to fetch a project without passing the project's name (project name is required) (3 ms)
✕ successfully fetch the list of all projects (3 ms)
✕ successfully deletes the parsed JSON file (3 ms)
✕ fail to delete the parsed JSON file (file not found) (4 ms)

Failing test details

successfully uploads and parses an SDF file with a right project name

  expect(received).toBe(expected) // Object.is equality

  Expected: 200
  Received: 400

    35 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/exampleVerilog.v');
    36 |
  > 37 |         expect(response.status).toBe(200);
       |                                 ^
    38 |         expect(response.text).toBe('Files uploaded successfully.');
    39 |     });
    40 |

    at Object.<anonymous> (tests/index.test.js:37:33)

fail to uploads an empty SDF and an empty Verilog file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: "One or both uploaded files are empty."
    Received: "Project already exists"

      80 |
      81 |         expect(response.status).toBe(400);
    > 82 |         expect(response.text).toBe('One or both uploaded files are empty.');
         |                               ^
      83 |     });
      84 |
      85 |     // Empty SDF file uploaded Test

      at Object.<anonymous> (tests/index.test.js:82:31)

fail to uploads an empty SDF file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: "One or both uploaded files are empty."
    Received: "Project already exists"

      92 |
      93 |         expect(response.status).toBe(400);
    > 94 |         expect(response.text).toBe('One or both uploaded files are empty.');
         |                               ^
      95 |     });
      96 |
      97 |     // Empty Verilog file uploaded Test

      at Object.<anonymous> (tests/index.test.js:94:31)

fail to uploads an empty Verilog file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: "One or both uploaded files are empty."
    Received: "Project already exists"

      104 |
      105 |         expect(response.status).toBe(400);
    > 106 |         expect(response.text).toBe('One or both uploaded files are empty.');
          |                               ^
      107 |     });
      108 |
      109 |     // No project name given Test

      at Object.<anonymous> (tests/index.test.js:106:31)

fail to uploads files (project already exists)

    expect(received).toBe(expected) // Object.is equality

    Expected: "The project already exists."
    Received: "Project already exists"

      127 |
      128 |         expect(response.status).toBe(400);
    > 129 |         expect(response.text).toBe('The project already exists.');
          |                               ^
      130 |     });
      131 |
      132 |     // Uploading files that doesn't exist Test

      at Object.<anonymous> (tests/index.test.js:129:31)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 400

      138 |         .attach('verilogFile', Buffer.from('test'), './testFiles/nonExistent.v');
      139 |
    > 140 |         expect(response.status).toBe(404);
          |                                 ^
      141 |         expect(response.text).toBe('File not found.');
      142 |     });
      143 |

      at Object.<anonymous> (tests/index.test.js:140:33)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 400

      150 |         .attach('verilogFile', Buffer.from('test'), './testFiles/nonExistent.v');
      151 |
    > 152 |         expect(response.status).toBe(404);
          |                                 ^
      153 |         expect(response.text).toBe('File not found.');
      154 |     });
      155 |

      at Object.<anonymous> (tests/index.test.js:152:33)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 400

      162 |         .attach('verilogFile', Buffer.from('test'), './testFiles/exampleVerilog.v');
      163 |
    > 164 |         expect(response.status).toBe(404);
          |                                 ^
      165 |         expect(response.text).toBe('File not found.');
      166 |     });
      167 |

      at Object.<anonymous> (tests/index.test.js:164:33)

fails to uploads an SDF and a Verilog files with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      175 |
      176 |         expect(response.status).toBe(400);
    > 177 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      178 |     });
      179 |
      180 |     // Uploading invalid SDF file format Test

      at Object.<anonymous> (tests/index.test.js:177:31)

fails to uploads an SDF file with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for sdfFile, only .sdf files are allowed!"

      187 |
      188 |         expect(response.status).toBe(400);
    > 189 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      190 |     });
      191 |
      192 |     // Uploading invalid Verilog file format Test

      at Object.<anonymous> (tests/index.test.js:189:31)

fails to uploads a Verilog file with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      199 |
      200 |         expect(response.status).toBe(400);
    > 201 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      202 |     });
      203 |
      204 |     // Uploading 2 times an SDF file format Test

      at Object.<anonymous> (tests/index.test.js:201:31)

fails to uploads 2 times the same SDF file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      211 |
      212 |         expect(response.status).toBe(400);
    > 213 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      214 |     });
      215 |
      216 |     // Uploading 2 times a Verilog file format Test

      at Object.<anonymous> (tests/index.test.js:213:31)

fails to uploads 2 times the same Verilog file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for sdfFile, only .sdf files are allowed!"

      223 |
      224 |         expect(response.status).toBe(400);
    > 225 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      226 |     });
      227 |
      228 |     // Uploading 2 times a wrong file format Test

      at Object.<anonymous> (tests/index.test.js:225:31)

fails to uploads 2 times the same wrong format file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      235 |
      236 |         expect(response.status).toBe(400);
    > 237 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      238 |     });
      239 |
      240 |

      at Object.<anonymous> (tests/index.test.js:237:31)

fail to fetch a project that doesn't exist (project not found)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Project not found."
    Received: "File not found."

      254 |         const response = await request(app).get('/api/map/nonExistent');
      255 |         expect(response.status).toBe(404);
    > 256 |         expect(response.text).toBe('Project not found.');
          |                               ^
      257 |     });   
      258 |     
      259 |     // Project name not given Test

      at Object.<anonymous> (tests/index.test.js:256:31)

fail to fetch a project without passing the project's name (project name is required)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 404

      260 |     it('fail to fetch a project without passing the project\'s name (project name is required)', async () => {
      261 |         const response = await request(app).get('/api/map/');
    > 262 |         expect(response.status).toBe(400);
          |                                 ^
      263 |         expect(response.text).toBe('Project name is required.');
      264 |     });   
      265 |     

      at Object.<anonymous> (tests/index.test.js:262:33)

successfully fetch the list of all projects

    expect(received).toBe(expected) // Object.is equality

    Expected: "string"
    Received: "object"

      280 |         expect(Array.isArray(data)).toBe(true);
      281 |         data.forEach(item => {
    > 282 |             expect(typeof item).toBe('string');
          |                                 ^
      283 |         });
      284 |
      285 |         // Content validation

      at tests/index.test.js:282:33
          at Array.forEach (<anonymous>)
      at Object.<anonymous> (tests/index.test.js:281:14)

successfully deletes the parsed JSON file

    expect(received).toBe(expected) // Object.is equality

    Expected: 200
    Received: 404

      294 |     it('successfully deletes the parsed JSON file', async () => {
      295 |         const response = await request(app).delete('/api/delete/testProject');
    > 296 |         expect(response.status).toBe(200);
          |                                 ^
      297 |         expect(response.text).toBe('Project deleted successfully.');
      298 |     });
      299 |

      at Object.<anonymous> (tests/index.test.js:296:33)

fail to delete the parsed JSON file (file not found)

    expect(received).toBe(expected) // Object.is equality

    - Expected  -  1
    + Received  + 11

    - Project does not exist.
    + <!DOCTYPE html>
    + <html lang="en">
    + <head>
    + <meta charset="utf-8">
    + <title>Error</title>
    + </head>
    + <body>
    + <pre>Cannot DELETE /api/delete/nonExistent</pre>
    + </body>
    + </html>
    +

      302 |         const response = await request(app).delete('/api/delete/nonExistent');
      303 |         expect(response.status).toBe(404);
    > 304 |         expect(response.text).toBe('Project does not exist.');
          |                               ^
      305 |     });
      306 | });

      at Object.<anonymous> (tests/index.test.js:304:31)

@MistzSoftware
Copy link
Collaborator

Frontend E2E Testing

Summary

Main Page Tests
✔ should display correct page title
✔ should display correct heading 1
1) should display correct heading 2
2) should display correct heading 3
3) should display correct paragraph
✔ should display correct buttons

Visualization Page Tests
✔ should display correct heading 1
4) should display correct heading 2
5) should display correct heading 3

Creation Page Tests
✔ should display correct heading 1
6) should display correct heading 2
7) should display correct heading 3

5 passing (5s)
7 failing

Failing test details

1) Main Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome to the FPGA Educational Simul…' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome to the FPGA Educational Simulator
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:36:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

2) Main Page Tests - should display correct heading 3:

Expected: Welcome to the FPGA Educational Simulator

     NoSuchElementError: no such element: Unable to locate element: {"method":"tag name","selector":"h3"}
  (Session info: chrome=134.0.6998.165)
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:521:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:524:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:456:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async Driver.execute (node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at async toWireValue (node_modules/selenium-webdriver/lib/webdriver.js:149:15)
      at async /Users/mathiasgagnepain/Documents/GitHub/2024-2025-project-4-web-fpga-team-5/frontend/node_modules/selenium-webdriver/lib/webdriver.js:195:16
      at async forEachKey (node_modules/selenium-webdriver/lib/webdriver.js:189:9)
      at async convertKeys (node_modules/selenium-webdriver/lib/webdriver.js:194:3)
      at async Driver.execute (node_modules/selenium-webdriver/lib/webdriver.js:743:22)
      at async Context.<anonymous> (tests/e2e/app.spec.ts:40:25)

3) Main Page Tests - should display correct paragraph:

     AssertionError: expected 'Signal Propagation Inspector' to include 'Get Started'
      at Context.<anonymous> (tests/e2e/app.spec.ts:46:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

4) Visualization Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome To The Visualization' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome To The Visualization
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:87:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

5) Visualization Page Tests - should display correct heading 3:

      AssertionError: expected 'Propagation Signals Interface' to equal 'Welcome To The Visualization'
      + expected - actual

      -Propagation Signals Interface
      +Welcome To The Visualization
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:92:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

6) Creation Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome to the Creation Interface' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome to the Creation Interface
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:123:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

7) Creation Page Tests - should display correct heading 3:

      AssertionError: expected 'Add Example' to equal 'Welcome to the Creation Interface'
      + expected - actual

      -Add Example
      +Welcome to the Creation Interface
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:128:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Copy link
Collaborator

@MistzSoftware MistzSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of modification to do

Copy link
Collaborator

@MistzSoftware MistzSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor changes remaining

@MistzSoftware
Copy link
Collaborator

Backend E2E test suite

Summary

Test Suites:  1 failed, 1 total
Tests:            21 failed, 3 passed, 24 total
Snapshots:   0 total
Time:             0.404 s

✕ successfully uploads and parses an SDF file with a right project name (48 ms)
✓ fail to uploads an SDF and a Verilog file (no files uploaded) (5 ms)
✓ fail to uploads only an SDF file (no SDF file uploaded) (5 ms)
✓ fail to uploads only a Verilog file (no Verilog file uploaded) (7 ms)
✕ fail to uploads an empty SDF and an empty Verilog file (no file with content uploaded) (8 ms)
✕ fail to uploads an empty SDF file (no file with content uploaded) (7 ms)
✕ fail to uploads an empty Verilog file (no file with content uploaded) (5 ms)
✕ fail to uploads files without project name (no project name given) (8 ms)
✕ fail to uploads files (project already exists) (7 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (5 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (6 ms)
✕ fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist) (5 ms)
✕ fails to uploads an SDF and a Verilog files with the wrong format (invalid file format) (6 ms)
✕ fails to uploads an SDF file with the wrong format (invalid file format) (5 ms)
✕ fails to uploads a Verilog file with the wrong format (invalid file format) (5 ms)
✕ fails to uploads 2 times the same SDF file (uploading 2 times the same file) (5 ms)
✕ fails to uploads 2 times the same Verilog file (uploading 2 times the same file) (6 ms)
✕ fails to uploads 2 times the same wrong format file (uploading 2 times the same file) (4 ms)
✕ successfully fetch a project file (4 ms)
✕ fail to fetch a project that doesn't exist (project not found) (3 ms)
✕ fail to fetch a project without passing the project's name (project name is required) (4 ms)
✕ successfully fetch the list of all projects (4 ms)
✕ successfully deletes the parsed JSON file (4 ms)
✕ fail to delete the parsed JSON file (file not found) (3 ms)

Failing test details

successfully uploads and parses an SDF file with a right project name

    expect(received).toBe(expected) // Object.is equality

    Expected: 200
    Received: 500

      35 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/exampleVerilog.v');
      36 |
    > 37 |         expect(response.status).toBe(200);
         |                                 ^
      38 |         expect(response.text).toBe('Files uploaded successfully.');
      39 |     });
      40 |

      at Object.<anonymous> (tests/index.test.js:37:33)

fail to uploads an empty SDF and an empty Verilog file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 500

      79 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/emptyVerilog.v');
      80 |
    > 81 |         expect(response.status).toBe(400);
         |                                 ^
      82 |         expect(response.text).toBe('One or both uploaded files are empty.');
      83 |     });
      84 |

      at Object.<anonymous> (tests/index.test.js:81:33)

fail to uploads an empty SDF file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 500

      91 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/exampleVerilog.v');
      92 |
    > 93 |         expect(response.status).toBe(400);
         |                                 ^
      94 |         expect(response.text).toBe('One or both uploaded files are empty.');
      95 |     });
      96 |

      at Object.<anonymous> (tests/index.test.js:93:33)

fail to uploads an empty Verilog file (no file with content uploaded)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 500

      103 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/emptyVerilog.v');
      104 |
    > 105 |         expect(response.status).toBe(400);
          |                                 ^
      106 |         expect(response.text).toBe('One or both uploaded files are empty.');
      107 |     });
      108 |

      at Object.<anonymous> (tests/index.test.js:105:33)

fail to uploads files without project name (no project name given)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 500

      114 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/exampleVerilog.v');
      115 |
    > 116 |         expect(response.status).toBe(400);
          |                                 ^
      117 |         expect(response.text).toBe('Project name is required.');
      118 |     });
      119 |

      at Object.<anonymous> (tests/index.test.js:116:33)

fail to uploads files (project already exists)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 500

      126 |         .attach('verilogFile', Buffer.from('test2'), './testFiles/exampleVerilog.v');
      127 |
    > 128 |         expect(response.status).toBe(400);
          |                                 ^
      129 |         expect(response.text).toBe('The project already exists.');
      130 |     });
      131 |

      at Object.<anonymous> (tests/index.test.js:128:33)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 500

      138 |         .attach('verilogFile', Buffer.from('test'), './testFiles/nonExistent.v');
      139 |
    > 140 |         expect(response.status).toBe(404);
          |                                 ^
      141 |         expect(response.text).toBe('File not found.');
      142 |     });
      143 |

      at Object.<anonymous> (tests/index.test.js:140:33)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 500

      150 |         .attach('verilogFile', Buffer.from('test'), './testFiles/nonExistent.v');
      151 |
    > 152 |         expect(response.status).toBe(404);
          |                                 ^
      153 |         expect(response.text).toBe('File not found.');
      154 |     });
      155 |

      at Object.<anonymous> (tests/index.test.js:152:33)

fail to uploads an SDF and a Verilog files that doesn't exist (file doesn't exist)

    expect(received).toBe(expected) // Object.is equality

    Expected: 404
    Received: 500

      162 |         .attach('verilogFile', Buffer.from('test'), './testFiles/exampleVerilog.v');
      163 |
    > 164 |         expect(response.status).toBe(404);
          |                                 ^
      165 |         expect(response.text).toBe('File not found.');
      166 |     });
      167 |

      at Object.<anonymous> (tests/index.test.js:164:33)

fails to uploads an SDF and a Verilog files with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      175 |
      176 |         expect(response.status).toBe(400);
    > 177 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      178 |     });
      179 |
      180 |     // Uploading invalid SDF file format Test

      at Object.<anonymous> (tests/index.test.js:177:31)

fails to uploads an SDF file with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for sdfFile, only .sdf files are allowed!"

      187 |
      188 |         expect(response.status).toBe(400);
    > 189 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      190 |     });
      191 |
      192 |     // Uploading invalid Verilog file format Test

      at Object.<anonymous> (tests/index.test.js:189:31)

fails to uploads a Verilog file with the wrong format (invalid file format)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      199 |
      200 |         expect(response.status).toBe(400);
    > 201 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      202 |     });
      203 |
      204 |     // Uploading 2 times an SDF file format Test

      at Object.<anonymous> (tests/index.test.js:201:31)

fails to uploads 2 times the same SDF file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      211 |
      212 |         expect(response.status).toBe(400);
    > 213 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      214 |     });
      215 |
      216 |     // Uploading 2 times a Verilog file format Test

      at Object.<anonymous> (tests/index.test.js:213:31)

fails to uploads 2 times the same Verilog file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for sdfFile, only .sdf files are allowed!"

      223 |
      224 |         expect(response.status).toBe(400);
    > 225 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      226 |     });
      227 |
      228 |     // Uploading 2 times a wrong file format Test

      at Object.<anonymous> (tests/index.test.js:225:31)

fails to uploads 2 times the same wrong format file (uploading 2 times the same file)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Invalid file(s) format."
    Received: "Invalid file type for verilogFile, only .v files are allowed!"

      235 |
      236 |         expect(response.status).toBe(400);
    > 237 |         expect(response.text).toBe('Invalid file(s) format.');
          |                               ^
      238 |     });
      239 |
      240 |

      at Object.<anonymous> (tests/index.test.js:237:31)

successfully fetch a project file

    expect(received).toBe(expected) // Object.is equality

    Expected: 200
    Received: 404

      246 |     it('successfully fetch a project file', async () => {
      247 |         const response = await request(app).get('/api/map/testProject');
    > 248 |         expect(response.status).toBe(200);
          |                                 ^
      249 |         expect(response.headers['content-type']).toMatch(/json/);
      250 |     });
      251 |

      at Object.<anonymous> (tests/index.test.js:248:33)

fail to fetch a project that doesn't exist (project not found)

    expect(received).toBe(expected) // Object.is equality

    Expected: "Project not found."
    Received: "File not found."

      254 |         const response = await request(app).get('/api/map/nonExistent');
      255 |         expect(response.status).toBe(404);
    > 256 |         expect(response.text).toBe('Project not found.');
          |                               ^
      257 |     });   
      258 |     
      259 |     // Project name not given Test

      at Object.<anonymous> (tests/index.test.js:256:31)

fail to fetch a project without passing the project's name (project name is required)

    expect(received).toBe(expected) // Object.is equality

    Expected: 400
    Received: 404

      260 |     it('fail to fetch a project without passing the project\'s name (project name is required)', async () => {
      261 |         const response = await request(app).get('/api/map/');
    > 262 |         expect(response.status).toBe(400);
          |                                 ^
      263 |         expect(response.text).toBe('Project name is required.');
      264 |     });   
      265 |     

      at Object.<anonymous> (tests/index.test.js:262:33)

successfully fetch the list of all projects

    expect(received).toEqual(expected) // deep equality

    - Expected  - 3
    + Received  + 1

    - Array [
    -   "testProject",
    - ]
    + Array []

      284 |
      285 |         // Content validation
    > 286 |         expect(data).toEqual(["testProject"]);
          |                      ^
      287 |     });
      288 |
      289 |     // ! ||--------------------------------------------------------------------------------||

      at Object.<anonymous> (tests/index.test.js:286:22)

successfully deletes the parsed JSON file

    expect(received).toBe(expected) // Object.is equality

    Expected: 200
    Received: 404

      294 |     it('successfully deletes the parsed JSON file', async () => {
      295 |         const response = await request(app).delete('/api/delete/testProject');
    > 296 |         expect(response.status).toBe(200);
          |                                 ^
      297 |         expect(response.text).toBe('Project deleted successfully.');
      298 |     });
      299 |

      at Object.<anonymous> (tests/index.test.js:296:33)

fail to delete the parsed JSON file (file not found)

    expect(received).toBe(expected) // Object.is equality

    - Expected  -  1
    + Received  + 11

    - Project does not exist.
    + <!DOCTYPE html>
    + <html lang="en">
    + <head>
    + <meta charset="utf-8">
    + <title>Error</title>
    + </head>
    + <body>
    + <pre>Cannot DELETE /api/delete/nonExistent</pre>
    + </body>
    + </html>
    +

      302 |         const response = await request(app).delete('/api/delete/nonExistent');
      303 |         expect(response.status).toBe(404);
    > 304 |         expect(response.text).toBe('Project does not exist.');
          |                               ^
      305 |     });
      306 | });

      at Object.<anonymous> (tests/index.test.js:304:31)

@MistzSoftware
Copy link
Collaborator

Frontend E2E Testing

Summary

Main Page Tests
1) should display correct page title
✔ should display correct heading 1
2) should display correct heading 2
3) should display correct heading 3
4) should display correct paragraph
✔ should display correct buttons

Visualization Page Tests
✔ should display correct heading 1
5) should display correct heading 2
6) should display correct heading 3

Creation Page Tests
✔ should display correct heading 1
7) should display correct heading 2
8) should display correct heading 3

4 passing (7s)
8 failing

Failing test details

1) Main Page Tests - should display correct page title:

     AssertionError: expected 'SPIN - Cnes' to include 'SPIN - CNES'
      at Context.<anonymous> (tests/e2e/app.spec.ts:26:26)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

2) Main Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome to the FPGA Educational Simul…' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome to the FPGA Educational Simulator
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:36:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

3) Main Page Tests - should display correct heading 3:

     NoSuchElementError: no such element: Unable to locate element: {"method":"tag name","selector":"h3"}
  (Session info: chrome=134.0.6998.165)
      at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:521:15)
      at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:524:13)
      at Executor.execute (node_modules/selenium-webdriver/lib/http.js:456:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async Driver.execute (node_modules/selenium-webdriver/lib/webdriver.js:745:17)
      at async toWireValue (node_modules/selenium-webdriver/lib/webdriver.js:149:15)
      at async /Users/mathiasgagnepain/Documents/GitHub/2024-2025-project-4-web-fpga-team-5/frontend/node_modules/selenium-webdriver/lib/webdriver.js:195:16
      at async forEachKey (node_modules/selenium-webdriver/lib/webdriver.js:189:9)
      at async convertKeys (node_modules/selenium-webdriver/lib/webdriver.js:194:3)
      at async Driver.execute (node_modules/selenium-webdriver/lib/webdriver.js:743:22)
      at async Context.<anonymous> (tests/e2e/app.spec.ts:40:25)

4) Main Page Tests - should display correct paragraph:

     AssertionError: expected 'Signal Propagation Inspector' to include 'Get Started'
      at Context.<anonymous> (tests/e2e/app.spec.ts:46:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

5) Visualization Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome To The Visualization' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome To The Visualization
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:87:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

6) Visualization Page Tests - should display correct heading 3:

      AssertionError: expected 'Propagation Signals Interface' to equal 'Welcome To The Visualization'
      + expected - actual

      -Propagation Signals Interface
      +Welcome To The Visualization
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:92:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

7) Creation Page Tests - should display correct heading 2:

      AssertionError: expected 'Welcome to the Creation Interface' to equal 'Signal Propagation Inspector'
      + expected - actual

      -Welcome to the Creation Interface
      +Signal Propagation Inspector
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:123:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

8) Creation Page Tests - should display correct heading 3:

      AssertionError: expected 'Add Example' to equal 'Welcome to the Creation Interface'
      + expected - actual

      -Add Example
      +Welcome to the Creation Interface
      
      at Context.<anonymous> (tests/e2e/app.spec.ts:128:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

@Z2VvZ2Vv
Copy link
Collaborator Author

Z2VvZ2Vv commented Apr 1, 2025

👌

Copy link
Collaborator

@MistzSoftware MistzSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requires, issues in the PR comments hadn't be fixed

Copy link
Collaborator

@MaximeTAlgosup MaximeTAlgosup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MistzSoftware
Copy link
Collaborator

With the approval of the tech lead, accept this PR even with failing tests

@Z2VvZ2Vv
Copy link
Collaborator Author

Z2VvZ2Vv commented Apr 1, 2025

Ok, perfect.

@MaximeTAlgosup MaximeTAlgosup merged commit 802a91f into main Apr 1, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants