Please include the steps to reproduce the bug.
-
testing with normal frontend server
- cd into frontend/, run
npm run serve to boot up the local server
- click and run
chartView_scrollButton.cy.js (note this is not specific to this testcase, but just as an example)
- observe that test fails
-
cypress test-default mode
- go back to root directory of reposense, run
./gradlew testFrontend -Pci or any command that invlude serveTestReportDefault
- observe that test pass
What was expected to happen?
Both runs should either both pass or both fails
What actually happened? Please include a screenshot of the output.
One pass one fail for same test case.
The issue is in frontend/vite.config.mts.
let publicDir = 'public';
if (mode === 'test-default') {
publicDir = '../build/serveTestReport/default/reposense-report';
} else if (mode === 'test-portfolio') {
publicDir = '../build/serveTestReport/portfolio/reposense-report';
}
The variable mode comes from the Vite command line, usually via the npm script that launches Vite. For example, in frontend/serve.json
- frontend/package.json:7 serve: runs vite
- frontend/package.json:14 serveTestDefault: runs vite --mode test-default --port 9000 --open
- frontend/package.json:15 serveTestPortfolio: runs vite --mode test-portfolio --port 9001 --open
In case 1 the publicDir is 'public' and we use the config in frontend/public/summary.json. In case 2 we use config in /build/serveTestReport/portfolio/reposense-report/summary.json. So essentially we are analying different reports
Please include the steps to reproduce the bug.
testing with normal frontend server
npm run serveto boot up the local serverchartView_scrollButton.cy.js(note this is not specific to this testcase, but just as an example)cypress test-default mode
./gradlew testFrontend -Pcior any command that invludeserveTestReportDefaultWhat was expected to happen?
Both runs should either both pass or both fails
What actually happened? Please include a screenshot of the output.
One pass one fail for same test case.
The issue is in
frontend/vite.config.mts.The variable
modecomes from the Vite command line, usually via the npm script that launches Vite. For example, infrontend/serve.jsonIn case 1 the
publicDiris 'public' and we use the config infrontend/public/summary.json. In case 2 we use config in/build/serveTestReport/portfolio/reposense-report/summary.json. So essentially we are analying different reports